babysitting-prs/SKILL.md
Runs a single babysitting pass on an open pull request — detects the platform (GitHub, Bitbucket, or Truora's Bitbucket+betico), pulls review and CI state, applies fixes to actionable feedback, resolves threads, and hands the PR to the platform's native ready-gate. Designed to be invoked on a cadence via `/loop`. Use when the user says "babysit my PR", "watch this PR", "loop my PR", "check my PR", or asks to keep a PR moving toward merge without doing the merge directly.
npx skillsauth add juanjosegongi/skills babysitting-prsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
One iteration of a "keep my PR moving" loop. Platform-agnostic at the top; platform commands live in references/.
Designed to be driven by /loop:
/loop 5m /babysitting-prs
Each tick does one full pass, reports state, and exits. The loop owns cadence — this skill owns correctness.
SKILL.md — agnostic playbook (this file)references/github.md — gh command map for GitHubreferences/bitbucket.md — bkt command map for vanilla Bitbucket Cloud; defers to bitbucket-receiving-code-review for full detailreferences/truora-betico.md — Truora-specific betico playbook (loaded only when the remote is a Truora Bitbucket repo)scripts/detect-platform.sh — prints github, bitbucket-truora, bitbucket, or unknown based on git remote get-url origincreating-bitbucket-prs or branch-pr first.Every tick MUST:
bot: ready (Bitbucket) or enabling native auto-merge (gh pr merge --auto). Platform owns the actual merge.bitbucket-truora only: never edit the PR title manually — betico owns it. Drive title state via bot: ready / bot: not ready comments. See references/truora-betico.md. On plain GitHub or vanilla Bitbucket, editing titles is fine.If the PR is merged or closed at the start of the tick, skip to "Stop conditions" and report.
This skill is review-facing. Pinging reviewers off-hours is rude and noisy.
Before doing anything, check the local clock:
HOUR=$(date +%H); DOW=$(date +%u) # DOW: 1=Mon … 7=Sun
If DOW >= 6 (Sat/Sun) or HOUR < 9 or HOUR >= 18, exit early with a one-line report: "Outside working hours (Mon–Fri 09:00–18:00). Skipping tick." Do NOT sleep, do NOT post anything. The /loop interval owns cadence — the guard just makes off-hours ticks no-ops.
Override only when the user explicitly says "check now" or invokes the skill directly (not via /loop).
Resolve the PR for the current branch (or from a URL the user passed in this turn).
PLATFORM=$(scripts/detect-platform.sh)
BRANCH=$(git branch --show-current)
PLATFORM=github → use references/github.md.PLATFORM=bitbucket-truora → use references/bitbucket.md AND references/truora-betico.md. The Truora repos run betico, which owns the PR title and the merge gate.PLATFORM=bitbucket → use references/bitbucket.md only. No betico — Step 5 stops at "ready, needs manual merge" since vanilla Bitbucket has no native auto-merge equivalent.PLATFORM=unknown → stop and ask the user which platform; do not guess.If no PR is open for $BRANCH, stop and report "no PR for branch — create one first".
For the resolved PR, fetch in parallel:
references/bitbucket.md).Cache the head SHA. You will re-read it in Step 5.
Bucket every unresolved thread into one of:
For each bucket:
| Bucket | Action this tick | Reply tone |
|---|---|---|
| Actionable | Apply the fix → commit (work-unit-commits) → push → reply on thread → resolve via API | Terse: one word — done or fixed. Optionally a single line linking the commit. No paragraphs. |
| Question | Add the missing code comment → push → reply | Brief: 1–2 sentences answering the why. |
| Disagreement | Reply with evidence (link to docs, decisions, benchmarks). Do NOT resolve. If 3+ back-and-forths, escalate (top-level comment proposing a sync). | Full: this is the only bucket that gets the warm comment-writer treatment. |
| Out of scope | Reply acknowledging + link to a follow-up issue. Resolve. | Brief: acknowledge + link. |
| Informational | Resolve silently if it's a leaf reply; otherwise leave alone. | n/a |
Resolution gate — only resolve a thread when both sides agree it's done:
Always respond on the PR even if the conversation moved to chat or a call — visibility for the next reader.
Use comment-writer only for the Disagreement bucket. The other buckets are intentionally terser to avoid flooding humans with paragraphs after small fixes.
Merge conflict with the base branch → STOP the loop. Post bot: not ready (Bitbucket) or gh pr merge --disable-auto (GitHub) if a ready-gate is already armed, then report STOP — merge conflict with <base>, resolve manually. Do not try to resolve conflicts inside the loop.
CI state for the current head SHA:
main, dep regression, persistent flake) → STOP the loop. Post bot: not ready if applicable, then report STOP — CI broken, see <link>. Never silently retry forever.Dependencies first. If the PR description has a Dependencies section and any listed PR is unmerged, post bot: not ready (Bitbucket) or keep auto-merge disabled (GitHub) and skip the rest of Step 5. Report waiting on dependencies: <PR list>. The loop will retry next tick.
Otherwise, before arming the gate, all of these must be true:
When all gates pass, in order:
gh pr ready.bkt pr update "$PR_ID" --draft=false.gh pr merge --auto --squash (or --merge / --rebase per repo convention).bitbucket-truora: post top-level bot: ready only if the title doesn't already show ready (see references/truora-betico.md).bitbucket: stop here. No native auto-merge — report ready — needs manual merge by approver.If something later regresses (new comment, CI run turns red, dependency un-merged), undo:
gh pr merge --disable-auto.bitbucket-truora: post bot: not ready.bitbucket: nothing to undo (no gate was armed) — just re-draft if appropriate.This skill never runs git merge, gh pr merge without --auto, bkt pr merge, or any other direct merge command.
End the loop (tell the user to stop /loop) when:
merged or closed.main, dep regression, repeat flake).In all cases, the report's Next: line MUST start with STOP — <reason> so the loop's next tick recognizes it and the user sees a clear stop signal.
End every tick with this exact shape:
PR: <link>
Platform: <github|bitbucket>
Head SHA: <short>
State: <open|merged|closed> | Draft: <yes|no>
CI: <state/conclusion>
Approvals: <n approved, n requested-changes, n pending>
Threads: <n actionable, n question, n disagreement, n oos, n informational>
Actions this tick:
- <bullet per concrete action: commit pushed, thread resolved, bot:ready posted, …>
Next: <one of: "waiting for CI (~Xm)", "waiting for reviewer", "ready — auto-merge enabled", "STOP — <reason>">
The Next: line is what the loop's next tick reads first to decide whether to keep going.
bitbucket-receiving-code-review — full Bitbucket command reference; this skill delegates to it for bkt specifics.creating-bitbucket-prs, branch-pr — use these to create the PR before starting the babysitting loop.comment-writer — wording for replies.work-unit-commits — commit shape when applying fixes.development
Guides Dockerfile creation and optimization. Use when Dockerfile or Docker Compose is detected. Supports multi-stage builds, cache optimization, security hardening, and image size minimization.
development
Provides comprehensive testing and TDD guidance. Use for writing tests before implementing new features (TDD, test-driven development, red-green-refactor), creating reproduction tests for bug fixes, running regression tests during refactoring, and checking test coverage during code reviews. Enforces AAA pattern, test-first workflow, and 100% business logic coverage goal. Also covers testing anti-patterns, mock discipline, and testable design.
data-ai
A completely different skill for database operations. Use when working with PostgreSQL queries, schema design, or database migrations.
testing
Another sample skill for testing. Use when the user wants to create widgets with advanced features or mentions beta testing.