active/babysit-pr/SKILL.md
Watch a pull request and CI until green or needing fixes.
npx skillsauth add kevinslin/skills 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.
Use this skill when the user asks to babysit, watch, or keep an eye on a pull request until review comments and CI are settled.
gh pr view when possible; otherwise ask for the PR.gh is available and authenticated for the PR repo.babysit-pr: owner/repo#123.If the runtime has no first-class thread automation API, emulate the loop in the current agent thread with timed sleeps and state that no persistent automation API was available.
Poll every 2 minutes until the heartbeat pass condition, explicit quiet-green pass condition, or a terminal stop condition is reached.
At each poll:
gh pr view <pr> --json comments,reviews,reviewDecision,mergeStateStatus,mergeable,baseRefName,headRefName,headRefOid.pullRequest.reviewThreads, including unresolved, non-outdated threads and requested changes.mergeStateStatus of DIRTY or mergeable of CONFLICTING as a PR branch conflict.gh pr checks <pr> or gh pr view <pr> --json statusCheckRollup.headRefOid, group runs by stable check identity: prefer workflowName + name when both exist, otherwise use the provider check name plus provider/source as the identity.startedAt/completedAt/provider timestamp. Older failed, errored, cancelled, neutral, or pending runs for the same check identity are superseded once a newer run exists for the same PR head.trigger:check-ci from ../dev.shortcuts/SKILL.md when checks need deeper Buildkite/provider classification.gh run view <run-id> --job <job-id> --log or the provider CI equivalent when available. If gh cannot write to its default cache location, set XDG_CACHE_HOME to a writable temp directory for the log fetch. Treat rollup status names as pointers, not evidence.When any conflict issue is found:
mergeStateStatus, mergeable, and any GitHub merge-conflict URL.trigger:fix-pr-conflict from ../dev.shortcuts/SKILL.md with the PR and conflict evidence.When any GitHub or build issue is found:
trigger:fix-pr from ../dev.shortcuts/SKILL.md with the PR and evidence. Do not hand-roll PR comment cleanup inside this skill; trigger:fix-pr owns addressing feedback, committing/pushing when needed, resolving addressed review threads, and checking CI.pullRequest.reviewThreads through GraphQL and verify that every addressed thread has isResolved: true. If any actionable or addressed-but-unresolved thread remains, treat that as a GitHub issue and invoke trigger:fix-pr again with the remaining thread ids/URLs as evidence.Do not mark the babysit loop complete immediately after a fix unless the fresh post-fix poll already satisfies the heartbeat CI-green stop condition. A quiet-green window is required only when the user explicitly asked to keep watching after green.
For heartbeat automations, complete and delete the heartbeat as soon as all of these are true:
Do not keep a heartbeat automation alive only for a quiet-green window, codeowner/compliance approval gates, skipped bot-approval triggers, or a blocked merge state that is explained solely by approvals. Delete the heartbeat, notify/report the green CI result, and mention any remaining non-actionable approval gate separately.
If the user explicitly asks to keep watching after green, use a quiet-green pass condition instead: the PR must stay in the CI-green/no-new-actionable-issues state for at least 10 continuous minutes, checked at the 2-minute cadence. Reset that timer whenever a new commit appears, CI stops being green, or new actionable GitHub activity appears.
When the heartbeat CI-green pass condition or explicit quiet-green pass condition is met:
../gen-notifier/SKILL.md to send exactly one completion notification.If the loop hits an unrecoverable error, delete or cancel the automation when possible, notify with an error status through ../gen-notifier/SKILL.md, and report the blocker.
development
Create, rename, audit, or close a tracked Codex task whose turns and status are persisted in the local thread ledger. Only use when directly invoked.
testing
Manage Git preflight, branch and worktree creation, and completed-work cleanup. Use when explicitly invoked.
databases
Automatically use for durable knowledge, configured project-context lookup, and schema-backed artifact layouts.
content-media
Create, update, or optimize skills and SKILL.md content.