agentleFS
arraydudearraydude/agent-skills/skills/babysit-pr/SKILL.md

babysit-pr

Skill2 starsChanged 3 days agoMITView on GitHub

Drive a PR to merge-ready on its own. Updates from main, fixes its failures, routes unrelated CI breakage, QAs it, enables auto-merge, and hands it off for review.

64 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use leaving-pr-comments, sol-loop and 10 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.
  • scottwaterSkill

    leaving-pr-comments

    Format comments an agent posts on GitHub on the user's behalf. Use whenever leaving a PR comment, review comment, or reply.

    Also in 9 projects that use this

  • scottwaterSkill

    sol-loop

    Review a change with GPT Sol in a loop until both agents agree. Use when the user says sol loop, or when another skill asks for a Sol review.

    Also in 7 projects that use this

  • Nexus-Organization-InfosecSkill

    full-stop

    Shut down the Full Control phone-bridge completely — end Claude's watch loop, stop the bridge server (server.py started via ensure_server.ps1), and mark Claude offline in the app. Use whenever the user invokes /full-stop or says "stop full control", "stop the watch loop", "shut down the bridge/server", or "stop the ps1". Counterpart of [[full-control]], which starts everything.

    Also in 9 projects that use this

  • assisjpSkill

    file-pr

    Prepare and open or update an authorized pull request with a concise problem-first description and verifiable evidence. Use when the user asks to create, file, open, or update a PR. Do not use merely to review a diff or when publication is not authorized.

    Also in 13 projects that use this

  • shhacSkill

    full-send

    Complete an explicitly assigned task autonomously through parallel agents, peer-reviewed decisions, and automatic retries of temporary blockers. Use only when the user explicitly invokes Full Send.

    Also in 8 projects that use this

  • assisjpSkill

    takeover

    Take over an existing branch, pull request, worktree, or agent handoff while preserving the original goal, contributor credit, and concurrent work. Use when the user asks to take over, finish, rescue, or continue someone else's implementation. Do not use to replace a clear request to start new work.

    Also in 4 projects that use this

  • +1 more from scottwater

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 63 edited versions we read keep these.

  • 3

    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:

    No PR for the branch → push it and open one, body from the repo's PR template.

    line 24
  2. Distinctive:

    Project facts: read the per-file lint/typecheck command, the test runner, and the review channel from the repo's AGENTS.md / CLAUDE.md.

    line 46
  3. Distinctive:

    Read the log and give the check one class:

    line 101
  4. Very specific:

    Run QA when lastQaSha is empty, when commits since lastQaSha touched product code (anything outside test files), or when step 2 resolved …

    line 116
  5. Very specific:

    Follow the sibling qa-verify skill, answering each of its Ask gates here:

    line 122

“Common” is measured: kept by at least 6 in 10 of the 63 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

Babysit PR

Carry one PR to review handoff: the gate green on the head SHA, QA passed (unless --skip-qa), auto-merge attempted with its status reported, and the link posted to the team's review channel. The human stays out of the loop until the review handoff or until the loop escalates.

Work autonomously: at every fork take the recommended action and keep going. The loop stops only through an escalation trigger.

Setup

  • Target PR: the argument (number or URL), else the current branch's PR. No PR for the branch → push it and open one, body from the repo's PR template.
  • --skip-qa: skip step 5 for this PR. Store it as skipQa in the state file, so wakeups and scheduled re-runs keep it.
  • State file: .context/babysit-pr/<pr-number>/state.json. Read it first on every invocation and wakeup, so a resumed run continues where the last one stopped; create it on the first run:

    {
      "waitingOn": null,
      "lastQaSha": null,
      "lastQaResult": null,
      "postedForReview": false,
      "skipQa": false
    }
  • Gate: the lint and test checks on the head SHA: the CI aggregate check if the repo has one, plus any other lint or test workflow. Every other check is informational: it never blocks the loop, and the final report lists the ones that aren't green.
  • Project facts: read the per-file lint/typecheck command, the test runner, and the review channel from the repo's AGENTS.md / CLAUDE.md. A missing review channel sends step 8 down its fallback.

Guardrails

  • History moves forward: merge origin/main in and push.
  • Merge only through auto-merge in step 7.
  • Stay on this PR's branch. Unrelated breakage is fixed in another session.
  • Validate with the project's per-file lint/typecheck and the tests covering the files you touched.

Escalate

Post a PR comment starting with <!-- babysit-pr:escalation --> that names the trigger, the evidence (run URL, failing test, QA row), and the decision the human owns. Then end the turn with the same message, so it reaches the human through whatever channel the runtime relays final messages on (locally it stays in chat). The loop stops.

Triggers:

  • QA returns a ❌ Regression.
  • A merge conflict needs a product decision (both sides change behaviour).
  • A credential or human action blocks progress, except an auto-merge failure or unavailable merge/review metadata in step 7: report it and continue to step 8.

The loop

1. Open

  • Merged or closed → report it and stop.
  • Draft → mark it ready for review.

Done when the PR is open and ready for review.

2. Update from main

git fetch origin && git merge origin/main, resolving conflicts so both sides keep their intent. Validate every file you touched, then push.

Done when the branch contains origin/main and the push succeeded (or there was nothing to merge).

3. Wait for CI

Actively monitor the PR's CI until the gate checks finish. If the runtime can't monitor, schedule a task in 1 hour that runs /babysit-pr <pr> again.

Gate green → step 5. Any gate check red → step 4.

4. Classify each red gate check

Read the log and give the check one class:

ClassRuleAction
OursThe failing test, or the code it tests, is in the PR diff.Reproduce, fix whichever side is wrong for the PR's intent, validate, push.
UnrelatedNot in the diff, and the same job also fails on the latest completed run of its workflow on main.Follow route-unrelated.md.
FlakyNot in the diff, and main is green for that job.Watch until the run ends, then rerun failed, once. Red again → Ours.

Done when every red gate check has a class and its action is taken. Back to step 3.

5. QA

skipQa → go to step 6.

Run QA when lastQaSha is empty, when commits since lastQaSha touched product code (anything outside test files), or when step 2 resolved conflicts. Otherwise reuse lastQaResult, set lastQaSha to the current head SHA, save the state file, and go to step 6. Here lastQaSha records the commit covered by the result, including valid reuse after test-only changes.

Follow the sibling qa-verify skill, answering each of its Ask gates here:

  • Variants: the recommended ones.
  • Matrix gate: write the matrix to its matrix.md and proceed.
  • Variants that can't be set up locally: try to configure once, then ⬜ Not verified.
  • Credential blockers: ⬜ Not verified for the affected rows.
  • Project facts the repo doesn't state: infer them from its scripts and README; a fact that still blocks a journey makes that row ⬜ Not verified.
  • Screenshots: skip the attachment upload (qa-verify step 5.1) and its read-back check (step 5.3); fill each Before and After cell with a short text description of what that side showed.

Done when the QA table is published and lastQaSha / lastQaResult are recorded. Any ❌ → escalate. Otherwise → step 6.

6. Confirm green

Done when the gate is green on the current head SHA and, unless skipQa, lastQaSha equals that SHA. Anything else → step 3.

An unavailable aggregate status or merge/review metadata does not prove CI failed. Verify the gate from the check or workflow results you can read. If the gate cannot be verified, escalate: unknown CI counts as red.

7. Enable auto-merge

Enable auto-merge on the PR, pinned with expectedHeadOid to the SHA verified in step 6, and attempt it even when merge/review metadata is unavailable. Keep branch protections and required reviews in force: auto-merge is the only merge path, never an admin or direct merge. Enabling auto-merge can merge immediately if all requirements are met.

Done when the result is recorded: auto-merge enabled (read back; "unverified" if the read-back is unavailable) or the exact error. Either way → step 8.

8. Hand off to review

Skip when postedForReview is true. Otherwise resolve the PR author to a verified chat user ID (for Slack, via the author's email or an existing GitHub-to-Slack mapping) and mention them so the chat notifies the author (<@USER_ID> on Slack). If no verified match is available, use the author's name (else GitHub login) and report that the mention could not be resolved. Send exactly one line:

<title> by <author mention> needs review: <url>

The message contains only this line. CI, QA, head SHA, auto-merge status and other details go in the final report.

Post it to the review channel with whatever chat access the runtime has. No channel configured, no chat access, or the post fails → end the final message with the line, for the human to paste.

Set postedForReview: true.

Done when the link is posted or handed over. Final report: the PR link, fixes pushed, checks routed, auto-merge status and any enable error, informational checks that aren't green, and the ⚠️ / ⬜ QA rows (or "QA skipped").

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.