Reviewprompt onlyIntermediate

PR Polish Loop

An automated workflow loop that iteratively reviews and improves pull request code quality to achieve merge readiness. This loop focuses on code standards, testing, documentation, and best practices through self-paced agent iterations.

← all loops
code-reviewquality-assurancetestingdocumentationautomationpr-reviewmerge-readiness

Goal

Improve merge readiness

How to Run

Run this loop in your preferred AI coding environment to automatically polish pull requests until they meet merge readiness criteria

  1. 01

    Initialize the Loop

    Copy the kickoff prompt and paste it into your AI coding agent interface (Cursor, Claude Code, Codex, OpenCode, or Gemini CLI)

  2. 02

    Monitor Iterations

    The agent will automatically run merge readiness checks after each improvement cycle and continue iterating until merge ready or max iterations reached

  3. 03

    Review Changes

    Inspect changes made by each iteration and provide feedback or let the agent continue polishing automatically

Workflow Steps

  1. 01

    Code Quality Assessment

    Run static analysis tools (linters, formatters) to identify code style violations and technical debt

  2. 02

    Test Coverage Enhancement

    Analyze test coverage and add missing tests for edge cases, error conditions, and public APIs

  3. 03

    Documentation Improvement

    Enhance inline documentation, API docs, and README files to ensure clarity and completeness

  4. 04

    Security & Performance Audit

    Conduct security scanning and performance optimization to meet production standards

  5. 05

    Merge Readiness Verification

    Execute comprehensive merge readiness check including all quality gates and criteria

Kickoff Prompt

Start the "PR Polish Loop" loop.

Goal: Improve merge readiness
Max iterations: 10
Between iterations run: merge readiness review
Exit when: Merge ready


You are a PR Polish Loop agent. Your goal is to improve this pull request's merge readiness through iterative improvements. Begin by understanding the current state of the codebase and PR changes. Execute the merge readiness check to assess current status, then systematically address any issues found. Focus on code quality, testing, documentation, and best practices. After each improvement cycle, run the merge readiness check again. Continue iterating until all merge readiness criteria are met or you reach maximum iterations. Document your changes clearly and avoid modifying core business logic unless explicitly requested. Output the final assessment when complete.

Self-pace this loop. After each iteration, run `merge readiness review` and evaluate the output, and only continue if the exit condition is not met (Merge ready). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.

Guardrails

hardcoded
  • ·Never modify core business logic without explicit approval in kickoff prompt
  • ·Preserve existing test behavior and coverage
  • ·Maintain backward compatibility for all API changes
  • ·Only add dependencies if specifically requested
  • ·Focus on code quality improvements, not feature additions
  • ·Respect existing code style and conventions
  • ·Document all significant changes made during polishing

Flow Diagram

rendering…

Related loops — Review