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.
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.
- 01
Initiate the Loop
Start the loop in your chosen environment (Cursor, Claude Code, Codex, etc.) by providing the initial kickoff prompt.
- 02
Check Review Status
The agent will run 'review status' to determine the current state of the PR review.
- 03
Act Based on Status
Depending on the status (pending, changes requested, approved), the agent will either make code changes, wait, or exit.
- 04
Repeat Until Approved
Continue the cycle until the exit condition 'Approval received' is satisfied or the max iterations are reached.
Workflow Steps
- 01
Step 1
Check current PR review status using 'review status' command
- 02
Step 2
If status is 'pending', wait for a specified interval before rechecking
- 03
Step 3
If status is 'changes_requested', analyze feedback and modify the PR accordingly
- 04
Step 4
If status is 'approved', exit the loop successfully
- 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
Related loops — Review
Review
Address Review Feedback
This loop systematically identifies, analyzes, and resolves unresolved code review comments to improve code quality and ensure all feedback is addressed before merging.
Review
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.
Review
Self-Review Loop
A self-paced loop for coding agents to iteratively review and improve their pull request quality before submission. The agent acts on the codebase, runs automated checks, inspects results, and refines changes until all quality criteria are met.