Every 15 minutes, check open PRs, fix CI, rebase, nudge reviewers.
/loop 15m Start the "PR Babysitter" loop. - Goal: All open PRs labeled "watch" are healthy — CI green, rebased on main, not stale, reviewers engaged. - Max iterations: 20 - Between iterations run: `gh pr list --label "watch" --json number,title,statusCheckRollup,mergeable` - Exit when: each watched PR is either green and current, or has been escalated after 3 failed fix attempts. Steps: 1. List all open PRs with the "watch" label 2. For each PR, check: - CI status: are all checks passing? - Merge state: is it behind main? Does it have conflicts? - Staleness: has it been idle for 24+ hours with no reviewer activity? 3. For failing CI: attempt one fix per iteration (read logs, apply fix, push) 4. For merge conflicts: rebase on main and force-push the branch 5. For stale PRs: post a comment tagging reviewers 6. If a PR has failed 3+ fix attempts: escalate (add "needs-attention" label, post summary comment) 7. Wait 15 minutes before next check Self-pacing instructions: After each iteration, run the check command, read the output, and only continue if the exit condition is not met. Stop when exit condition passes or max iterations reached. Give a short status update each pass.
How it works