babysit-pr ยท diff
git:20260823.7a165ca to git:20260918.fd2cc5e
81 added, 14 removed. Audit A to A.
What this update changes in the checks
No check changed: every fixed check gives the same answer before and after this update.
A tripped check is a label, not a verdict: read the matched text and the lines below. This week's updates that newly trip a check.
---
name: babysit-pr
- description: Monitor a pull request through review and CI. Use when the user asks to monitor, watch, or babysit a PR.
- metadata:
- harness: [claude, codex, opencode]
- platform: [darwin]
- scope: fleet
+ description: Monitor a pull request through review bots and CI until green. Use when the user asks to monitor, watch, or babysit a PR.
---
# Babysit PR
- All the repos we work in have various AI review bots. They're helpful, even if they are not always right.
+ Watch a PR until review bots and required checks are green on the latest commit.
+ Fix what is real, dismiss what is not, stay quiet otherwise.
- If your harness offers tools to monitor a PR, use them so you can respond when comments arrive. Otherwise, poll the PR for new comments and checks.
+ Repos we work in run AI review bots. Helpful, not always right. Treat every
+ finding as advisory.
- Only act on checks and comments newer than the latest push. Verify every bot finding against the source before changing code. Fix real findings and CI failures, distinguish repository failures from infrastructure flakes, and reply with a written reason when dismissing false positives.
+ ## Resolve the PR
- Keep an eye on changes to `main` and rebase when needed. If an overlapping PR makes this one obsolete, stop monitoring, report it to the user, and ask before closing the PR unless closure was explicitly authorized.
+ ```bash
+ gh pr view --json number,url,headRefName,baseRefName,headRefOid,isDraft,mergeable
+ ```
- If a review bot leaves feedback you believe is not worth addressing, reply and resolve the comment. Format comments left on Oskar's behalf as:
+ No argument means the PR for the current branch. Accept a number or URL
+ otherwise. Record `headRefOid` - only checks and comments newer than that push
+ matter.
+ ## Monitor
+
+ - Claude Code: use the `Monitor` tool on `gh pr checks --watch` and on the
+ comment fetch below. For long waits use `/loop` with self pacing instead of
+ tight polling.
+ - OpenCode and other harnesses: poll every 2-5 min with the commands below. Back
+ off when nothing changes.
+
+ ```bash
+ gh pr checks --json name,state,bucket,link
+ gh api repos/{owner}/{repo}/pulls/<n>/comments --jq '.[] | select(.created_at > "<push-iso>") | {id,user:.user.login,path,line,body}'
+ gh api repos/{owner}/{repo}/pulls/<n>/reviews --jq '.[] | select(.submitted_at > "<push-iso>") | {id,user:.user.login,state,body}'
+ gh api repos/{owner}/{repo}/issues/<n>/comments --jq '.[] | select(.created_at > "<push-iso>") | {id,user:.user.login,body}'
+ ```
+
+ ## Handle findings
+
+ 1. Read the source the bot points at before touching anything. Verify the claim,
+ use `code-review` skill for anything non-trivial.
+ 2. Real finding or real CI failure: fix with the smallest correct change. Commit
+ via `conventional-commit` skill. Push.
+ 3. Infra flake (runner lost, network, timeout unrelated to diff): rerun with
+ `gh run rerun <id> --failed`. Do not touch code.
+ 4. False positive or not worth it: reply with the reason, then resolve the
+ thread.
+
+ Reply to a review comment:
+
+ ```bash
+ gh api repos/{owner}/{repo}/pulls/<n>/comments/<comment-id>/replies -f body="$(cat reply.md)"
+ ```
+
+ Resolve the thread (thread id from `reviewThreads` in GraphQL):
+
+ ```bash
+ gh api graphql -f query='mutation($id:ID!){resolveReviewThread(input:{threadId:$id}){thread{isResolved}}}' -F id=<thread-id>
+ ```
+
+ Format every comment left on Oskar's behalf as:
+
```md
- *[MODEL-SLUG] responding on behalf of Oskar*
+ _[MODEL-SLUG] responding on behalf of Oskar_
[actual reply]
```
- (Keep the attribution as a single italic line. Do not underline it with `---`/`===` - in Markdown that turns the line into a large heading.)
+ Single italic line for attribution. Never underline it with `---` or `===` -
+ Markdown turns that into a heading. Replies concise, plain hyphens only, no em
+ or en dashes.
- Do not let the feedback expand the PR beyond the user's original goal. Address real shortcomings, but avoid scope creep.
+ ## Keep it mergeable
- If nothing has changed, stay quiet rather than posting filler comments. Stop when the review bots and required checks are green on the latest commit. Merge only when the user explicitly requested it; otherwise report that the PR is ready.
+ ```bash
+ GIT_EDITOR=true git fetch origin
+ GIT_EDITOR=true git rebase origin/<base>
+ git push --force-with-lease
+ ```
+
+ Rebase when `mergeable` flips to `CONFLICTING` or base moved under a file this
+ PR touches. After a push, reset the watermark to the new `headRefOid`.
+
+ If an overlapping PR on `main` makes this one obsolete: stop, report to the
+ user, ask before closing unless closure was explicitly authorized.
+
+ ## Scope
+
+ Fix real shortcomings inside the PR's original goal. Refuse bot-driven scope
+ creep: broad refactors, style rewrites, speculative edge cases, unrelated files.
+ Say so in the reply.
+
+ ## Stop
+
+ - Bots and required checks green on latest commit: report ready, stop.
+ - Merge only if the user explicitly asked. Otherwise never merge.
+ - Nothing changed since last check: stay silent. No filler comments, no status
+ spam.