dispatch-subprocesslisted
Install: claude install-skill davidlee/doctrine
# Dispatch — codex/pi arm
Spawn a worker via `doctrine worktree fork --worker` + subprocess spawn.
Drive loop lives in the [`/dispatch` router](../dispatch/SKILL.md).
## Spawn — codex arm
```sh
doctrine worktree fork --base "$B" --branch "$BR" --dir "$D" --worker \
|| { echo "fork failed: $?" >&2; exit 1; }
env -C "$D" DOCTRINE_WORKER=1 codex exec "<pre-distilled prompt>"
```
Confined (bwrap); run the fork, check `$?`, then spawn. The worker inherits the
ambient env and compiles into its own in-tree `$D/target` (no env contract).
## Spawn — pi arm (RPC mode)
```sh
doctrine worktree fork --base "$B" --branch "$BR" --dir "$D" --worker \
|| { echo "fork failed: $?" >&2; exit 1; }
cp AGENTS.md "$D/" \
|| { echo "AGENTS.md copy failed: $?" >&2; exit 1; }
PI_FIFO=$(mktemp -u) && mkfifo "$PI_FIFO"
{ printf '%s\n' \
'{"type":"set_auto_retry","enabled":false}' \
'{"type":"prompt","message":"<pre-distilled prompt>"}'
sleep 300
} > "$PI_FIFO" &
timeout 300 env -C "$D" DOCTRINE_WORKER=1 \
pi --mode rpc --thinking off --session-dir "$D/.pi-session" \
--no-extensions --no-skills --no-themes \
--offline --approve --tools read,bash,edit,write,grep,find,ls \
< "$PI_FIFO"
rm -f "$PI_FIFO"
```
Same confinement as codex arm; fifo keeps stdin open (pi RPC exits on EOF).
`sleep 300` keepalive, `agent_end` gives typed completion. Ignore
`extension_ui_request` widget events from installed packages.
## Boundary recording
At the `conclude` prescription (`doctrine dispa