agentleFS
mo-cmykmo-cmyk/mazarbul/.claude/skills/babysit-pr/SKILL.md

babysit-pr

Skill2 starsChanged 35 days agoApache-2.0View on GitHub

Cron-driven autonomous loop that babysits a PR through CI + Greptile + reviewer feedback until merge-ready, then notifies. USE WHEN user says 'babysit this PR' / 'watch the PR until ready' / 'autonomous wrap', or chained from /wrap-up after /ship. Schedules 240s Cron ticks, invokes /review-fix on CI failures and /greptile on bot comments. NEVER merges. Stops on merge-ready + PushNotification. NOT FOR small diffs you can manually monitor (just /ship) or already-merged PRs.

79 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use leaving-pr-comments, full-stop and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • cogine-aiSkill

    leaving-pr-comments

    Use whenever leaving comments on GitHub.

    Also in 15 projects that use this

  • PostHogSkill

    full-stop

    Also in 15 projects that use this

  • cogine-aiSkill

    modernize

    For getting old prs up to date. Use when asked to rebase a pr or "modernize".

    Also in 13 projects that use this

  • Solly922Skill

    html-communication

    Create self-contained HTML artifacts for plans, architecture maps, comparisons, reports, timelines, diagrams, and technical explainers when visual structure improves understanding. Use for complex or spatial information; do not use for short, linear answers that are clearer in Markdown.

    Also in 3 projects that use this

  • MicrosoftSkill

    review-loop

    Iterative review loop using any lens agent against any target (plan, code, design). Use when you want to run a focused review cycle: spawn a fresh reviewer subagent with a specific lens, present findings and remediation to the user, apply fixes with user guidance, and repeat until clean.

    Also in 9 projects that use this

  • rebase-energySkill

    hillclimb

    Drive hillclimb searches — start, monitor, stop, prune, and resume auto-hillclimbing runs that spawn headless coding agents as operators.

    Also in 3 projects that use this

  • +1 more from cogine-ai

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 77 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If empty, exit with an instructive error: "No PR detected on current branch.

    line 20
  2. Very specific:

    Use the CronCreate deferred tool with these parameters:

    line 42
  3. Very specific:

    After CronCreate returns, capture the cron job ID into state:

    line 49

“Common” is measured: kept by at least 6 in 10 of the 77 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Schedule an autonomous Cron loop that watches a PR through every phase from ci_pending to merge_ready. The loop NEVER merges. It only watches, fixes CI failures, triages Greptile, and notifies on key transitions.

This skill is invokable by the LLM (it's chained from /wrap-up via the Skill tool, and matches direct user phrasing like "babysit this PR"). The collision check in step 2 prevents accidental double-starts. Destructive ops still gated: this skill never calls gh pr merge.

Steps

1. Resolve PR number

PR="${ARGUMENTS:-$(gh pr view --json number -q .number 2>/dev/null)}"

If empty, exit with an instructive error: "No PR detected on current branch. Open one with /ship first."

2. Check for collision

STATE=".claude/babysit-state-${PR}.json"
if [ -f "$STATE" ]; then
  echo "Babysit loop already active for PR #$PR. Run /babysit-abort to stop it first."
  exit 1
fi

3. Initialize state

source .claude/scripts/babysit-state.sh "$PR"
state_init
log_audit "init" "started babysit for PR #$PR"

4. Schedule the Cron loop

Use the CronCreate deferred tool with these parameters:

  • expression: */4 * * * * (every 4 minutes , stays inside the 5-min prompt cache TTL)
  • durable: true (intent: persist to .claude/scheduled_tasks.json so the loop survives session restarts; currently silently ignored by the harness , CronCreate returns "Session-only" regardless. Pass it anyway so the loop becomes truly durable the day that bug is fixed.)
  • prompt: /babysit-tick $PR (literal slash command , bypasses disable-model-invocation via slash-command path; the per-tick worker reads state and branches on phase)
  • description: babysit PR #$PR

After CronCreate returns, capture the cron job ID into state:

set_field cron_job_id "<id-returned-by-CronCreate>"

5. Notify (pr_opened)

if [ "$(.claude/scripts/babysit-notify.sh $PR pr_opened)" = "send" ]; then
  # Invoke PushNotification deferred tool with:
  #   status: "proactive"
  #   message: "PR #$PR opened , watching CI + Greptile (240s ticks)"
fi

6. Hand off

Print to user:

  • "Babysit loop scheduled for PR #$PR. Tick every 240s, no auto-merge."
  • "State: .claude/babysit-state-$PR.json"
  • "Stop with /babysit-abort."
  • "Type merge it once you're notified merge_ready."
  • "Session-bound: the cron lives inside this Claude session. Closing the terminal kills it. Re-run /babysit-pr $PR next session , the state file picks up from the current phase."

Exit. The Cron continues firing /babysit-tick prompts into THIS session every 4 min.


Gotchas

  • Session-bound, not truly autonomous. The harness's CronCreate injects the /babysit-tick prompt back into the active Claude session every 4 min , it does NOT spawn a claude -p subprocess. So the loop only advances while THIS terminal is alive and Claude is the foreground process. durable: true is silently ignored (no entry in .claude/scheduled_tasks.json); the cron lives entirely in session memory.
  • State file is the cross-session bridge. .claude/babysit-state-<PR>.json persists on disk. Closing the terminal stops the loop, but re-running /babysit-pr <PR> next session detects the existing state file (collision check) , /babysit-abort <PR> first, then /babysit-pr <PR> again to rearm, and the worker picks up from the persisted phase.
  • For true cross-session autonomy, fall back to launchd (macOS) or a GitHub Actions workflow that reacts to PR state changes server-side. Don't pretend this skill provides that.
  • The 240s interval is calibrated to the 5-min prompt cache TTL. Don't bump higher than 270s , cache misses cascade.
  • This skill writes state but does NOT do any work itself. The actual loop is in /babysit-tick.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.