skills/worktree/SKILL.md
--- name: worktree description: Coordinate multiple agents on one repo via a worktree-lock pool, so two agents never clobber each other's working tree. Acquire the first free slot (main, then beta/gamma… worktrees, created on demand), work there on your own branch, release when you've pushed. Use before modifying any repo that might be in use by another agent (factory, dataforce, etc.), or whenever you're told a repo is being worked on. Backed by `ro worktree`. category: development argument-hin
npx skillsauth add RonanCodes/ronan-skills skills/worktreeInstall 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.
Multiple agents work the local factory at once. Two agents in the same working tree corrupt each other's edits. The fix: a per-repo lock pool of worktrees. You take a free slot, work there, hand it back when you've pushed.
# 1. Before touching a repo that might be busy, take a slot:
path="$(ro worktree acquire)" # prints the path; stderr says which slot
cd "$path"
# 2. Do your work on your own branch (never main):
git checkout -b feat/whatever
# … edit, commit, run the local gate, push, open PR, squash-merge …
# 3. ALWAYS release when you've pushed and you're done:
ro worktree release
acquire locks the first free slot: main (the primary checkout) if free,
else an existing Greek worktree (<repo>-beta, -gamma, …), else it creates the
next Greek one off origin/main. release (run from inside the slot, or pass the
slot name) frees it and marks pushed: true.
Releasing is load-bearing. If you don't release, the slot stays busy and the
pool fills up. The only safety net is TTL reaping (RO_WT_TTL, default 6h) via
ro worktree reap — don't rely on it.
<main-checkout>/.ro/worktree-locks.json (gitignored; ro adds
.ro/ to .gitignore automatically).RO_AGENT=<name> so ro worktree status shows who holds what.ro worktree status prints the whole pool; ro worktree reap frees stale slots./ro:planner-worker, /ro:night-shift, /ro:swarm)
touching a shared repo.There are two populations of stale worktrees, and they need different handling:
<repo>-beta/-gamma worktrees that an
agent acquired but never released). Freed by the existing TTL reaper:
ro worktree reap # frees pool slots past RO_WT_TTL (default 6h)
.claude/worktrees/agent-*, .swarm/worktrees/*, ns/* worktrees, etc. These
are NOT pool slots, so ro worktree reap never touches them, and they pile up
(a 2026-06-14 sweep found ~65 across factory/adhd-helper/dataforce/nutmeg). Reap
the COMPLETED ones with the bundled script:
python3 "$(dirname "$0")/scripts/reap-orphans.py" --dry-run # current repo, preview
python3 "$(dirname "$0")/scripts/reap-orphans.py" # current repo, remove
python3 "$(dirname "$0")/scripts/reap-orphans.py" --all # scan ~/Dev for all repos
A worktree is removed ONLY if all three hold: clean working tree, nothing
unpushed (@{u}..HEAD is empty), AND its remote branch is gone. The
remote-branch-gone test is the load-bearing one: every repo here squash-merges, so
a merged branch does NOT look merged by commit ancestry (git branch --merged is
useless), but a branch that was deleted on merge (standard squash + --delete-branch)
is a true "purpose complete" signal. Anything dirty, unpushed, or whose remote
branch still exists is KEPT and reported (it is real or in-flight work, never
silently deleted). Agent/tooling state (.swarm/, .nightshift/, .ralph/,
.claude/RESUME.md) is excluded from the dirty check so it never blocks a reap.
reap is the safety-net sweep. The primary mechanism is that a worker removes its
OWN worktree the moment it merges — one git worktree remove in the worker/merger
Definition of Done in /ro:planner-worker and /ro:night-shift. Orphans only
exist because a run crashed, was capped, or skipped that step.
Worktrees are local to this machine, so a cloud /schedule cron CANNOT reap them.
Run reap-orphans.py --all locally instead, via either:
/ro:day-shift (recommended): the morning routine runs locally and already
opens the day, so it reaps completed orphans as its first step.launchd weekly job, or a SessionStart hook for the eager option.testing
--- name: linear-pipeline description: The Fable orchestrator for a single dispatched Linear ticket. Holds almost no context itself; it receives `--issue <ID> --detached`, decides the stage sequence, and fans out a sub-agent per stage, passing forward only each stage's artifact (never re-derived, never inlined into its own context). Step zero, before any planning or stage routing, is a boundary triage against `canon/security-boundary.md` (#199): a match tags Ronan Connolly and stops the run, no
development
--- name: in-your-face description: Capture a chat-only answer into a durable artifact (markdown + HTML, PDF when cheap) and launch it automatically so the user cannot miss it. Use when user says "in your face", "don't let me lose this", "save that answer", "make that durable", or right after answering a substantive side question (a recipe, comparison, how-to, or generated prompt) that would otherwise die with the context. category: workflow argument-hint: [--no-open] [--vault <short>] [hint of
tools
One-shot headless OpenAI Codex CLI calls for background/admin AI tasks — summaries, classification, extraction, admin glue. The default engine for anything that runs AI constantly in the background (daemon-driven, per-event), because it bills the flat ChatGPT subscription instead of Claude usage or per-token API spend, and it keeps working while Claude is rate-limited. NEVER for coding — coding stays Claude. Use when a skill or daemon needs a cheap always-on AI call, when the user says "use codex", "ask codex", "codex as backup", or when building a background summarizer/classifier into a listener or loop. Reads auth from ~/.codex/auth.json (ChatGPT account, no API key).
research
Turn a warranty rejection, repair quote, or RMA email into a cited decision brief — legal read (NL/EU consumer law), is the part user-serviceable, live part and new-unit prices, repair-vs-DIY-vs-new economics, before-you-send-it checklist, deadlines. Use when the user pastes or screenshots a repair quote, warranty rejection, "not covered" email, onderzoekskosten fee, or asks "should I repair or replace this".