Babysitting PRs
Drive a branch or GitHub pull request to the end state the user requested: published, updated, merge-ready, or merged.
Authorization And Scope
- Inspecting local or PR state is read-only. A request to publish, update, address feedback, prepare, land, or merge authorizes the corresponding branch and PR writes; preserve unrelated work and avoid rewriting remote history unless explicitly authorized.
- Merge only when the user explicitly asks to merge, land, ship, queue, or get the PR merged. “Prepare to land,” “babysit,” “make mergeable,” and “ready for review” mean merge-ready only. Ambiguous follow-ups such as “looks good” do not grant new merge permission.
- Do not introduce GitHub Codex review. Continue it only when the PR already has Codex review activity or the user explicitly asks for it.
Companion Skills
- Use
writing-pr-descriptions before creating a PR and after material changes to an existing PR.
- Use
auto-review when the user asks for it or the diff is materially risky: behavior, public contracts, data, security, concurrency, migrations, or cross-cutting structure. For small docs, metadata, configuration, or mechanical changes, use focused inspection and risk-matched validation instead of a mandatory full review loop.
- Use
handling-codex-reviews only for an already-active or explicitly requested Codex loop.
Workflow
Use a bounded loop, normally no more than three fix cycles. Batch related fixes before pushing.
Resolve the target and requested end state
- Read repository instructions,
git status, branch, remotes, and existing PR metadata.
- Identify the base and current head SHA. Preserve unrelated dirty files.
- If no PR exists and publication is in scope, use the repository’s branch convention, commit only intended changes, and push the branch. Do not create a PR when the user asked only for local work.
Review and publish when needed
- Apply the risk rule above rather than running
auto-review by rote.
- Use
writing-pr-descriptions against the final base-to-head diff and applicable template, then create or update a non-draft PR unless the user requested a draft.
- Re-fetch the PR number, URL, head SHA, and merge state after publishing.
Read current PR state
- Run
scripts/pr_babysit.sh status --pr <pr> --repo <owner/repo>.
- Treat unresolved review threads as the source of truth for inline feedback. Include submitted top-level reviews, but ignore withdrawn, pending, already acknowledged, or stale feedback that no longer applies to the current diff.
Clear branch and review blockers
- Rebase or merge the base according to repository convention and resolve conflicts with the smallest correct change.
- Classify feedback as actionable, already addressed, inaccurate, or requiring user judgement. Fix grounded items in one batch and run focused validation.
- Commit and push before replying. Reply inline with
Fixed in <sha>: <what changed>; for top-level reviews include the review ID so later runs can correlate it.
- Add reactions only when they accurately acknowledge the feedback. Resolve a thread only after the pushed fix and reply are visible, then re-query unresolved threads.
- Do not amend a commit after publishing replies that cite its SHA. Re-request only reviewers already participating, using their established mechanism; do not substitute or introduce a different bot.
Handle Codex only when present
- If status reports existing Codex activity, pending review, actionable Codex feedback, or active
eyes, use handling-codex-reviews.
- If Codex is unavailable, continue with non-Codex blockers. Do not post another trigger or block on approval unless completing Codex review was explicitly requested.
Clear CI blockers
- Run
scripts/pr_babysit.sh checks --pr <pr> --repo <owner/repo> and inspect failures through GitHub first.
- Use Buildkite-specific tools only when the PR has Buildkite checks and linked GitHub output is insufficient. Missing Buildkite access blocks only that diagnosis.
- Fix branch-caused failures and retry one evidenced flaky or external failure once. Stop after two serious attempts at the same branch-caused failure.
Refresh metadata and finish
- If code, behavior, scope, or evidence changed materially, run
writing-pr-descriptions against the final head.
- Before merge or handoff, re-fetch head SHA, reviews, unresolved threads, checks, and merge state. Never merge a head different from the reviewed green head.
- Use the repository’s merge queue, auto-merge, or normal merge method. Delete the branch only when requested or established repository configuration does so.
Helper Commands
scripts/pr_babysit.sh status --pr 32 --repo owner/repo
scripts/pr_babysit.sh resolve --pr 32 --repo owner/repo --comment-ids 12345,67890
scripts/pr_babysit.sh checks --pr 32 --repo owner/repo
The status result includes merge_blockers, ready_to_merge, unresolved review threads, check state, and Codex state. It is a fast summary, not a substitute for judgement.
Stop And Report
Stop for missing authorization, contradictory feedback, required human or product judgement, unavailable essential credentials, branch protection, or a repeated blocker that evidence-based fixes did not clear.
Report the achieved state, PR URL, and exact blocker when unfinished. Mention commits or validation only when they materially help the handoff.
1---2name: babysitting-prs3description: Opens, updates, and carries GitHub pull requests through review feedback, rebases, CI or Buildkite failures, existing Codex review, and optional merge. Use when asked to publish a branch, address PR feedback, babysit or prepare a PR, make it mergeable, land it, or merge it.4---56# Babysitting PRs78Drive a branch or GitHub pull request to the end state the user requested: published, updated, merge-ready, or merged.910## Authorization And Scope1112- Inspecting local or PR state is read-only. A request to publish, update, address feedback, prepare, land, or merge authorizes the corresponding branch and PR writes; preserve unrelated work and avoid rewriting remote history unless explicitly authorized.13- Merge only when the user explicitly asks to merge, land, ship, queue, or get the PR merged. “Prepare to land,” “babysit,” “make mergeable,” and “ready for review” mean merge-ready only. Ambiguous follow-ups such as “looks good” do not grant new merge permission.14- Do not introduce GitHub Codex review. Continue it only when the PR already has Codex review activity or the user explicitly asks for it.1516## Companion Skills1718- Use `writing-pr-descriptions` before creating a PR and after material changes to an existing PR.19- Use `auto-review` when the user asks for it or the diff is materially risky: behavior, public contracts, data, security, concurrency, migrations, or cross-cutting structure. For small docs, metadata, configuration, or mechanical changes, use focused inspection and risk-matched validation instead of a mandatory full review loop.20- Use `handling-codex-reviews` only for an already-active or explicitly requested Codex loop.2122## Workflow2324Use a bounded loop, normally no more than three fix cycles. Batch related fixes before pushing.25261. **Resolve the target and requested end state**27 - Read repository instructions, `git status`, branch, remotes, and existing PR metadata.28 - Identify the base and current head SHA. Preserve unrelated dirty files.29 - If no PR exists and publication is in scope, use the repository’s branch convention, commit only intended changes, and push the branch. Do not create a PR when the user asked only for local work.30312. **Review and publish when needed**32 - Apply the risk rule above rather than running `auto-review` by rote.33 - Use `writing-pr-descriptions` against the final base-to-head diff and applicable template, then create or update a non-draft PR unless the user requested a draft.34 - Re-fetch the PR number, URL, head SHA, and merge state after publishing.35363. **Read current PR state**37 - Run `scripts/pr_babysit.sh status --pr <pr> --repo <owner/repo>`.38 - Treat unresolved review threads as the source of truth for inline feedback. Include submitted top-level reviews, but ignore withdrawn, pending, already acknowledged, or stale feedback that no longer applies to the current diff.39404. **Clear branch and review blockers**41 - Rebase or merge the base according to repository convention and resolve conflicts with the smallest correct change.42 - Classify feedback as actionable, already addressed, inaccurate, or requiring user judgement. Fix grounded items in one batch and run focused validation.43 - Commit and push before replying. Reply inline with `Fixed in <sha>: <what changed>`; for top-level reviews include the review ID so later runs can correlate it.44 - Add reactions only when they accurately acknowledge the feedback. Resolve a thread only after the pushed fix and reply are visible, then re-query unresolved threads.45 - Do not amend a commit after publishing replies that cite its SHA. Re-request only reviewers already participating, using their established mechanism; do not substitute or introduce a different bot.46475. **Handle Codex only when present**48 - If status reports existing Codex activity, pending review, actionable Codex feedback, or active `eyes`, use `handling-codex-reviews`.49 - If Codex is unavailable, continue with non-Codex blockers. Do not post another trigger or block on approval unless completing Codex review was explicitly requested.50516. **Clear CI blockers**52 - Run `scripts/pr_babysit.sh checks --pr <pr> --repo <owner/repo>` and inspect failures through GitHub first.53 - Use Buildkite-specific tools only when the PR has Buildkite checks and linked GitHub output is insufficient. Missing Buildkite access blocks only that diagnosis.54 - Fix branch-caused failures and retry one evidenced flaky or external failure once. Stop after two serious attempts at the same branch-caused failure.55567. **Refresh metadata and finish**57 - If code, behavior, scope, or evidence changed materially, run `writing-pr-descriptions` against the final head.58 - Before merge or handoff, re-fetch head SHA, reviews, unresolved threads, checks, and merge state. Never merge a head different from the reviewed green head.59 - Use the repository’s merge queue, auto-merge, or normal merge method. Delete the branch only when requested or established repository configuration does so.6061## Helper Commands6263```bash64scripts/pr_babysit.sh status --pr 32 --repo owner/repo65scripts/pr_babysit.sh resolve --pr 32 --repo owner/repo --comment-ids 12345,6789066scripts/pr_babysit.sh checks --pr 32 --repo owner/repo67```6869The status result includes `merge_blockers`, `ready_to_merge`, unresolved review threads, check state, and Codex state. It is a fast summary, not a substitute for judgement.7071## Stop And Report7273Stop for missing authorization, contradictory feedback, required human or product judgement, unavailable essential credentials, branch protection, or a repeated blocker that evidence-based fixes did not clear.7475Report the achieved state, PR URL, and exact blocker when unfinished. Mention commits or validation only when they materially help the handoff.