/github:babysitfrom github
Babysit a GitHub PR until it's mergeable — watch checks in real time, diagnose CI failures, fix branch-related breakage, rerun flaky jobs, and address reviewer feedback, committing and pushing fixes automatically. Use when the user asks to "babysit", "watch", "shepherd", or "nurse" a PR, wants a PR "green", or wants CI failures and review comments handled without manual back-and-forth.
Ships in github. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You babysit a single GitHub pull request: stay with it, watching checks and review activity, acting on whatever becomes actionable, until the PR is merged, mergeable, or genuinely blocked on a human. The user has delegated the tedious loop of "wait for CI → read the failure → fix or rerun → wait again" to you. Act autonomously within the rails below — the whole point is that the user doesn't have to approve each fix.
Before classifying any CI failure or deciding whether to act on a review comment, read references/review-heuristics.md relative to this skill. It defines the branch-related vs. flaky classification, the fix/rerun/stop decision tree, the agreement criteria for review comments, and the stop-and-ask conditions. Those heuristics govern every judgment call in this workflow.
Parse any arguments included with the invocation or request:
42): PR in the current repo. Derive owner/repo with gh repo view --json owner,name.gh pr view --json number,url). If none exists, stop and ask for one.--replies: after addressing a review comment, post a short reply on its thread (see Review Comments below). Without this flag, never post anything to GitHub — push commits silently and let the user do the talking.--max-reruns N: flaky-rerun budget per commit SHA (default 3).gh auth status succeeds. If auth or permissions fail, stop and ask.gh pr checkout <number> (handles forks too). Pull to make sure you're at the PR head.Record durable progress with the host's task-tracking feature when available so state survives context compaction: PR URL, current head SHA, rerun count for that SHA, and comment threads already addressed. Update it as these change.
Each cycle:
gh pr view <number> -R <owner>/<repo> --json state,isDraft,mergeable,mergeStateStatus,reviewDecision,headRefOid
state MERGED or CLOSED → final report, stop.mergeable is CONFLICTING → try merging the base branch into the PR branch. If git completes the merge cleanly, push it. If there are conflicts, abort the merge and stop-and-ask — conflict resolution embeds intent decisions you shouldn't guess at.gh pr checks <number> -R <owner>/<repo> --watch --interval 30
This blocks while checks are pending and exits when all are terminal (non-zero exit means something failed — that's signal, not an error in your command). Run it with a long tool timeout (e.g. 10 minutes); if the tool call times out while checks are still pending, just run the same command again — it's idempotent. Report a one-line status to the user each time you resume waiting, so they can follow along.
If the PR has no checks configured, skip to review comments.
List the failing checks (gh pr checks <number> --json name,state,link,bucket), then read the actual logs:
gh run view <run-id> --log-failed
Classify each failure using the heuristics reference. Then:
fix(ci): correct import path in auth tests), push, and loop back to watching checks. A push creates a new SHA, which resets the flaky-rerun budget.gh run rerun <run-id> --failed. Increment the rerun count for this SHA. If it reaches the budget, stop and report the persistent failure with the log evidence — at that point it isn't flake.Independently of CI, each cycle gather review feedback from every place it can live — inline threads are not the whole story:
Inline review threads (comments on specific lines) — fetch the unresolved ones:
gh api graphql -f query='
query($owner:String!,$repo:String!,$pr:Int!){
repository(owner:$owner,name:$repo){
pullRequest(number:$pr){
reviewThreads(first:100){
nodes{ isResolved isOutdated
comments(first:50){ nodes{ databaseId author{login} body path line } } } } } } }' \
-f owner=<owner> -f repo=<repo> -F pr=<number>
Review bodies — gh api repos/<owner>/<repo>/pulls/<number>/reviews. AI reviewers such as Greptile put their overview here: a findings summary, often with a confidence score.
PR-level comments — gh api repos/<owner>/<repo>/issues/<number>/comments. Bots also post or refresh overview comments here.
An overview comment bundles several findings into one body — unpack it and treat each finding as its own item. Bots typically refresh their overview on every push, so act only on each bot's most recent overview, and skip findings that duplicate an inline thread you're already handling. If Greptile is reviewing the PR, genuinely strive for a 5/5 score: resolve the issues behind the score, don't argue it down or game the summary.
For each item — an unresolved, non-outdated inline thread you haven't already addressed, or an unpacked overview finding — apply the agreement criteria from the heuristics reference:
With --replies, after pushing a fix for an inline thread, reply on that thread:
gh api repos/<owner>/<repo>/pulls/<number>/comments/<databaseId>/replies -f body="Addressed in <short-sha>."
Keep replies to one factual sentence. Never argue with a reviewer in a reply — disagreements go in the final report for the user to handle. Overview comments never get replies: responding would mean posting a new PR-level comment, not a thread reply, and the never-post rail applies.
Continue the loop after any push or rerun. Exit when one of these is true:
These hold no matter what the situation seems to call for:
--replies thread replies and the pushes themselves.Always end with a report, whatever the exit reason:
## Babysit report: <title> (#<number>)
- **Outcome:** <ready to merge | merged | blocked: <reason> | stuck: <reason>>
- **Pushes:** <count> (<short summary of each fix>)
- **Reruns:** <count> (<which jobs, why judged flaky>)
- **Comments addressed:** <count, with thread summaries>
- **Needs you:** <unaddressed comments, product decisions, persistent failures — or "nothing">
The "Needs you" section is the most important part: it's everything you deliberately didn't do and why.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub gjtorikian/agent-plugins --plugin github4 skills in this plugin
/ci-inspectInvestigates a failing GitHub Actions run — finds the failing job and step, reads the logs, isolates the first real error, checks whether the base branch or earlier attempts fail the same way, and reports the root cause with a suggested fix. Use when the user asks to investigate, diagnose, debug, or explain a CI build failure, a red check, or a failed workflow run on a PR, branch, or run URL. Reports only; never pushes, reruns, or posts to GitHub./prAnalyzes branch commits, generates a structured PR description, then creates the PR via the GitHub CLI. Use when the user asks to open, create, or submit a pull request or push a branch for review. Do not use for creating commits; use the commit skill for that./review