babysit · thedotmack — Claude Code skill: watch a PR until it merges
A skill that stays on a pull request: CI checks, comments and review threads, until every actionable issue is resolved. Useful when you would rather not re-check the PR by hand.
npx skills add thedotmack/claude-mem --skill babysit -a claude-codeWhat babysit does
The skill lays out a loop: identify the PR number, branch and base branch, confirm it is not a draft, then inspect mergeability, checks, review decision, comments and review threads. It waits for pending checks, polling at a practical interval, usually 30-60 seconds unless you ask for a different cadence.
New comments and unresolved threads get read, and bot findings are verified against the code. Real issues are fixed in focused commits, relevant tests and builds are run, changes are pushed, and the loop starts over. A stale thread is resolved only once the code or generated artifact actually addresses the comment.
You need gh and jq: coarse status comes from gh pr view, unresolved review threads from GraphQL with pagination. It stops only when checks pass or are intentionally skipped, the review decision is acceptable, and no actionable comments or unresolved threads remain.
What it helps with
- wait out CI checks without missing a failure
- work through review comments and fix only the real ones
- tell a stale thread from a live problem in the latest code
- confirm a generated file matches its source before resolving a thread
- gather evidence before reporting: commit SHA, check names, thread count
Example prompts for the agent
- Babysit PR #412 until the checks pass and the threads are resolved
- Check the unresolved review threads on this PR and fix the real findings
- Wait for CI on the current branch and tell me what is left before merge
How to install babysit
1Skills CLI (Vercel)
npx skills add thedotmack/claude-mem --skill babysit -a claude-code2Manually: put the files in place
~/.claude/skills/babysit/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/babysit/
1Skills CLI (Vercel)
npx skills add thedotmack/claude-mem --skill babysit -a codex2Manually: put the files in place
.agents/skills/babysit/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add thedotmack/claude-mem --skill babysit -a cursor2Manually: put the files in place
.cursor/skills/babysit/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install thedotmack/claude-mem babysit2Manually: put the files in place
.github/skills/babysit/SKILL.md1Skills CLI (Vercel)
npx skills add thedotmack/claude-mem --skill babysit -a gemini-cli2Platform CLI
gemini skills install https://github.com/thedotmack/claude-mem --path plugin/skills/babysitManually: put the files in place
.devin/skills/babysit/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add thedotmack/claude-mem --skill babysit -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about babysit
How do I install babysit in Claude Code?
Run npx skills add thedotmack/claude-mem --skill babysit -a claude-code. The skill lands in ~/.claude/skills/babysit/SKILL.md.
What does babysit do?
It carries a pull request to merge readiness: waits on checks, reads comments and review threads, fixes what it finds, and repeats until everything is resolved.
How is babysit different from a one-off PR check?
It does not stop after a single pass. While threads or comments stay open the loop continues, and stale threads are resolved only after the fix is verified.
Source text
SKILL.md · Apache-2.0
---
name: babysit
description: Watch a pull request or review cycle until it is ready to merge. Use when asked to babysit, monitor, or keep checking PR comments, reviews, and CI until all actionable issues are resolved.
---
# Babysit PR
Stay with the PR until it is actually clean. Do not stop after one check pass if comments or review threads are still unresolved.
## Workflow
1. Identify the PR number, branch, and base branch.
2. Confirm the PR is not draft and inspect mergeability, checks, review decision, comments, and review threads.
3. Watch pending checks until they finish. Poll at a practical interval, usually 30-60 seconds unless the user asks for a different cadence.
4. Read new comments and unresolved review threads. Treat bot summaries as useful, but verify actionable findings against the code.
5. Fix real issues in focused commits, run relevant tests/builds, push, and return to step 2.
6. Resolve stale review threads only after verifying the code or generated artifact now addresses the comment.
7. Stop only when checks are passing or intentionally skipped, review decision is acceptable, no actionable comments remain, and no unresolved review threads remain.
## GitHub CLI Checks
Use `gh pr view` for the coarse status:
```bash
gh pr view <number> --json \
number,state,isDraft,mergeable,mergeStateStatus,reviewDecision,headRefOid,statusCheckRollup,url
```
Resolve the repository owner/name before using GraphQL:
```bash
repo_json=$(gh repo view --json owner,name)
owner=$(jq -r '.owner.login // .owner.name' <<<"$repo_json")
repo=$(jq -r '.name' <<<"$repo_json")
```
Use GraphQL for unresolved review threads. Include `pageInfo`; omit `cursor` on the first page, then pass the previous `endCursor` with `-f cursor="$cursor"` while `hasNextPage` is `true`.
```bash
gh api graphql \
-f query='query($owner:String!,$repo:String!,$number:Int!,$cursor:String){repository(owner:$owner,name:$repo){pullRequest(number:$number){reviewThreads(first:100,after:$cursor){pageInfo{hasNextPage endCursor}nodes{id,isResolved,isOutdated,path,line,comments(last:1){nodes{author{login},body,createdAt,url}}}}}}}' \
-f owner="$owner" -f repo="$repo" -F number=<number>
```
Use this loop when a PR may have many review threads:
```bash
thread_query='query($owner:String!,$repo:String!,$number:Int!,$cursor:String){repository(owner:$owner,name:$repo){pullRequest(number:$number){reviewThreads(first:100,after:$cursor){pageInfo{hasNextPage endCursor}nodes{id,isResolved,isOutdated,path,line,comments(last:1){nodes{author{login},body,createdAt,url}}}}}}}'
cursor_args=()
while :; do
page=$(gh api graphql -f query="$thread_query" -f owner="$owner" -f repo="$repo" -F number=<number> "${cursor_args[@]}")
printf '%s\n' "$page" | jq -r '.data.repository.pullRequest.reviewThreads.nodes[]
| select(.isResolved==false)
| [.id,.path,(.line//""),(.isOutdated|tostring),(.comments.nodes[-1].author.login//""),(.comments.nodes[-1].body|gsub("\n";" ")|.[0:240])]
| @tsv'
jq -e '.data.repository.pullRequest.reviewThreads.pageInfo.hasNextPage' >/dev/null <<<"$page" || break
cursor=$(jq -r '.data.repository.pullRequest.reviewThreads.pageInfo.endCursor' <<<"$page")
cursor_args=(-f cursor="$cursor")
done
```
Filter unresolved threads with `jq`:
```bash
jq -r '.data.repository.pullRequest.reviewThreads.nodes[]
| select(.isResolved==false)
| [.id,.path,(.line//""),(.isOutdated|tostring),(.comments.nodes[-1].author.login//""),(.comments.nodes[-1].body|gsub("\n";" ")|.[0:240])]
| @tsv'
```
Resolve a stale thread only when the fix is verified:
```bash
gh api graphql \
-f query='mutation($threadId:ID!){resolveReviewThread(input:{threadId:$threadId}){thread{id,isResolved}}}' \
-f threadId=<thread-id>
```
## Operating Rules
- Keep the watcher running while long checks are pending.
- If a generated file is part of the distribution, verify the source and generated artifact agree before resolving comments.
- If a bot reports an issue against stale code, confirm whether the thread is outdated or addressed in the latest head.
- Before final reporting, do one fresh sweep of PR status, unresolved threads, recent comments, and local `git status`.
- Report concrete evidence: latest commit SHA, check names and results, unresolved thread count, tests run, and any dirty local files left untouched.
© thedotmack · Apache-2.0 · thedotmack/claude-mem