worktreelisted
Install: claude install-skill davidlee/doctrine
# Worktree
Drive the lifecycle of an isolated git worktree: detect existing isolation,
create a fork through **`doctrine worktree fork`** (the verb that adds the
worktree, provisions it, and optionally stamps the worker marker — all with
compensating rollback; the fork builds into its own in-tree `target/`), run the
spawn guards, and verify a green baseline before handing off.
**Announce at start:** "Using the worktree skill to set up an isolated workspace."
**This is a sub-skill.** `/execute` (mode=solo) invokes it for opt-in isolation;
`/dispatch-subprocess` invokes it for codex/pi workers; the `/dispatch` router
invokes the **coordination** path (`worktree coordinate`, below) for the
per-run `dispatch/<slice>` tree. (The claude *worker* arm, `/dispatch-agent`, does
**not** use `fork` — Claude default-creates the worktree and a SubagentStart hook
stamps it; see that skill.) It is not a `/route` destination — reach it through the
caller.
## Mode contract
The skill is parameterised so the funnel reuses it without inheriting solo
semantics (design §5, the OQ-1 split seam).
**Inputs:**
- `mode = solo | worker`
- `allow_work_in_place: bool` — **true only for `solo`**
- requested branch / path
- `base` — the ref the fork is created from. **`solo` defaults to `HEAD`;
`worker` REQUIRES an explicit base** (the orchestrator's coordination HEAD `B`),
because the session HEAD is **not** `B` — the orchestrator drives from the
coordination branch while the session repo may si