jellydn/my-ai-tools/babysit-pr
Claude Code and agent skill by jellydn/my-ai-tools
- community
Checking that the SKILL.md file is still in the repository.
Use when monitoring an open GitHub PR for CI failures, review feedback, mergeability, and safe retries or fixes.
Install
npx vskill@latest install jellydn/my-ai-tools/babysit-prSKILL.md
PR Babysitter
Objective
Babysit a PR persistently until one of these terminal outcomes occurs:
- The PR is merged or closed.
- A situation requires user help (for example CI infrastructure issues, repeated flaky failures after retry budget is exhausted, permission problems, or ambiguity that cannot be resolved safely).
- Optional handoff milestone: the PR is currently green + mergeable + review-clean. Treat this as a progress state, not a watcher stop, so late-arriving review comments are still surfaced promptly while the PR remains open.
Do not stop merely because a single snapshot returns idle while checks are still pending.
Inputs
Accept any of the following:
- No PR argument: infer the PR from the current branch (
--pr auto) - PR number
- PR URL
Core Workflow
- When the user asks to "monitor"/"watch"/"babysit" a PR, start with the watcher's continuous mode (
--watch) unless you are intentionally doing a one-shot diagnostic snapshot. - Run the watcher script to snapshot PR/review/CI state (or consume each streamed snapshot from
--watch). - Inspect the
actionslist in the JSON response. - If
diagnose_ci_failureis present, inspect failed run logs and classify the failure. - If the failure is likely caused by the current branch, patch code locally, commit, and push. Do not patch random flaky tests, CI infrastructure, dependency outages, runner issues, or other failures that are unrelated to the branch.
- If
process_review_commentis present, inspect surfaced published review items and decide whether to address them. - If a review item is actionable and correct, patch code locally, commit, push, and then resolve the associated review thread only when allowed by the GitHub state mutation policy below.
- Do not post replies to human-authored review comments/threads unless the user explicitly confirms the exact response. If a human review item is non-actionable, already addressed, or not valid, surface the item and recommended response to the user instead of replying on GitHub.
- If the failure is likely flaky/unrelated and
retry_failed_checksis present, rerun failed jobs with--retry-failed-now. - If both actionable review feedback and
retry_failed_checksare present, prioritize review feedback first; a new commit will retrigger CI, so avoid rerunning flaky checks on the old SHA unless you intentionally defer the review change. - On every loop, look for newly surfaced review feedback before acting on CI failures or mergeability state, then verify mergeability / merge-conflict status (for example via
gh pr view) alongside CI. - After any push or rerun action, immediately return to step 1 and continue polling on the updated SHA/state.
- If you had been using
--watchbefore pausing to patch/commit/push, relaunch--watchyourself in the same turn immediately after the push (do not wait for the user to re-invoke the skill). - Repeat polling until
stop_pr_closedappears or a user-help-required blocker is reached. A green + review-clean + mergeable PR is a progress milestone, not a reason to stop the watcher while the PR is still open. - Maintain terminal/session ownership: while babysitting is active, keep consuming watcher output in the same turn; do not leave a detached
--watchprocess running and then end the turn as if monitoring were complete.
Commands
One-shot snapshot
Continuous watch (JSONL)
Trigger flaky retry cycle (only when watcher indicates)
Explicit PR target
CI Failure Classification
Use gh commands to inspect failed runs before deciding to rerun.
gh run view <run-id> --json jobs,name,workflowName,conclusion,status,url,headShagh api repos/<owner>/<repo>/actions/runs/<run-id>/jobs -X GET -f per_page=100gh api repos/<owner>/<repo>/actions/jobs/<job-id>/logs > /tmp/my-ai-tools-gh-job-<job-id>-logs.zipgh run view <run-id> --log-failedas a fallback after the overall workflow run is complete
gh run view --log-failed is workflow-run scoped and may not expose failed-job logs until the overall run finishes. For faster diagnosis, poll the run's jobs first and, as soon as a specific job has failed, fetch that job's logs directly from the Actions job logs endpoint. The watcher includes a failed_jobs list with each failed job's job_id and logs_endpoint when GitHub exposes one.
Prefer treating failures as branch-related when failed-job logs point to changed code (compile/test/lint/typecheck/snapshots/static analysis in touched areas).
Prefer treating failures as flaky/unrelated when logs show transient infra/external issues (timeouts, runner provisioning failures, registry/network outages, GitHub Actions infra errors).
Do not attempt to fix flaky/unrelated failures by changing tests, build scripts, CI configuration, dependency pins, or infrastructure-adjacent code unless the logs clearly connect the failure to the PR branch. For flaky/unrelated failures, rerun only when the watcher recommends retry_failed_checks; otherwise wait or stop for user help.
If classification is ambiguous, perform one manual diagnosis attempt before choosing rerun.
Read skills/babysit-pr/references/heuristics.md for a concise checklist.
Review Comment Handling
The watcher surfaces review items from:
- PR issue comments
- Inline review comments
- Review submissions (COMMENT / APPROVED / CHANGES_REQUESTED)
Only act on published feedback. Ignore review submissions in GitHub's PENDING state and inline comments attached to those pending reviews. Do not mark pending review feedback as seen; it should be eligible to surface after the reviewer submits the review.
It intentionally surfaces Codex reviewer bot feedback (for example comments/reviews from chatgpt-codex-connector[bot]) in addition to human reviewer feedback. Most unrelated bot noise should still be ignored. For safety, the watcher only auto-surfaces trusted human review authors (for example repo OWNER/MEMBER/COLLABORATOR, plus the authenticated operator) and approved review bots such as Codex. On a fresh watcher state file, existing unaddressed published review feedback may be surfaced immediately (not only comments that arrive after monitoring starts). This is intentional so already-open review comments are not missed.
When you agree with a comment and it is actionable:
- Patch code locally.
- Commit with
codex: address PR review feedback (#<n>). - Push to the PR head branch.
- After the push succeeds, resolve the associated GitHub review thread only when allowed by the GitHub state mutation policy below.
- Resume watching on the new SHA immediately (do not stop after reporting the push).
- If monitoring was running in
--watchmode, restart--watchimmediately after the push in the same turn; do not wait for the user to ask again.
Do not post replies to human-authored GitHub review comments/threads automatically. If you disagree with a human comment, believe it is non-actionable/already addressed, or need to answer a question, report the item to the user with a suggested response and wait for explicit confirmation before posting anything on GitHub. If the user approves a response, prefix it with [codex] so it is clear the response is automated and not from the human user. If the watcher later surfaces your own approved reply because the authenticated operator is treated as a trusted review author, treat that self-authored item as already handled and do not reply again. If a code review comment/thread is already marked as resolved in GitHub, treat it as non-actionable and safely ignore it unless new unresolved follow-up feedback appears.
GitHub State Mutation Policy
You can read any PR state you need for monitoring. Writes must comply with this policy.
You can push PRs to update the code under review or to force CI re-runs as described above.
You can resolve review comment threads from the human who requested babysitting or from the Codex review bot. When resolving, leave a comment prefixed with [from Codex]: and explain what changes you made and which commit includes them. Don't touch review threads if other humans other than the user who requested babysitting have participated.
Before making any changes, fetch the PR state yourself instead of relying on the PR watcher script's output.
Unless explicitly asked, do not:
- comment on other humans' review threads, communicate with the user in chat instead
- resolve review threads from humans other than the user
- interact with humans other than the user
- mark PRs as drafts or ready for review
- close or reopen PRs
In general, never act on GitHub in ways that would make it hard to tell whether you or the user did something visible to other humans. When in doubt, ask the user for clarification in chat.
Git Safety Rules
- Work only on the PR head branch.
- Avoid destructive git commands.
- Do not switch branches unless necessary to recover context.
- Before editing, check for unrelated uncommitted changes. If present, stop and ask the user.
- After each successful fix, commit and
git push, then re-run the watcher. - If you interrupted a live
--watchsession to make the fix, restart--watchimmediately after the push in the same turn. - Do not run multiple concurrent
--watchprocesses for the same PR/state file; keep one watcher session active and reuse it until it stops or you intentionally restart it. - A push is not a terminal outcome; continue the monitoring loop unless a strict stop condition is met.
Commit message defaults:
codex: fix CI failure on PR #<n>codex: address PR review feedback (#<n>)
Monitoring Loop Pattern
Use this loop in a live Codex session:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/babysit-pr/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jellydn/my-ai-tools/babysit-pr)