Triage, review, and merge PRs
Run CI checks and merge pull requests after triage and review until the queue clears.
Use this when
A busy queue with reliable CI and an established merge policy, where triage-review-merge is already mechanical for a human. Advanced by design: this loop has merge rights.
Done when
✓ CI green is the only merge condition worth trusting — verify branch protection enforces it server-side rather than relying on the loop to check. Keep merges to non-production branches unless a human approves the release, and read the merge log after each run: this is the one loop here whose mistakes are hard to reverse.
Why it works
It chains three stages behind one scheduler, so CI status is the gate on every merge rather than a step someone can skip when the queue is long. The 15-pass cap bounds a run that would otherwise keep grinding through a queue that keeps refilling.
Implementation note
When to use: repos with an established PR queue where triage/review/merge is currently a manual bottleneck and CI coverage is solid enough to trust as a merge gate. Safety: this loop merges PRs autonomously — require branch protection and a passing-CI requirement on the target branch before enabling, and start it against a non-default branch or a low-traffic repo until you trust its judgment on what counts as reviewed.
Source: Jhin97 ↗graded C · 70/100 — how grades work →
More ci loops
Ship specs through code review
Run spec-driven workflow loop every 10 minutes: plan work, collect reviews, execute tasks, open pull requests.
Babysit many PRs at once
Keep every PR labeled codex-watch healthy: fix CI failures, rebase behind-main branches, and nudge pending reviewers on a 15-minute cadence.
Get the build green
Run the build, fix the first error, and repeat until npm run build exits 0, with a 10-turn cap.