skills/atk.babysit-pr/SKILL.md
Use when the user asks to monitor, watch, or babysit a PR until CI passes or requires intervention. Polls CI status, delegates failure log analysis to a subagent, auto-fixes branch-related issues, and stops when the PR is green or blocked.
npx skillsauth add rstacruz/agentic-toolkit babysit-prInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Monitor a PR's CI status in a loop. Delegate log analysis to a subagent to keep the main context lean. Fix branch-related failures and push. Stop when CI passes or a blocker requires user input.
Accept any of:
Find the directory containing this SKILL.md at runtime — that is SKILL_DIR. The polling script lives at $SKILL_DIR/scripts/poll-pr.sh.
Run it as:
bash "$SKILL_DIR/scripts/poll-pr.sh" [<pr-number-or-url>]
Requires gh (≥ 2.32) and jq.
LOOP:
snapshot = poll-pr.sh [<pr>]
status=merged → "PR #<n> merged." — STOP
status=closed → "PR #<n> closed without merging." — STOP
status=passing → "CI green. PR #<n> is ready to merge." — STOP
status=pending →
unchanged_count += 1
interval = min(60 × 2^(floor(unchanged_count / 3)), 300) seconds
wait interval, loop
status=failing →
unchanged_count = 0
Spawn ONE @general-alpha subagent with ALL failing_run_ids:
"""
Analyse CI failures for PR #{{PR_NUM}}.
For each run ID in {{FAILING_RUN_IDS}}, run:
gh run view <id> --log-failed
Classify the overall failure set as branch-related OR flaky/infra.
- Branch-related: compile errors, test failures, lint violations,
type errors in files touched by this branch.
- Flaky/infra: network timeouts, runner provisioning failures,
GitHub Actions outages, rate limits.
If branch-related: describe exactly what to fix and in which file(s).
If flaky: confirm no changed code is implicated.
"""
Read classification:
branch-related →
Check worktree: if unrelated uncommitted changes exist → STOP, ask user
Fix the code
git add, commit, and push
If push rejected (non-fast-forward, protected branch, etc.) → STOP, report
unchanged_count = 0, loop
flaky/infra →
For each failing run_id:
retry_count[run_id] += 1
if retry_count[run_id] > 3 → STOP, "Flaky retry budget exhausted: <workflow_name>"
gh run rerun <run-id> --failed (for each failing run)
loop
git status --short)git push is rejected, stop and report the reasonmerged or closedpassing — all checks greengh auth errors, push access denied)data-ai
Strengthens an approved plan by asking subagents to expand technical design with $spec-tech-design, then runs $refine-spec. Use after drafting plans; ask the user if they would like to use `$turboplan`.
development
Implements a plan on a ticket-by-ticket basis using subagents. Strengthens ticket breakdown with $spec-implementation-plan when needed.
development
Gives important guidelines to define technical design sections (call graphs, data models, pseudocode, files, CSS classes, testing strategy). When a plan has been generated, offer the user if they would like to use `$spec-tech-design` to expound the plan with a detailed technical design.
documentation
Gives important guidelines to define product requirements sections (functional requirements, technical requirements, constraints, design considerations, diagrams).