0xmythril/my-agent-skills/babysit-github-pr
Claude Code and agent skill by 0xmythril/my-agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Monitor a GitHub PR in a polling loop, post visible status updates, and auto-fix actionable review or bot comments until the PR is merge-ready, the time budget is exhausted, or progress stalls. Use when the user asks to babysit, monitor, triage, or keep a GitHub pull request merge-ready.
Install
npx vskill@latest install 0xmythril/my-agent-skills/babysit-github-prSKILL.md
The same SKILL.md was published earlier as 0xmythril/my-agent-skills/babysit-github-pr.
Babysit a GitHub PR
Monitor a GitHub PR in a polling loop. Post a visible status update each cycle, and auto-fix actionable review/bot comments until the PR is merge-ready, the time budget is exhausted, or progress stalls.
Defaults are inline below; values parsed from the user's message override them per run.
review_bots defaults to Bugbot, CodeRabbit, Greptile.
GitHub access is via the gh CLI and git in a terminal.
Parse inputs from the user's message
Expected format (defaults in brackets):
pr_url(required) — full GitHub PR URLduration[2h] — total wall-clock time budgetinterval[10m] — poll cadence between cyclesstop_after_unresolved_runs[2] — consecutive cycles ending with unaddressed actionable feedback and no commit pushed before halting (precise definition in step 4)allow_force_push[false]
If pr_url is missing, stop and ask the user for it.
Prerequisites — check before starting
ghCLI authenticated (gh auth status)- PR branch checked out (
gh pr checkout <number>if not) - Working tree clean — if not, stop and tell the user
Each cycle
Run every interval, up to duration.
Cycle guard — before step 1, every cycle: re-check the working tree is clean (git status --porcelain). If it is dirty, halt with a status comment per the Rules — the cycle commit uses path-scoped git add -u / explicit paths (step 3), but a pre-existing dirty tree still points at drift the skill did not intend to ship. (Prerequisites only check this once; the guard enforces it on each iteration.)
1. Fetch state
Identify: mergeability (judge merge-readiness from mergeStateStatus/reviewDecision, not mergeable alone — see the note under step 5), CI status (and failing check names), and new bot findings (from the review_bots list — e.g. Bugbot, CodeRabbit, Greptile) since last cycle — new meaning an ID not yet in seen_review_ids/seen_comment_ids/seen_issue_comment_ids (step 4). Bot/human feedback arrives on three surfaces, all of which count: unresolved inline review threads (the GraphQL query), review summaries (pulls/reviews), and issue-level PR comments (issues/<number>/comments). Don't treat a clean thread list as "no feedback" while an actionable issue-level bot comment is still open. On busy PRs, page through every surface — --paginate on the REST calls and after: cursors past the GraphQL first:100 — so feedback beyond the first page still enters seen_* tracking.
2. Post status update as a new PR comment
Always use the 🤖 [babysit prefix so prior babysit comments can be found.
Post this after step 3's actions complete (or immediately, if there are no actionable items this cycle), so Last action and any review-summary acknowledgments reflect what actually happened. The step numbers are a logical grouping, not a strict clock — within a cycle the order is fetch → act → post status.
3. Act on actionable comments
Classify each unresolved item:
- Actionable: names a file/line and requests a change, identifies a bug, flags failing logic, or is a bot's must-fix severity output
- Non-actionable: nits (
nit:,optional:), questions, praise, human discussion threads, bot summaries/walkthroughs
Record every non-actionable item's ID in the matching seen_* set (step 4) and skip it — note it in the final summary. Otherwise the same skipped bot output looks "new" every cycle.
For actionable items in this cycle:
- Apply all fixes locally.
- Commit as exactly ONE commit per cycle. **Stage only files this cycle actually
touched** — the per-cycle dirty-tree guard proves the working tree was clean at cycle start, but git add -A would still sweep in anything else you happened to create this cycle (frame extractions, scratch scripts, .DS_Store, editor swap files). Use git add -u for edits to tracked files, or list the explicit paths the fixes touched:
```bash git add -u # tracked files modified this cycle git add path/to/new_file.py … # any newly created files the fix required git commit -m "address review feedback (babysit cycle N)
- <fix 1>
- <fix 2>"
```
Never git add -A and never git add . from the repo root — a stray artifact silently entering the review commit is the exact failure the dirty-tree guard is trying to prevent.
- Push. Never use
--forceunlessallow_force_pushis true:
``bash git push origin <headRefName> ``
- Acknowledge every addressed item on all three surfaces with
Addressed in <sha>. <one-line explanation>.— reply in-thread for inline review threads; reply to the comment for issue-level bot comments; note review-summary findings in the status comment. Record each acknowledged ID in the matchingseen_*set (step 4) so the merge-ready check counts it as addressed. - Resolve each inline bot review thread you fully addressed (reply first), using the thread
idfrom step 1:
``bash gh api graphql -f query='mutation($t:ID!){ resolveReviewThread(input:{threadId:$t}){ thread{ isResolved } } }' -F t=<thread_id> ``
Inline bot threads otherwise stay unresolved forever, so this is required to reach merge-ready when the repo enforces conversation resolution. (Issue-level comments and review summaries are not resolvable threads — addressing them means fix + acknowledge + record the ID.) Never resolve threads you did not address, human-discussion threads, or anything ambiguous — reply and leave those for a human.
A failing required check is itself an actionable item — even with no review comment. Diagnose it (gh pr checks <pr_url>, gh run view <run-id> --log-failed), fix the cause, and include the fix in this cycle's single commit + push. If it is not something the skill can fix (needs secrets, infra flake, an external service), treat it as a blocker: note it in the status comment and let the stall/duration budget apply rather than spinning indefinitely.
4. Track between cycles
Keep in memory:
cycle_countstart_timeconsecutive_unresolved_runs— increment when a cycle ends with unaddressed actionable feedback or a failing required check AND no commit pushed; reset to 0 whenever you push a fix. Items left open only because they await human resolution or a still-running check are progress, not a stall, and must not increment this. (This is what stops a red check with no fix path from spinning toduration.)seen_review_ids/seen_comment_ids/seen_issue_comment_ids— IDs already processed for each of the three feedback surfaces (review summaries, inline review comments, issue-level comments). Step 1 computes the new-findings delta against these; add every ID you either addressed or classified non-actionable, so neither is re-evaluated as "new" next cycle.last_checked_at— UTC timestamp of the previous cycle's fetch, used as a fallback "since last cycle" boundary when an item carries no stable ID.
5. Stop conditions
Evaluate in priority order:
| Condition | Action | |
|---|---|---|
| PR merged/closed | Post final summary, exit | |
mergeStateStatus is CLEAN, reviewDecision is not CHANGES_REQUESTED, CI green, and no unaddressed actionable feedback on any of the three surfaces | Post final summary (merge-ready), exit and tell the user the PR is ready for them to merge | |
Blocked only by causes the skill cannot fix — required approvals, a human CHANGES_REQUESTED review, or branch-protection config — and no actionable feedback remains on any surface | Post final summary (needs human), exit | |
consecutive_unresolved_runs >= stop_after_unresolved_runs | Post final summary, exit | |
Elapsed >= duration | Post final summary, exit | |
| Merge conflicts needing human judgment | Post final summary, exit | |
| Otherwise | Sleep interval, continue |
mergeable: MERGEABLE only means there are no merge conflicts — it does not mean the PR is unblocked. Judge true merge-readiness from mergeStateStatus (CLEAN = ready; BLOCKED = required reviews/checks or branch protection unmet; BEHIND = needs update; DIRTY = conflicts) together with reviewDecision. Never post ✅ [babysit final] as merge-ready while mergeStateStatus is anything but CLEAN. If the repo enforces conversation resolution, mergeStateStatus stays BLOCKED until every review thread is resolved — so resolving the bot threads you addressed (step 3.5) is what makes CLEAN reachable. A BLOCKED state with fixable causes — unresolved bot threads (resolve them) or failing CI (fix it) — is not a "needs human" exit; keep looping until those clear or the stall/duration budget applies.
Agent autonomy boundary
- Monitor, fix, and report only.
- Never merge the PR — even if it is fully green and approved. Leave that decision to the user.
- Never push to the target/base branch directly — only to the PR head branch.
Final summary comment
Post with a distinct prefix:
Rules
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-github-pr/SKILL.md
Popularity
- 7-day trend score
- 0
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/0xmythril/my-agent-skills/babysit-github-pr)