Skip to content
OpenAgentSkill
Browsing is open · Catalog captured 2026-11-21 · Automatic updates and account services are paused.
Development

pr-babysitter

Monitors or repairs an open GitHub PR: CI failures, conflicts, review threads, and merge readiness, reporting state changes. Use when asked to \"watch this PR\", \"fix CI\", \"resolve conflicts\", or \"address review comments\". For PR metadata use pr-creator; for npm release PRs use autoship.

mblode · AI review on file

Installation

Read the source and dependencies before running a command. Copying does not install or execute anything.

npx skills add mblode/agent-skills --skill pr-babysitter

About this skill


name: pr-babysitter description: "Monitors or repairs an open GitHub PR: CI failures, conflicts, review threads, and merge readiness, reporting state changes. Use when asked to "watch this PR", "fix CI", "resolve conflicts", or "address review comments". For PR metadata use pr-creator; for npm release PRs use autoship." compatibility: Requires a Git checkout, authenticated GitHub CLI, and jq. Continuous monitoring also needs a supported scheduler or event subscription.

PR Babysitter

  • IS: keeping one open PR moving: conflicts, CI across GitHub Actions/Buildkite/Vercel/Fly.io, inbound review comments, and merge readiness, as a background monitor or as one-shot fixes.
  • IS NOT: opening or editing the PR (pr-creator), reviewing the diff for bugs (pr-reviewer), applying a local pr-reviewer report (tidy), or npm release PRs (autoship watches its own release CI; never babysit a release or Version Packages PR it drives).

Mode Selection

InvocationMode
"babysit", "watch this PR", "monitor", "keep it green"Monitor: Phase 1 once, then phases 2-5 on every event or tick
"fix CI", "why is CI red", "loop on CI"One-shot Phase 3 loop
"resolve conflicts", "rebase onto main", "update the branch"One-shot Phase 2
"address the comments", "reply to the reviewers", "triage review comments"One-shot Comment Triage Workflow
"is it ready", "what is blocking the merge"One-shot Phase 5 report

Standing rules, every mode:

  • Monitoring or fixing code does not by itself authorize posting replies. Post, resolve threads, or request reviews only when the user authorized that communication; otherwise prepare replies and report them.

  • Resolve scripts/fetch-comments.sh relative to this installed SKILL.md. ${CLAUDE_SKILL_DIR} below is a Claude Code adapter, not a portable environment variable.

  • No setup questions. Auto-detect the PR, the CI platforms, and the defaults (poll every 2 minutes, auto-resolve noise, no auto-merge), then start. Overrides arrive inline: "poll every 5 minutes", "enable auto-merge".

  • Skip closed or merged PRs. Skip drafts (isDraft) unless asked.

  • Comment triage runs autonomously; the plan file is an audit trail, not an approval gate.

  • Speak only on transitions. A quiet poll says nothing.

Reference Files

FileRead when
references/monitoring-setup.mdPhase 1: watch ladder detail, Monitor watch script, cron fallback, state file format, defaults
references/merge-conflicts.mdPhase 2: mergeStateStatus table, rebase workflow, lockfile and generated-file resolution, abort criteria
references/ci-platforms.mdPhase 3: gh pr checks fields and exit codes, per-platform log and retry commands, Buildkite auth chain, failure classification
scripts/fetch-comments.shComment triage: run ${CLAUDE_SKILL_DIR}/scripts/fetch-comments.sh {N} first. One JSON document of every review, thread, and issue comment; --help prints the output shape
references/github-api.mdComment triage: script output contract, manual GraphQL/REST fallback, thread accounting, anchor ladder, awaiting-reply rule, reply and resolve
references/bot-patterns.mdComment triage: reviewer detection, severity mapping, merge gates, noise markers, dedup, false positives
references/fix-plan-template.mdComment triage: plan file format and the legal ignore reasons
references/verification-gate.mdBefore any commit: lint, type-check, test, knip, stray-artifact sweep
references/git-resilience.mdA git command hangs or fails transiently (fsmonitor wedge, stale index.lock, network blip)
evals/evals.jsonOnly when changing this skill; never during a PR task

Monitor Loop

Phase 1 runs once in the foreground and starts the watch. Every event or tick then runs phases 2-5, diffs against the state file, and speaks only when something changed.

Copy this checklist to track progress:

PR babysit progress:
- [ ] Phase 1: Initialize (detect PR, pick watch mechanism, snapshot state)
- [ ] Phase 2: Conflict check
- [ ] Phase 3: CI check (diagnose, fix, gate, push)
- [ ] Phase 4: Comment check (triage new comments)
- [ ] Phase 5: Readiness check (report transitions, write state file)

Phase 1: Initialize

  1. gh pr view [N] --json number,url,title,state,isDraft,headRefName,baseRefName,headRefOid,mergeable,mergeStateStatus,reviewDecision. No PR for the branch: say so and stop.
  2. gh repo view --json owner,name for the calls that need owner/repo.
  3. Detect CI platforms from gh pr checks --json name,link (dispatch table in Phase 3).
  4. Pick the watch mechanism: first rung that applies.
RungAvailable whenBehaviour
Harness PR subscriptionA PR-subscription tool is exposed (cloud sessions: Claude_Code_Remote:subscribe_pr_activity; GitHub MCP server: github:subscribe_pr_activity), or the web session's Auto-fix toggle is onGitHub pushes review comments, CI failures, and check-suite success into the session. GitHub sends nothing when the base branch advances, so pair it with a slow Monitor poll (10 minutes) on mergeStateStatus. If the tool reports a PR Steward already watching, this session gets no events: say the PR is already covered and offer the one-shot modes instead of double-fixing
Monitor toolMonitor is in the tool listStart the watch script from the monitoring reference with persistent: true. Quiet polls never wake the agent; each emitted line runs phases 2-5
CronCronCreate is in the tool list*/2 * * * * running phases 2-5; every tick wakes the agent. Recurring tasks expire after 7 days
NoneNeitherDo not claim monitor mode. Run the matching one-shot mode, or say this runtime cannot keep polling
  1. Snapshot state to .claude/pr-babysitter/babysit-pr-{N}.md: mechanism and ID, head SHA, mergeability, check states, op
Read the complete source ↗