← ClaudeAtlas

dispatch-agentlisted

The claude arm of `/dispatch` — spawn a worker via the `Agent` tool using the dispatch-worker subagent type with worktree isolation. Base is explicit — `dispatch arm-spawn --base B` writes the base file, then cd into the spawn dir before the Agent spawn so the WorktreeCreate hook forks at B. Worker self-commits via the gated `worker_commit` MCP tool; the orchestrator lands via `dispatch_import` → `dispatch_conclude_phase` → `dispatch_reap`. Reached only from the `/dispatch` router on a claude↔env-marker agreement; do not invoke directly.
davidlee/doctrine · ★ 1 · AI & Automation · score 69
Install: claude install-skill davidlee/doctrine
# Dispatch — claude arm Spawn a worker via the `Agent` tool. The harness-identical funnel and drive loop live in the [`/dispatch` router](../dispatch/SKILL.md) — this skill is the spawn template plus this arm's landing mechanics. ## Pre-spawn — arm the base, cd into the spawn dir The worker's worktree is created by doctrine's **WorktreeCreate hook** (`doctrine worktree create-fork`), not natively by the harness. The hook discriminates a dispatch worker **positionally**: a spawn is a dispatch worker iff the Agent payload cwd **is** the arming dir `<coord>/.doctrine/state/dispatch/spawn/`. The base it forks is **explicit** — the `base` file in that dir — never cwd HEAD. cwd is the *discriminator*, not the base source. Arming does double duty: the hook also **provisions the worker's `DispatchRecord`** — the registration `worker_commit` resolves the worker's opaque agent id against. An unarmed spawn is a benign pass-through worktree with **no record**, so its `worker_commit` refuses `unknown-agent` and it cannot land a fork commit at all. **Base-clean beat (before `arm-spawn`).** Assert the base is prove-clean — `doctrine check prove` (NON-mutating fmt-check + lint) — before arming/spawning, and on `main` before you branch the fork. A RED base is a BASE defect (operator format-and-commit / prep worktree), NEVER folded into a worker delta, NEVER auto-fixed. This is the same pre-spawn beat the funnel documents; run it once per batch. **Before every spawn (or parallel batch):*