Reviewprompt onlyIntermediate

Review Until Approved

Automates the process of reviewing a Pull Request and continuously iterating until it receives approval. The agent checks the review status, makes necessary changes, and responds to feedback until the PR is approved.

← all loops
code reviewautomationPR workflowcontinuous integration

Goal

Get PR approval

How to Run

Run this loop in your preferred coding environment to automatically handle PR reviews and revisions until approval is achieved.

  1. 01

    Initiate the Loop

    Start the loop in your chosen environment (Cursor, Claude Code, Codex, etc.) by providing the initial kickoff prompt.

  2. 02

    Check Review Status

    The agent will run 'review status' to determine the current state of the PR review.

  3. 03

    Act Based on Status

    Depending on the status (pending, changes requested, approved), the agent will either make code changes, wait, or exit.

  4. 04

    Repeat Until Approved

    Continue the cycle until the exit condition 'Approval received' is satisfied or the max iterations are reached.

Workflow Steps

  1. 01

    Step 1

    Check current PR review status using 'review status' command

  2. 02

    Step 2

    If status is 'pending', wait for a specified interval before rechecking

  3. 03

    Step 3

    If status is 'changes_requested', analyze feedback and modify the PR accordingly

  4. 04

    Step 4

    If status is 'approved', exit the loop successfully

  5. 05

    Step 5

    If max iterations reached without approval, halt and report failure

Kickoff Prompt

Start the "Review Until Approved" loop.

Goal: Get PR approval
Max iterations: 10
Between iterations run: review status
Exit when: Approval received


Goal: Achieve PR approval. You are an automated code reviewer. Continuously check the PR review status using the command 'review status' and take appropriate actions based on the result. If changes are requested, implement them and push updates. Repeat this process until the PR is approved or until you've reached 10 iterations. Only exit when the exit condition 'Approval received' is met. Context: You're working in a collaborative development environment where timely and accurate PR reviews are critical for deployment.

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

Guardrails

hardcoded
  • ·Ensure the PR is valid and accessible before starting the loop
  • ·Avoid excessive API calls by enforcing a minimum delay between checks
  • ·Validate that the approving reviewer has necessary permissions
  • ·Limit iterations to prevent infinite loops or stale processes

Flow Diagram

rendering…

Related loops — Review