From pr-pipeline
Babysit a PR through to merge — monitor CI, fix failures, rebase on main, resolve review conversations, mark ready for review, enable automerge, and keep checking until merged. Use when the user says "babysit", "watch my PR", "monitor CI", "shepherd this to merge", or after publishing a PR via /pr.
How this skill is triggered — by the user, by Claude, or both
Slash command
/pr-pipeline:babysit-prThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Actively shepherd a PR to merge. Fix problems, resolve conversations, keep watching.
Actively shepherd a PR to merge. Fix problems, resolve conversations, keep watching.
Two scripts in scripts/ handle data gathering. Resolve SKILL_DIR to the absolute path of the babysit-pr skill directory once at the start. Both scripts accept a PR number or URL; if omitted they auto-detect from the current branch.
Run in parallel — don't suppress stderr (errors are diagnostic):
bash "$SKILL_DIR/scripts/fetch_pr_state.sh" $PR_NUMBER
bash "$SKILL_DIR/scripts/fetch_review_threads.sh" $PR_NUMBER
fetch_pr_state.sh → { pr, checks, fetchedMain }
pr: number, title, url, head/base, isDraft, mergeable, mergeStateStatus, reviewDecision, autoMergeRequestchecks: total/passed/failed/pending/skipped counts + details[] (name, status, elapsed, url)fetchedMain: whether git fetch origin main succeededfetch_review_threads.sh → { pr, threads, summary }
summary: total/resolved/unresolved/unresolved_human/unresolved_bot/outdatedthreads[]: id, path, line, isResolved, isOutdated, authorLogin, authorType ("human"|"bot"), comments[]Present the status table, then move to Phase 2.
Work in priority order. Commit and push after each fix.
If isDraft is true: wait until CI is green and no conflicts, then ask "CI is green — ready to mark for review?" Apply with gh pr ready $PR_NUMBER.
If checks.failed > 0:
gh run view to inspect logsIf mergeable is CONFLICTING:
git diff --name-only HEAD...origin/maingit rebase origin/mainIf not enabled and no blockers remain (or only review pending), suggest: gh pr merge $PR_NUMBER --auto --squash. Ask before enabling.
Important: --auto does NOT merge the PR immediately. It tells GitHub to merge automatically once all branch protection requirements are satisfied (CI passing, required reviews, etc.). After enabling auto-merge, the PR is still open — continue monitoring in Phase 3 until GitHub actually merges it.
Unresolved threads block merge. Skip if summary.unresolved is 0.
For each unresolved thread, follow three steps:
Read the full thread and the code at path:line. State in one sentence what the reviewer is asking for or pointing out.
Classify the feedback:
Based on the assessment, pick one:
After any fix is pushed, resolve the thread:
gh api graphql -f query='mutation($id: ID!) { resolveReviewThread(input: {threadId: $id}) { thread { isResolved } } }' -f id=THREAD_ID
Work through comments by severity: bugs → security → performance → style nits.
Human threads (authorType: "human") get individual attention through all three steps above. Always ask the user before applying fixes or posting replies.
Bot threads (authorType: "bot") get triaged in batch. Most bot comments fall into predictable buckets:
Present bot comments grouped: "Bot left 4 comments: 2 nits, 1 null-check issue, 1 noise." Ask before bulk-resolving.
Show a grouped summary first, then work in order: human changes → human questions → bot real issues → bot nits.
After resolving conversations, reassess:
CHANGES_REQUESTED + all threads resolved → "Waiting for re-approval from @reviewer"REVIEW_REQUIRED → note who needs to reviewAPPROVED → move onA PR is merge-ready when: CI green, no conflicts, conversations resolved, review approved, automerge enabled. Until then, keep watching.
Set up monitoring via /loop:
/loop 5m /babysit-pr
Each iteration re-runs both scripts from Phase 1 and checks all conditions:
| Condition | What to check | Action if unmet |
|---|---|---|
| CI green | checks.failed == 0 | Re-enter Phase 2b |
| No conflicts | mergeable != "CONFLICTING" | Re-enter Phase 2c |
| Conversations resolved | summary.unresolved == 0 | Re-enter Phase 2e |
| Review approved | reviewDecision == "APPROVED" | Note — can't force this |
| Automerge enabled | autoMergeRequest == true | Re-enter Phase 2d |
When all conditions are met and automerge is enabled → report "All checks are green and automerge is enabled. GitHub will merge automatically once branch protection requirements are satisfied — nothing left for us to do." Then stop the loop.
Do NOT report the PR as merged at this point. Automerge means GitHub will handle it, but the merge hasn't happened yet. The PR is still open until GitHub processes it.
If the user doesn't want continuous monitoring, present the final status and exit.
## PR #<number> — <title>
| Check | Status |
|-----------------|--------|
| CI | ... |
| Conflicts | ... |
| Conversations | 2 unresolved (1 human, 1 bot) |
| Review | ... |
| Automerge | ... |
## Unresolved Conversations
### Human
- @reviewer in `path/to/file.ts:42` — wants null check added → **code change**: add guard at line 44
- @reviewer in `path/to/utils.ts:18` — asks why we use X over Y → **reply**: drafted response explaining tradeoff
### Bot
- bot-review: 3 style nits (resolve), 1 potential null deref (code change)
## Actions Taken
<what was fixed>
## Remaining
<what still needs attention>
npx claudepluginhub jukben/claude-skills --plugin pr-pipelineDrives existing GitHub/GitLab PRs/MRs to merge: monitors CI/CD status, fixes issues in PR scope via sub-skills, handles multi-round code reviews, resolves comments until all requirements met.
Autonomously resolves PR merge blockers: conflicts, CI failures, review comments; syncs description and requests re-review. For unattended cron execution via loop skill.
Automatically polls and shepherds open PRs/MRs: triages review comments, fixes CI failures, pushes autofix commits, and keeps pull requests moving without manual intervention. Supports GitHub and GitLab.