babysit-pr
Skill17 starsChanged 7 months agoApache-2.0View on GitHub
Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep watching open PRs so fresh review feedback is surfaced promptly. Use when the user asks Codex to monitor a PR, watch CI, handle review comments, or keep an eye on failures and feedback on an open PR.
- Commits and pushes
55 other projects use a version of this, 3 of them edited.
Adopted by
Most recently taken up by
- scottwater/skillstheir own version, first seen Nov 8, 2026
- JeffreyFerreiras/ai-skillstheir own version, first seen Nov 8, 2026
- niilohlin/skillstheir own version, first seen Nov 8, 2026
- normalled/apijacktheir own version, first seen Nov 8, 2026
- rock3r/headroomtheir own version, first seen Nov 8, 2026
- marcellocurto/skillstheir own version, first seen Nov 8, 2026
Used with
Projects with it also use leaving-pr-comments, sol-loop and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
scottwaterSkillleaving-pr-comments
Format comments an agent posts on GitHub on the user's behalf. Use whenever leaving a PR comment, review comment, or reply.
Also in 9 projects that use this
scottwaterSkillsol-loop
Review a change with GPT Sol in a loop until both agents agree. Use when the user says sol loop, or when another skill asks for a Sol review.
Also in 7 projects that use this
Nexus-Organization-InfosecSkillfull-stop
Shut down the Full Control phone-bridge completely — end Claude's watch loop, stop the bridge server (server.py started via ensure_server.ps1), and mark Claude offline in the app. Use whenever the user invokes /full-stop or says "stop full control", "stop the watch loop", "shut down the bridge/server", or "stop the ps1". Counterpart of [[full-control]], which starts everything.
Also in 9 projects that use this
assisjpSkillfile-pr
Prepare and open or update an authorized pull request with a concise problem-first description and verifiable evidence. Use when the user asks to create, file, open, or update a PR. Do not use merely to review a diff or when publication is not authorized.
Also in 13 projects that use this
shhacSkillfull-send
Complete an explicitly assigned task autonomously through parallel agents, peer-reviewed decisions, and automatic retries of temporary blockers. Use only when the user explicitly invokes Full Send.
Also in 8 projects that use this
assisjpSkilltakeover
Take over an existing branch, pull request, worktree, or agent handoff while preserving the original goal, contributor credit, and concurrent work. Use when the user asks to take over, finish, rescue, or continue someone else's implementation. Do not use to replace a clear request to start new work.
Also in 4 projects that use this
- +1 more from scottwater
Other versions55 projects use a version of this.
Word for word · 0
None found.
Edited · 3
- jellydn/my-ai-tools★ 12769% same
- gannonh/skills★ 257% same
- danielvogler/ai-skills-library★ 081% same
Wrote their own version · 52
- BuilderIO/agent-native★ 7.6ksame name
- camunda/camunda★ 4.4ksame name
- t3dotgg/tstack★ 2.5ksame name
- UniClipboard/UniClipboard★ 2ksame name
- rome-os/rome★ 894same name
- trailofbits/coop★ 808same name
- Mr-Quin/danmaku-anywhere★ 550same name
- tariknz/irdashies★ 270same name
- owid/etl★ 163same name
- amElnagdy/review-skills★ 135same name
42 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository19 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-browserSkill
- agentic-legibilitySkill
- better-result-adoptSkill
- code-breaking-changesSkill
- code-review-change-sizeSkill
- code-reviewSkill
- code-review-testingSkill
- drizzle-migration-conflict-resolutionSkill
- gh-pr-writingSkill
- knip-deadcodeSkill
- onequery-blog-imagesSkill
- onequery-bugSkill
- onequery-pr-bodySkill
- protobufSkill
- react-no-use-effectSkill
- tanstack-query-best-practicesSkill
- tanstack-router-best-practicesSkill
- xstateSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
45 rules. 0 are common, 26 are distinctive, and 19 are very specific to this project.
0
Common
Most of the 54 edited versions we read keep these.
26
Distinctive
This author's own choices. Worth a look.
19
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Do not stop merely because a single snapshot returns idle while checks are still pending.
- Very specific: line 20
No PR argument: infer the PR from the current branch (--pr auto)
- Very specific: line 26
When the user asks to "monitor"/"watch"/"babysit" a PR, start with the watcher's continuous mode (--watch) unless you are intentionally …
- Very specific: line 27
Run the watcher script to snapshot PR/review/CI state (or consume each streamed snapshot from --watch).
- Very specific: line 29
If diagnose_ci_failure is present, inspect failed run logs and classify the failure.
- Distinctive: line 30
If the failure is likely caused by the current branch, patch code locally, commit, and push.
- Very specific: line 31
If process_review_comment is present, inspect surfaced review items and decide whether to address them.
- Distinctive: line 32
If a review item is actionable and correct, patch code locally, commit, push, and then mark the associated review thread/comment as …
- Very specific: line 34
If the failure is likely flaky/unrelated and retry_failed_checks is present, rerun failed jobs with --retry-failed-now.
- Very specific: line 35
If both actionable review feedback and retry_failed_checks are present, prioritize review feedback first.
- Distinctive: line 37
After any push or rerun action, immediately return to step 1 and continue polling on the updated SHA/state.
- Very specific: line 38
If you had been using --watch before pausing to patch/commit/push, relaunch --watch yourself in the same turn immediately after the push …
- Very specific: line 69
Use gh commands to inspect failed runs before deciding to rerun.
- Very specific: line 74
Prefer treating failures as branch-related when logs point to changed code (compile/test/lint/typecheck/snapshots/static analysis in …
- Distinctive: line 76
Prefer treating failures as flaky/unrelated when logs show transient infra/external issues (timeouts, runner provisioning failures, …
- Distinctive: line 78
If classification is ambiguous, perform one manual diagnosis attempt before choosing rerun.
- Very specific: line 80
Read .codex/skills/babysit-pr/references/heuristics.md for a concise checklist.
- Distinctive: line 93
When you agree with a comment and it is actionable:
- Distinctive: line 98
After the push succeeds, mark the associated GitHub review thread/comment as resolved.
- Very specific: line 100
If monitoring was running in --watch mode, restart --watch immediately after the push in the same turn.
- Distinctive: line 103
If a code review comment/thread is already marked as resolved in GitHub, treat it as non-actionable and safely ignore it unless new …
- Distinctive: line 108
Avoid destructive git commands.
- Distinctive: line 109
Do not switch branches unless necessary to recover context.
- Distinctive: line 110
Before editing, check for unrelated uncommitted changes.
- Distinctive: line 111
After each successful fix, commit and git push, then re-run the watcher.
- Very specific: line 112
If you interrupted a live --watch session to make the fix, restart --watch immediately after the push in the same turn.
- Very specific: line 113
Do not run multiple concurrent --watch processes for the same PR/state file.
- Distinctive: line 122
Use this loop in a live Codex session:
- Distinctive: line 127
Check CI summary, new review items, and mergeability/conflict status.
- Distinctive: line 132
If you pushed a commit, resolved a review thread, replied to a review comment, or triggered a rerun, report the action briefly and continue …
- Very specific: line 133
After a review-fix push, proactively restart continuous monitoring (--watch) in the same turn unless a strict stop condition has already …
- Distinctive: line 134
If everything is passing, mergeable, not blocked on required review approval, and there are no unaddressed review items, report that the PR …
- Distinctive: line 135
If blocked on a user-help-required issue (infra outage, exhausted flaky retries, unclear reviewer request, permissions), report the blocker …
- Very specific: line 138
When the user explicitly asks to monitor/watch/babysit a PR, prefer --watch so polling continues autonomously in one command.
- Distinctive: line 139
Do not stop to ask the user whether to continue polling.
- Distinctive: line 140
Do not hand control back to the user after a review-fix push just because a new SHA was created.
- Very specific: line 141
If a --watch process is still running and no strict stop condition has been reached, the babysitting task is still in progress.
- Distinctive: line 144
Keep review polling aggressive and continue monitoring even after CI turns green:
- Distinctive: line 147
After CI turns green: keep polling at the base cadence while the PR remains open so newly posted review comments are surfaced promptly …
- Distinctive: line 149
If CI stops being green again (new commit, rerun, or regression): stay on the base polling cadence.
- Distinctive: line 150
If any poll shows the PR is merged or otherwise closed: stop polling immediately and report the terminal state.
- Distinctive: line 153
Stop only when one of the following is true:
- Distinctive: line 171
Treat push confirmations, intermediate CI snapshots, ready-to-merge snapshots, and review-action updates as progress updates only.
- Very specific: line 174
When CI first transitions to all green for the current SHA, emit a one-time celebratory progress update (do not repeat it on every green …
- Distinctive: line 175
Do not send the final summary while a watcher terminal is still running unless the watcher has emitted/confirmed a strict stop condition.
“Common” is measured: kept by at least 6 in 10 of the 54 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PR Babysitter
Objective
Babysit a PR persistently until one of these terminal outcomes occurs:
- The PR is merged or closed.
- A situation requires user help (for example CI infrastructure issues, repeated flaky failures after retry budget is exhausted, permission problems, or ambiguity that cannot be resolved safely).
- Optional handoff milestone: the PR is currently green + mergeable + review-clean. Treat this as a progress state, not a watcher stop, so late-arriving review comments are still surfaced promptly while the PR remains open.
Do not stop merely because a single snapshot returns idle while checks are still pending.
Inputs
Accept any of the following:
- No PR argument: infer the PR from the current branch (
--pr auto) - PR number
- PR URL
Core Workflow
- When the user asks to "monitor"/"watch"/"babysit" a PR, start with the watcher's continuous mode (
--watch) unless you are intentionally doing a one-shot diagnostic snapshot. - Run the watcher script to snapshot PR/review/CI state (or consume each streamed snapshot from
--watch). - Inspect the
actionslist in the JSON response. - If
diagnose_ci_failureis present, inspect failed run logs and classify the failure. - If the failure is likely caused by the current branch, patch code locally, commit, and push.
- If
process_review_commentis present, inspect surfaced review items and decide whether to address them. - If a review item is actionable and correct, patch code locally, commit, push, and then mark the associated review thread/comment as resolved once the fix is on GitHub.
- If a review item from another author is non-actionable, already addressed, or not valid, post one reply on the comment/thread explaining that decision (for example answering the question or explaining why no change is needed). Prefix the GitHub reply body with
[codex]so it is clear the response is automated. If the watcher later surfaces your own reply, treat that self-authored item as already handled and do not reply again. - If the failure is likely flaky/unrelated and
retry_failed_checksis present, rerun failed jobs with--retry-failed-now. - If both actionable review feedback and
retry_failed_checksare present, prioritize review feedback first; a new commit will retrigger CI, so avoid rerunning flaky checks on the old SHA unless you intentionally defer the review change. - On every loop, look for newly surfaced review feedback before acting on CI failures or mergeability state, then verify mergeability / merge-conflict status (for example via
gh pr view) alongside CI. - After any push or rerun action, immediately return to step 1 and continue polling on the updated SHA/state.
- If you had been using
--watchbefore pausing to patch/commit/push, relaunch--watchyourself in the same turn immediately after the push (do not wait for the user to re-invoke the skill). - Repeat polling until
stop_pr_closedappears or a user-help-required blocker is reached. A green + review-clean + mergeable PR is a progress milestone, not a reason to stop the watcher while the PR is still open. - Maintain terminal/session ownership: while babysitting is active, keep consuming watcher output in the same turn; do not leave a detached
--watchprocess running and then end the turn as if monitoring were complete.
Commands
One-shot snapshot
python3 .agents/skills/babysit-pr/scripts/gh_pr_watch.py --pr auto --onceContinuous watch (JSONL)
python3 .agents/skills/babysit-pr/scripts/gh_pr_watch.py --pr auto --watchTrigger flaky retry cycle (only when watcher indicates)
python3 .agents/skills/babysit-pr/scripts/gh_pr_watch.py --pr auto --retry-failed-nowExplicit PR target
python3 .codex/skills/babysit-pr/scripts/gh_pr_watch.py --pr <number-or-url> --onceCI Failure Classification
Use gh commands to inspect failed runs before deciding to rerun.
gh run view <run-id> --json jobs,name,workflowName,conclusion,status,url,headShagh run view <run-id> --log-failed
Prefer treating failures as branch-related when logs point to changed code (compile/test/lint/typecheck/snapshots/static analysis in touched areas).
Prefer treating failures as flaky/unrelated when logs show transient infra/external issues (timeouts, runner provisioning failures, registry/network outages, GitHub Actions infra errors).
If classification is ambiguous, perform one manual diagnosis attempt before choosing rerun.
Read .codex/skills/babysit-pr/references/heuristics.md for a concise checklist.
Review Comment Handling
The watcher surfaces review items from:
- PR issue comments
- Inline review comments
- Review submissions (COMMENT / APPROVED / CHANGES_REQUESTED)
It intentionally surfaces Codex reviewer bot feedback (for example comments/reviews from chatgpt-codex-connector[bot]) in addition to human reviewer feedback. Most unrelated bot noise should still be ignored.
For safety, the watcher only auto-surfaces trusted human review authors (for example repo OWNER/MEMBER/COLLABORATOR, plus the authenticated operator) and approved review bots such as Codex.
On a fresh watcher state file, existing pending review feedback may be surfaced immediately (not only comments that arrive after monitoring starts). This is intentional so already-open review comments are not missed.
When you agree with a comment and it is actionable:
- Patch code locally.
- Commit with
codex: address PR review feedback (#<n>). - Push to the PR head branch.
- After the push succeeds, mark the associated GitHub review thread/comment as resolved.
- Resume watching on the new SHA immediately (do not stop after reporting the push).
- If monitoring was running in
--watchmode, restart--watchimmediately after the push in the same turn; do not wait for the user to ask again.
If you disagree or the comment is non-actionable/already addressed, reply once directly on the GitHub comment/thread so the reviewer gets an explicit answer, then continue the watcher loop. Prefix any GitHub reply to a code review comment/thread with [codex] so it is clear the response is automated and not from the human user. If the watcher later surfaces your own reply because the authenticated operator is treated as a trusted review author, treat that self-authored item as already handled and do not reply again.
If a code review comment/thread is already marked as resolved in GitHub, treat it as non-actionable and safely ignore it unless new unresolved follow-up feedback appears.
Git Safety Rules
- Work only on the PR head branch.
- Avoid destructive git commands.
- Do not switch branches unless necessary to recover context.
- Before editing, check for unrelated uncommitted changes. If present, stop and ask the user.
- After each successful fix, commit and
git push, then re-run the watcher. - If you interrupted a live
--watchsession to make the fix, restart--watchimmediately after the push in the same turn. - Do not run multiple concurrent
--watchprocesses for the same PR/state file; keep one watcher session active and reuse it until it stops or you intentionally restart it. - A push is not a terminal outcome; continue the monitoring loop unless a strict stop condition is met.
Commit message defaults:
codex: fix CI failure on PR #<n>codex: address PR review feedback (#<n>)
Monitoring Loop Pattern
Use this loop in a live Codex session:
- Run
--once. - Read
actions. - First check whether the PR is now merged or otherwise closed; if so, report that terminal state and stop polling immediately.
- Check CI summary, new review items, and mergeability/conflict status.
- Diagnose CI failures and classify branch-related vs flaky/unrelated.
- For each surfaced review item from another author, either reply once with an explanation if it is non-actionable or patch/commit/push and then resolve it if it is actionable. If a later snapshot surfaces your own reply, treat it as informational and continue without responding again.
- Process actionable review comments before flaky reruns when both are present; if a review fix requires a commit, push it and skip rerunning failed checks on the old SHA.
- Retry failed checks only when
retry_failed_checksis present and you are not about to replace the current SHA with a review/CI fix commit. - If you pushed a commit, resolved a review thread, replied to a review comment, or triggered a rerun, report the action briefly and continue polling (do not stop).
- After a review-fix push, proactively restart continuous monitoring (
--watch) in the same turn unless a strict stop condition has already been reached. - If everything is passing, mergeable, not blocked on required review approval, and there are no unaddressed review items, report that the PR is currently ready to merge but keep the watcher running so new review comments are surfaced quickly while the PR remains open.
- If blocked on a user-help-required issue (infra outage, exhausted flaky retries, unclear reviewer request, permissions), report the blocker and stop.
- Otherwise sleep according to the polling cadence below and repeat.
When the user explicitly asks to monitor/watch/babysit a PR, prefer --watch so polling continues autonomously in one command. Use repeated --once snapshots only for debugging, local testing, or when the user explicitly asks for a one-shot check.
Do not stop to ask the user whether to continue polling; continue autonomously until a strict stop condition is met or the user explicitly interrupts.
Do not hand control back to the user after a review-fix push just because a new SHA was created; restarting the watcher and re-entering the poll loop is part of the same babysitting task.
If a --watch process is still running and no strict stop condition has been reached, the babysitting task is still in progress; keep streaming/consuming watcher output instead of ending the turn.
Polling Cadence
Keep review polling aggressive and continue monitoring even after CI turns green:
- While CI is not green (pending/running/queued or failing): poll every 1 minute.
- After CI turns green: keep polling at the base cadence while the PR remains open so newly posted review comments are surfaced promptly instead of waiting on a long green-state backoff.
- Reset the cadence immediately whenever anything changes (new commit/SHA, check status changes, new review comments, mergeability changes, review decision changes).
- If CI stops being green again (new commit, rerun, or regression): stay on the base polling cadence.
- If any poll shows the PR is merged or otherwise closed: stop polling immediately and report the terminal state.
Stop Conditions (Strict)
Stop only when one of the following is true:
- PR merged or closed (stop as soon as a poll/snapshot confirms this).
- User intervention is required and Codex cannot safely proceed alone.
Keep polling when:
actionscontains onlyidlebut checks are still pending.- CI is still running/queued.
- Review state is quiet but CI is not terminal.
- CI is green but mergeability is unknown/pending.
- CI is green and mergeable, but the PR is still open and you are waiting for possible new review comments or merge-conflict changes.
- The PR is green but blocked on review approval (
REVIEW_REQUIRED/ similar); continue polling at the base cadence and surface any new review comments without asking for confirmation to keep watching.
Output Expectations
Provide concise progress updates while monitoring and a final summary that includes:
- During long unchanged monitoring periods, avoid emitting a full update on every poll; summarize only status changes plus occasional heartbeat updates.
- Treat push confirmations, intermediate CI snapshots, ready-to-merge snapshots, and review-action updates as progress updates only; do not emit the final summary or end the babysitting session unless a strict stop condition is met.
- A user request to "monitor" is not satisfied by a couple of sample polls; remain in the loop until a strict stop condition or an explicit user interruption.
- A review-fix commit + push is not a completion event; immediately resume live monitoring (
--watch) in the same turn and continue reporting progress updates. - When CI first transitions to all green for the current SHA, emit a one-time celebratory progress update (do not repeat it on every green poll). Preferred style:
🚀 CI is all green! 33/33 passed. Still on watch for review approval. - Do not send the final summary while a watcher terminal is still running unless the watcher has emitted/confirmed a strict stop condition; otherwise continue with progress updates.
- Final PR SHA
- CI status summary
- Mergeability / conflict status
- Fixes pushed
- Flaky retry cycles used
- Remaining unresolved failures or review comments
References
- Heuristics and decision tree:
.agents/skills/babysit-pr/references/heuristics.md - GitHub CLI/API details used by the watcher:
.agents/skills/babysit-pr/references/github-api-notes.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

