ccc-babysit-pr · git:20261027.a49bba2 · 2026-10-27 · sha256 29e73f62f479c666
ccc-babysit-pr git:20261027.a49bba2A
Immutable. This exact content never changes and is served at /api/v1/blob/29e73f62f479c666.
---
name: ccc-babysit-pr
description: "Monitor a pull request through review and CI with a read-only watcher, handle bot and reviewer feedback, and report when it is ready. Use when the user asks to monitor, watch, or babysit a PR."
allowed-tools:
- Read
- Bash(gh pr view *)
- Bash(gh pr checks *)
- AskUserQuestion
argument-hint: "<pr-number> [--repo owner/name] [--until ready|green|any-change]"
disable-model-invocation: true
---
# $ccc-babysit-pr — Watch PR to ready
**CC Commander** · $ccc-babysit-pr · a watched PR, verified feedback handling and a ready report backed by local proof.
> Adapted from [t3dotgg/tstack](https://github.com/t3dotgg/tstack) `skills/babysit-pr/SKILL.md` at `92e38e2cf677a84a142e8df296861c588542135c`. MIT, Copyright (c) 2026 Theo Browne; see `LICENSE.txt`. Changes for CC Commander are marked "CCC safety:".
Many repos have AI review bots. They help, even when they are not always right. The user's selected model is preserved. Upstream also supports T3 Code's native watcher; it is not used here. Codex: ask pickers as plain-text questions.
## When to use / when not to
- Use when the user asks to monitor, watch, or babysit a PR.
- Not for filing a PR (`$ccc-file-pr`) or reviewing the diff (`$ccc-review`).
## What happens
1. **Handle what is already there.** Read current checks and comments first: `gh pr view <pr> --json state,mergeStateStatus,reviewDecision,statusCheckRollup`.
2. **Wait with one watcher per PR.** Never write your own watcher, polling loop or `sleep` loop; every watcher on a GitHub account shares one rate limit. The watcher is read-only (`gh` polling, state in `~/.local/state/pr-wait/`):
```bash
python3 "${CLAUDE_PLUGIN_ROOT}/skills/ccc-babysit-pr/scripts/pr-wait" <pr> [--repo owner/name] [--until ready|green|any-change]
```
In Codex the plugin root differs: use the skill directory's `scripts/pr-wait`. In Claude Code run it with the Monitor tool (`timeout_ms: 3600000`) so each line wakes you; otherwise run it as one long Bash command. It ends on its own.
- It prints one line per real event. Exit 0: the `--until` condition is met or the PR merged. Exit 1: it needs you (a required check failed, conflicts, unresolved threads, PR closed, or no CI check gates the PR at all, in which case the local suite and review are the whole gate). Exit 2: bad input.
- `ready` (default): required checks green, Greptile or Macroscope reviewed the head, no unresolved threads. `green`: required checks only (repos without those bots). `any-change`: exit on the first event.
- Start it again after you push, after an exit 1 is handled, and after a resume; it remembers what it already reported. If it says another pid already watches the PR, do not start a second one; kill the old one only if its events do not reach you.
- When an event needs no action, end the turn without a message. Never post or say "still waiting".
3. **GitHub rate limits.** `gh pr create`, `gh pr view` and `gh pr checks` use GraphQL. When GraphQL is used up, REST is a separate limit: `gh api repos/<owner>/<repo>/pulls/<n>` reads a PR and `gh api repos/<owner>/<repo>/commits/<sha>/check-runs` reads checks.
4. **Reviews.** Act only on checks and comments newer than the latest push. Verify every bot finding against the source before changing code. Fix real findings, and separate repository failures from infrastructure flakes. Dismiss false positives with a written reason. If the repo has `.macroscope/check-run-agents/*.md`, read those rules before replying to a Macroscope finding. CodeRabbit is advisory: never wait for it or hold a merge for it. For every comment posted on the user's behalf, Read [ccc-pr-comments](../ccc-pr-comments/SKILL.md) and follow its steps; resolve a thread only after the reply posted. Screenshots and videos help when you can upload them.
5. **Keep the PR small.** Fix real bugs in the intended case. Decline the rest with a written reason and list them as follow-ups: unneeded tests, guards for edge cases that do not matter, extra integration or compatibility, small performance costs. Prefer the fix that deletes or narrows code.
6. **Reproduce failures locally.** CCC safety: CI is a signal to read, never the proof. Reproduce a red check locally, fix it, and never rerun red CI to get green.
7. **Gate before each push.** CCC safety: run the repository's full test suite and lint on the exact head commit; push only when both are green. Never `--no-verify`, never skip hooks. Then one normal `git push` of a new commit, and restart the watcher.
8. **Base branch.** The watcher reports when new base commits touch this PR's files and when the PR becomes BEHIND or DIRTY. CCC safety: upstream rebases; here update with `git fetch origin && git merge --no-edit origin/<base>`, resolve conflicts, rerun the local gate, then a normal push. Never rebase a pushed branch and never rewrite pushed history. Check BEHIND yourself before calling the PR ready. If an overlapping PR makes this one obsolete, stop, report it, and ask before closing the PR.
9. **Stop** when the watcher exits 0. Merge only if the user explicitly asked AND all hold on the exact head sha: full local suite and lint green, required reviews approved by someone other than the author agent, no unresolved threads, branch up to date via merge, GitHub mergeable, branch protection respected (never `--admin`, no auto-merge or merge queue shortcut). Right before merging run `git fetch` and re-check the PR; never merge when BEHIND or DIRTY, or when base commits landed after the last green run touch this PR's files. Otherwise report the PR as ready.
## Decision points
At the stop (AskUserQuestion, 2–3 options):
- 🟢 Report ready: nothing merges
- Merge now: only if the user already asked and the full gate passes
- Keep watching: restart the watcher with another `--until`
## Done when
- The last watcher exit code and the final `gh pr view` state are reported with the head sha.
- Any push was preceded by a green local suite and lint on that head, with the commands named.
## Guardrails
- One watcher per PR; no hand-rolled loops.
- Never rewrite pushed history, rebase a pushed branch, `--no-verify`, or skip hooks or secret scanning.
- Merging, closing a PR and pushing to the default branch need the user's explicit request; a user grant never overrides CLAUDE.md, AGENTS.md or permission settings.
- Never post filler comments.
## See also
- `$ccc-ci` — diagnose failing runs
- `$ccc-review` — review the diff
- `$ccc-qa` — full local test pass
---
> ⚙️ **Fable contract:** plan before build · verifier ≠ worker · prove before alarm · loops need gates · leave durable state — `rules/fable-method.md`
> (On Codex, present these options as a numbered list and ask the user to reply with a number — AskUserQuestion is Claude-only.)