babysit-pr
Watches over your pull request from start to finish, fixing small problems and keeping it on track to merge.
Installation
Paste this into Claude Code, Cursor, or any agent that can run commands.
SKILL.mdShow the author's original SKILL.md
--- name: babysit-pr description: 'Author-side PR lifecycle babysitter and companion to review-pr. Use when the user wants to tend an existing GitHub PR through CI, review threads, description sync, mergeability, auto-fixes, or asks to babysit a PR with or without an existing manifest.' argument-hint: '[pr-url] [--manifest <path>] [--ci] [--no-log]' user-invocable: true --- Babysit an existing PR by running the manifest workflow: drive the author-side lifecycle toward green and mergeable. A reviewer, person or skill, reaches this run only through GitHub PR state. **Inputs.** Accept a PR URL, `--manifest <path>`, both, or neither, plus `--ci`, and `--no-log` to disable the default journal. No PR URL means infer the current branch's upstream/open PR; halt with an actionable error when no single PR can be inferred. `--manifest <path>` supplies the strongest PR grounding and skips fresh synthesis. Without `--manifest`, resume the Manifest an earlier tend of this PR recorded in its journal (*Logging*), as if it had been passed with `--manifest`, so amendments made since stay in force; only when no recorded Manifest file still exists, invoke `define` with `--babysit <pr-url> --autonomous`, read its `Manifest complete:` path, then continue. **Logging.** Unless `--no-log` is present, keep a persisted append-only journal across the tend, so a warm session that compacts mid-lifecycle keeps continuity — what was already tried and abandoned, and operational notes (retriggers, waits). It carries the **dead-end memory** GitHub state can't reconstruct: fixes attempted and reverted, approaches considered and rejected that left no commit. The default path is `~/.manifest-dev/logs/babysit-<owner>-<repo>-<N>.md` (`~` = `$HOME` / `%USERPROFILE%`; create the dir, fall back to a writable temp path only when home isn't writable). The path is keyed to the PR, so a reinvocation finds the existing file, reuses it and appends a new run boundary; with no file, create one. As soon as a run has resolved or synthesized its Manifest, it appends a line `Manifest: <absolute path>`, and a later run resumes the newest path such a line records. With `--no-log` or no journal there is no record to resume, so a run synthesizes afresh; pass `--manifest` to keep a tended Manifest. Append only — never rewrite prior entries. Pass prior evidence, finding dispositions, and verified repairs to `/do` for applicability checking against current criteria and PR state. When the journal is unavailable on an ephemeral runner, reconstruct current PR state from GitHub and record that prior abandoned attempts could not be recovered. **PR grounding.** The Manifest is the tend's intent source: the one passed with `--manifest`, else the one the journal records, else the one `define` synthesizes from the pull request. Comments are signals, not authority; a comment alone does not require code changes or a Manifest amendment. Where the project keeps a `NORTH_STAR.md` — usually already in context through the project context file — apply it as a standing check on that intent rather than as another source of it: it says nothing about this PR's intent, so it cannot be ranked among sources that do. An adopted request that is well-grounded here and still crosses a stated principle — a *Principles* entry, or a `Never` in a North Star of the older nine-field form: the checkable part of that document, since the rest of it informs and does not route — goes through manifest amendment or escalation with the clash named, never into a silent refusal. **Unattended launch.** At the start of a standalone tend, before invoking `/define` or `/do`, establish a durable PR-tend goal-setting backstop. It spans manifest discovery or synthesis and `/do`, including the `--manifest` path where `/define` is skipped, and during `/do` it carries the gate clause below. It is the outer backstop for the tend: nested `/define` handoff text and `/do` unattended-launch text should not set or print competing narrower goals while this babysit backstop exists. Emit the blocks below verbatim, substituting `<pr-url>`. Do not summarize, shorten, reword, or re-punctuate them. Set it through the harness's goal-setting, continuation, or durable-completion-condition capability where one exists; print it in copy-pasteable form for the user's own continuation mechanism where none does. Emit the PR-tend prefix, then the PR goal block, then the gate clause, as one contract: one unlabeled block introduced by a sentence of your own, since the fences and their labels are this file's markers rather than part of what you emit. ```pr-tend-prefix Drive the pull request at <pr-url> until it is mergeable, a person merges it, or a blocker requires a person and no useful independent work remains. Never press merge. In CI one-shot mode, report an external wait as pending once no actionable work remains; otherwise keep tending through waits. Discover or synthesize the Manifest for this pull request. Record its path in a checkpoint note as soon as it exists. ``` ```pr-goal-block Work until the Outcome and every current Acceptance Criterion and Global Invariant in the Manifest hold, each with fresh evidence, the workflow's bounded mandatory build work is settled, and completion has been reported. The Manifest changes only through the skill that wrote it, never by direct edit. Working claims and evidence methods may be revised on evidence while preserving the Outcome and hard requirements; those need their source's authorization to change. Overall plan approval does not harden agent choices. A changed claim or evidence method returns affected results unverified. Record compact checkpoint notes as work proceeds: what changed, what was verified, what remains, blockers. Assume the user is AFK; make authorized decisions without asking questions. Surface blockers promptly and continue useful independent work. Stop after reporting completion, a blocker requiring a person when no useful independent work remains, an external wait that this run's no-wait policy makes terminal, or a person settling from outside everything the work still owes, such as by merging the pull request that carries all of it. Continue while authorized, actionable work remains. ``` ```gate-clause Track the Outcome and every Acceptance Criterion and Global Invariant in the Manifest: its id, its latest verdict, the evidence behind that verdict, and whether that evidence is still fresh relative to the last relevant change to the gate's subject. Completion requires the Outcome and every current gate to hold on fresh evidence, with bounded mandatory build work settled and no unresolved amendment or necessary missing evidence. Unverified, failing, stale, actionably blocked, or escalation-pending gates do not satisfy successful completion. A terminal wait is reported as pending, never as success. A substantive change to a gate's subject after it passed marks it stale until re-judged, while re-reading, re-examining, and cosmetic or no-op edits do not. Never accept unevidenced self-attestation, "looks done", or a summary claim in place of the evidence the gate names. ``` **Execution.** After resolving the manifest path, invoke `do` on it. For `--ci`, pass CI one-shot / no-wait context to `/do`. Unless `--no-log` is present, pass the resolved journal path to `/do` so it reads prior context before acting and appends after. When `--no-log` is present, forward it to `/do` so the opt-out holds there too — otherwise `/do`'s own default execution log would recreate the record the user declined. Do not print a follow-up command as the primary outcome; this skill owns the define→do chain. `/do` owns the execution from there, and the tend ends on one of the terminal paths its *How a run ends* names. **CI mode.** `--ci` means one complete state advance, then exit. Execute every immediately actionable step, including trusted auto-fixes, tests, commits, pushes, retriggers, safe description syncs, and safe replies/resolutions. When only waiting remains, report the wait state and exit successfully; do not keep the runner alive with long sleeps. The next GitHub event, scheduled run, or manual dispatch reinvokes the skill. Run one tend per PR at a time — in CI, a concurrency group keyed to the PR that queues a new run behind the running one — since two runs at once each read the same state and post the same replies; say so to the user when setting up a CI tend, and in a report only when the run sees another tend overlap it. **Mutation boundary.** Auto-fix and push only when the PR head is trusted and writable: normal push permission exists, the head branch is not a protected/base branch, the PR is not an untrusted fork path with privileged secrets, the local checkout matches the current PR head SHA before fixing, and the push is a normal fast-forward branch update. When a push is rejected as not a fast-forward, the head moved under the run: re-fetch the PR and push nothing from the stale checkout; under `--ci`, the run ends pending, waiting on the run the new head triggers, and its report names the new head so the next run starts from it; otherwise continue from the new head. Never press merge, never force-push, and never push to a base branch. The target is mergeable, not merged. **Failure handling.** If PR inference fails, `define` is unavailable, returns no manifest path, or rejects the PR URL, stop and surface the reason. If the user supplied `--manifest`, read it as grounding but do not rewrite it before `/do`; later new scope or conflicting comments go through `/do`'s amendment/escalation path.
Mirrored from the author's public source. Install counts from the open skills registry.