agentleFS
chrolinechroline/oliver/skills/babysit/SKILL.md

babysit

Skill0 starsChanged 3 months agoMITView on GitHub

Babysit the open GitHub PR or stack for a single Linear ticket — repeatedly fix real CI failures and actionable review comments, ignore stack-only merge gates, then stop for explicit approval and merge bottom-up. Use when the user wants /babysit, babysit, or to take an existing ticket's PRs through merge.

44 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use oh-my-issues, what-the 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.
  • tuliosalustiano27Skill

    oh-my-issues

    Cluster a GitHub issue backlog by root cause into a small set of plan-master issues, redirect children with a standardized comment, and bundle architectural-fix PRs that close clusters atomically. Use when an issue tracker has accumulated dozens of reports that share underlying defects, when asked to triage / consolidate / cluster / dedupe issues, when asked to build a plan series or roadmap from open issues, or when routing a new incoming bug into an existing plan.

    Also in 3 projects that use this

  • tuliosalustiano27Skill

    what-the

    What the? Use when the user wants a plain-English breakdown of something technical — the who, what, where, why, and when.

    Also in 3 projects that use this

  • Tsumugii24Skill

    split-to-prs

    Split current work into small reviewable PRs. Use when the user asks to split a chat, set of changes, branch, or PR.

    Also in 4 projects that use this

  • mukcoSkill

    principles

    General software engineering principles — DRY, SOLID, YAGNI, KISS, naming, code smells, and refactoring. Language-agnostic. Use alongside language-specific skills.

    Also in 5 projects that use this

  • PandelisZSkill

    update-cli-config

    View and modify Cursor CLI configuration settings in ~/.cursor/cli-config.json. Use when the user wants to change CLI settings, configure permissions, switch approval mode, enable vim mode, toggle display options, configure sandbox, or manage any CLI preferences.

    Also in 3 projects that use this

  • 32103210Skill

    migrate-to-skills

    Convert 'Applied intelligently' Cursor rules (.cursor/rules/*.mdc) and slash commands (.cursor/commands/*.md) to Agent Skills format (.cursor/skills/). Use when you want to migrate rules or commands to skills, convert .mdc rules to SKILL.md format, or consolidate commands into the skills directory.

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

20 rules. 0 are common, 13 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 42 edited versions we read keep these.

  • 13

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Run the loop to completion.

    line 17
  2. Distinctive:

    If the issue ID is missing and cannot be inferred, ask once.

    line 28
  3. Distinctive:

    Keep only non-merged, non-closed PRs belonging to this ticket.

    line 50
  4. Distinctive:

    If no open PR exists, stop and report that implementation must open one first.

    line 51
  5. Very specific:

    When Factory metadata exists, update its status as the workflow progresses without deleting existing fields.

    line 53
  6. Distinctive:

    No actionable unresolved review thread (or an explicit reply explaining why a request was declined)

    line 62
  7. Distinctive:

    Do not treat these as real CI failures:

    line 67
  8. Distinctive:

    If a failure appears unrelated and the branch is behind its base or trunk, sync/rebase and rerun before changing product code.

    line 99
  9. Distinctive:

    Prefer one fix sub-agent per PR in an isolated worktree when multiple PRs need independent fixes.

    line 101
  10. Distinctive:

    All completion criteria met → leave the loop

    line 114
  11. Distinctive:

    Always take a fresh full-stack snapshot after fixes and CI.

    line 118
  12. Very specific:

    When ready, update Factory metadata to status: "mergeable" when applicable, then stop.

    line 138
  13. Very specific:

    Only after the user says merge, ship it, LGTM merge, or equivalent:

    line 160
  14. Distinctive:

    If real CI or reviews regressed, return to the babysit loop and request approval again only after the stack is ready.

    line 163
  15. Very specific:

    Run gh stack sync --prune when applicable.

    line 165
  16. Very specific:

    Update Factory metadata to status: "merged" when present.

    line 167
  17. Very specific:

    Only the parent runs gh stack, serially, after fix worktrees are removed.

    line 185
  18. Distinctive:

    Never merge without explicit user approval after the ready notification.

    line 187
  19. Distinctive:

    Never push directly to trunk.

    line 188
  20. Very specific:

    Keep /tmp/factory/... artifacts out of git.

    line 189

“Common” is measured: kept by at least 6 in 10 of the 42 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 the open PRs for one Linear ticket until they are clean, then merge only after the user explicitly approves.

Run the loop to completion. Do not stop after one snapshot or fix cycle unless hard-blocked.

Announce: Babysit: <ISSUE-ID> — <title>.


Input

  • Linear issue ID (for example LEM-123) — required unless unambiguous from the current Factory run
  • Optional explicit PR numbers or Factory metadata path

If the issue ID is missing and cannot be inferred, ask once.

Factory may invoke this skill directly after opening PRs. When it does, reuse /tmp/factory/<ISSUE-ID>/meta.json and the already-loaded ticket context instead of rediscovering known facts.


Preflight and discovery

gh --version                      # need 2.90.0+
gh auth status
gh extension install github/gh-stack   # no-op if present
gh stack view --short 2>/dev/null      # exit 9 = stacks unavailable; chained PRs are still supported
  1. Discover Linear and GitHub MCP/tool schemas before calling them.
  2. Load the Linear issue with relations and links.
  3. Build the PR set from, in order:
    • PR numbers in /tmp/factory/<ISSUE-ID>/meta.json, when present
    • GitHub PR links attached to the Linear issue
    • Open PRs whose branches match the issue's Linear git branch and its numbered stack branches
    • The full gh stack containing any matched PR
  4. Keep only non-merged, non-closed PRs belonging to this ticket. Include every layer of its stack, but do not pull in unrelated PRs.
  5. If no open PR exists, stop and report that implementation must open one first.

When Factory metadata exists, update its status as the workflow progresses without deleting existing fields.


Completion criteria

The stack is ready for approval when every PR has:

  • Real CI finished and green
  • No actionable unresolved review thread (or an explicit reply explaining why a request was declined)
  • All fixes pushed
  • A linear stack after lower-layer changes are propagated
  • A mergeable bottom-up path, disregarding only the exclusions below

Do not treat these as real CI failures:

  • Stack merge-readiness or whole-stack gates
  • “Rebase stack” prompts
  • Merge-queue position
  • “All PRs below must be approved” gates

Human approval and CODEOWNERS sign-off may be reported as non-blocking unless repository rules make merging impossible after the user's green-light.


Babysit loop

Repeat until the completion criteria are met or a hard blocker occurs.

1. Snapshot every PR

For each PR, in parallel where practical:

gh pr view <n> --json statusCheckRollup,reviews,reviewDecision,mergeable,mergeStateStatus,url,title,number,headRefName,baseRefName

Also query unresolved review threads and comments. Read only unresolved thread bodies and locations; avoid dumping large API responses. Summarize a board of PR → actionable comments, real CI failures, pending CI, and clean state.

2. Fix comments and real CI failures

For each PR needing work:

  1. Fix the layer where the problem belongs. Never hide a lower-layer defect in a higher PR.
  2. Address valid review requests and bug reports. Reply when declining noise or requesting clarification; resolve fixed threads.
  3. Fix failures caused by the PR. Do not gut, skip, or weaken CI solely to make it green.
  4. If a failure appears unrelated and the branch is behind its base or trunk, sync/rebase and rerun before changing product code.
  5. For conflicts, use the restack-conflict-resolution workflow: combine intended behavior from both sides; never blindly choose ours/theirs.
  6. Prefer one fix sub-agent per PR in an isolated worktree when multiple PRs need independent fixes.

Sub-agents commit and push only their PR branch. They never run gh stack.

The parent removes fix worktrees, then runs all gh stack rebase|sync|push commands serially from the main checkout. A lower-layer fix must be propagated upstack and pushed before status is re-evaluated.

3. Wait for real CI

Watch or poll pending real checks at reasonable intervals while fixing other PRs. A stack push may retrigger every layer above a changed branch; wait for those fresh runs too.

  • Real CI failure → return to fixing
  • New actionable review thread → return to fixing
  • Pending real CI → keep waiting
  • All completion criteria met → leave the loop

4. Re-snapshot

Always take a fresh full-stack snapshot after fixes and CI. Never declare readiness from stale status.


Hard blockers

Pause and report:

  • Conflicting human feedback requiring product judgment
  • CI requiring shared pipeline, secret, permission, or flaky-infrastructure changes outside ticket scope
  • Missing GitHub or Linear authentication/permissions
  • A diverged stack that cannot be reconciled non-interactively
  • An ambiguous product/design change

gh stack exit 9 is not itself fatal if the PRs form a valid chained stack; use plain Git and merge the chained PRs bottom-up.


Notify and stop for approval

When ready, update Factory metadata to status: "mergeable" when applicable, then stop. Do not merge in the same turn that readiness is first announced.

## Babysit — ready to merge

**Ticket:** <ISSUE-ID> — <title> (<url>)
**Stack:** #<stack-number> (or chained PRs)

| PR | Base | Real CI | Reviews |
|----|------|---------|---------|
| #n | ... | green | clean |

### Ignored by design
- Stack-only merge-readiness gates / queue position, if present

Reply **merge** (or another explicit green-light) and I will re-check and merge bottom-up.

Merge after explicit approval

Only after the user says merge, ship it, LGTM merge, or equivalent:

  1. Re-snapshot every PR and unresolved thread.
  2. If real CI or reviews regressed, return to the babysit loop and request approval again only after the stack is ready.
  3. Merge bottom-up with gh stack merge, or merge chained PRs bottom-up when stacks are unavailable.
  4. Run gh stack sync --prune when applicable.
  5. Move the Linear issue to Done.
  6. Update Factory metadata to status: "merged" when present.
## Babysit Complete

**Ticket:** <ISSUE-ID>
**Merged:** <PR URLs>
**Linear:** Done

Guardrails

  • Scope is one Linear ticket and its PR stack only.
  • Loop until real CI is green and actionable reviews are resolved.
  • Ignore stack-only merge-readiness gates, but never ignore real CI.
  • GitHub stacks only: gh stack, never Graphite gt.
  • Only the parent runs gh stack, serially, after fix worktrees are removed.
  • Fix each issue in its owning layer, then propagate upward.
  • Never merge without explicit user approval after the ready notification.
  • Never push directly to trunk.
  • Keep /tmp/factory/... artifacts out of git.

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.