New to Claude Skills? Learn how to install them →

thedotmack on GitHub

Babysit PR

Free

Monitor pull requests until they're ready to merge.

Get this skill

Free · Opens the source repo

What Babysit PR does

Babysit PR is a bash-based skill designed to assist developers in managing pull requests (PRs) effectively. When a PR is created, it often requires ongoing attention until all comments, reviews, and checks are resolved. This skill automates the monitoring process, ensuring that developers do not miss any important updates or actionable items that could delay the merging of code. By continuously polling the PR's status and checking for unresolved threads, it keeps the developer informed about the current state of the PR.

The workflow begins with identifying the PR number, branch, and base branch, followed by confirming the PR is not a draft and inspecting its mergeability. The skill polls for pending checks at regular intervals, typically every 30-60 seconds, and reads new comments and unresolved review threads. This allows developers to address issues as they arise, rather than waiting for a single check pass. The focus is on resolving real issues through targeted commits, running tests, and ensuring that all review threads are addressed before considering the PR ready for merging.

Babysit PR is particularly useful in collaborative environments where multiple developers are involved in code reviews. It helps streamline the review process by ensuring that no comments or issues are overlooked, thus reducing the risk of introducing bugs into the codebase. The skill is ideal for teams that prioritize code quality and want to maintain a smooth workflow during the PR review cycle.

However, it is important to note that this skill is not a substitute for thorough code review practices. While it helps monitor the status of a PR, developers still need to engage with the code and provide thoughtful feedback. Additionally, it may not be suitable for projects with infrequent PR activity, as the overhead of monitoring may not justify its use in such cases.

When to use it

Use this skill when you need to continuously monitor a pull request for updates, comments, and checks until all issues are resolved and it is ready to merge.

When not to use it

Avoid using this skill for projects with low PR activity, as the overhead may not be justified. It also does not replace the need for in-depth code reviews.

What you can build with it

Continuous PR Monitoring

Use Babysit PR to keep an eye on a PR's status, ensuring you catch all new comments and issues as they arise.

Collaborative Code Reviews

In a team environment, this skill helps ensure that all team members are aware of unresolved issues in PRs.

Streamlined Merging Process

By addressing comments and checks promptly, you can reduce the time it takes to merge PRs into the main branch.

How to install Babysit PR

View source

1. Install with the skills CLI

npx skills add thedotmack/claude-mem/babysit --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by thedotmack

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:

gh pr view <number> --json \
  number,state,isDraft,mergeable,mergeStateStatus,reviewDecision,headRefOid,statusCheckRollup,url

Resolve the repository owner/name before using GraphQL:

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.

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:

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:

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:

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.

Frequently asked questions about Babysit PR

Similar skills