/agent-skills:orchestrate-buildfrom agent-skills
Drives a decomposed spec to completion by executing each ticket in a fresh context via implement-spec, updating a durable ledger, and performing capstone verification. Pairs with decompose-spec for multi-session builds.
Ships in agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Drive a decomposed spec to completion across fresh contexts — one ticket at a time, each executed
end-to-end by implement-spec, with a durable ledger as the only cross-session memory — reporting progress and
pausing for intervention, and finishing with a whole-build capstone. This is the execution half of a
multi-session build; decompose-spec produced the plan, implement-spec is the per-ticket worker.
The mental model. Three roles, cleanly separated. State lives on disk (the ledger). Cognition lives in fresh, disposable contexts (each ticket, the capstone). Sequencing is a dumb loop that reads the ledger, dispatches the next unit to a fresh context, and writes the ledger back. Because sequencing holds no state and cognition is always fresh, nothing accumulates context across the build — the thing that rots long autonomous runs is designed out, not merely managed.
A fresh context can only be created from outside the context being refreshed — no prose can make a running context clean itself. So "run the next ticket fresh" always binds to one of four external initiators, and this skill degrades gracefully down that ladder to whatever your harness offers (see Dispatch below):
drive-build.sh),The spine of this skill — the ledger, the loop, the capstone — is harness-agnostic prose that even a human with a terminal can execute. Only the dispatch step binds to harness capability.
ledger was given, read it. If only spec was given, invoke the decompose-spec
skill (skills/decompose-spec/SKILL.md) first, then use the ledger it seeds.buildWorktree is set in the ledger, confirm cwd is it
(git rev-parse --show-toplevel); if not, and you are the orchestrator process, cd there — a command run in
the wrong worktree corrupts the wrong branch.bash <skills>/build-memory/scripts/memory-root.sh "$buildWorktree"
prints mode=<committed|scratch> and root=<abs path>. In committed mode the ledger is
<root>/LEDGER.md, committed and travelling with the chain tip (a sibling worktree reads its own tip, not the
main worktree's copy); in scratch mode it is the legacy gitignored ledger, unchanged.
Monorepo subproject (BM-ROOT-03). When the build memory lives under <sub>/docs/build, the operator sets
BUILD_MEMORY_ROOT=<sub>/docs/build (relative to the toplevel) in the harness's persistent env; every
docs/build/…, docs/tickets/…, docs/adr/… path in this skill then means <root>/…, <root>/../tickets/…,
<root>/../adr/…. Assert it before dispatch: memory-root.sh must print mode=committed and the expected
root= — a non-zero exit (unset with subproject memory present → 3; a missing dir → 2) is a stop, never a
reason to fall back to scratch. drive-build.sh exports the variable to every unit it starts (from the
ledger's position); a subagent or manual session must inherit it from the harness env.LEDGER.md, DEFERRALS.md or BUILD_INDEX.md
whole: read the ledger head (sed -n '1,/^## OPEN FINDINGS/p', ≤ 12 KiB), the current RETURN PASS table, the
last three PHASE LOG entries and the next row's manifest line + contract header (≤ 48 KiB in all), or the
recipe the ledger's OPERATING MODE gives. A head over budget, a path in it that does not exist, or a stale
token is a finding to surface before dispatch (the validator reports all three).CURRENT STATE → nextTicket, lastCompleted, blockedOn, pauseRequested, returnPass,
manifest, memoryRoot, chainTip, autonomy, harness. The manifest: key names the plan (docs/tickets/00_MANIFEST.md);
the tickets themselves are the contracts the worker loads.
manifest: absent): drive it from its own PHASE PLAN. On
nextTicket: CAPSTONE, run decompose-spec mode=extend tail=full to convert it to v2 (write the manifest
if missing, append the standard tail rows) and continue — unless legacy_capstone=true, which runs the
one-context procedure retained verbatim in modes/legacy-capstone.md (BM-COMPAT-03).projectStatus: DONE → print the completion summary (every ticket PR + the tail PRs) and STOP.blockedOn non-empty → surface it, ask how to proceed, STOP. Never guess past a block. (A pending gate
is NOT a block — it is a RETURN PASS row; §2.1.) A blockedOn: CI … clears only when ci-boundary.sh
reads pass; record the clear as a PHASE LOG repair entry naming the fixing PR.pauseRequested: true → report where the build stands and STOP (the human asked to intervene).nextTicket: SETUP → §1. Otherwise → §2 (the tail rows CAP.*, REC.*, DOC.* are ordinary chain
tickets; there is no special CAPSTONE unit in v2 — see §3).dispatch (or auto-detect: headless if a supported agent CLI is on
PATH, else subagent if the harness exposes one, else manual).<harness>/<model-id>/<tier> (e.g.
devin-desktop/swe-2-high/manual) into CURRENT STATE harness: and into every run-ledger header, PHASE LOG
entry and BUILD_INDEX row this session writes; commits carry the harness's co-author trailer. If harness:
already names a different harness or model, this session is a harness switch: allowed only at a ticket
boundary, recorded as a PHASE LOG harness-switch entry (old → new, reason, the operator's words verbatim),
and the first ticket after it re-runs orient, the validator and the CI read before dispatch. A switch the
operator did not ask for → pause and ask.dispatchTarget: the tier and the worker= the
tickets were sized for (decompose-spec's baseline is claude-code/claude-opus-5-5[1m]/high, Opus 5.5 with
the 1M window; assumed means the operator never confirmed it). Compare it with the worker you can actually
dispatch. Window: a worker with a smaller context window than the recorded one (another model, or
CLAUDE_CODE_DISABLE_1M_CONTEXT=1) may overflow tickets sized for the larger one. Compaction: headless and
manual workers compact, and so do Claude Code sub-agents (they auto-compact, and nest three levels below the
main session by default — CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH); a sub-agent on a harness whose sub-agents
can't compact has a hard one-window ceiling. On a mismatch, warn and let the operator decide: dispatch the
recorded worker, or re-run decompose-spec with the worker / dispatch_target you have. A bare tier with no
worker= is an older ledger, sized under that tier's old rules (subagent = one conservative window).nextTicket: SETUP)Run the ledger's SETUP checklist. Resolve and record the runtime parameters the ledger left as placeholders:
export BUILD_WORKTREE="${build_worktree:-$(git rev-parse --show-toplevel)-${build_name}}"
# Resolve the repo's default branch robustly (not every repo uses origin/main).
DEFAULT_REF="$(git symbolic-ref -q --short refs/remotes/origin/HEAD 2>/dev/null || echo origin/main)"
export PINNED_BASE_SHA="${pinned_base_sha:-$(git rev-parse "$DEFAULT_REF")}"
export BUILD_BRANCH_BASE="$(whoami)/${build_name}"
git worktree add -b "$BUILD_BRANCH_BASE" "$BUILD_WORKTREE" "$PINNED_BASE_SHA"
Then: run the repo's baseline build/test to confirm the pinned base is green (pre-existing breakage discovered
mid-build gets misattributed to a ticket — find it now); stand up the benchmark fixture if any ticket is
agentic, using the ledger's safe-creation recipe (call out any irreversible-pollution hazard). Finally set
chainTip = BUILD_BRANCH_BASE, pinnedBaseSha, buildWorktree, buildBranchBase, autonomy, nextTicket
= the first chain row, projectStatus=IN_PROGRESS; append a "SETUP done" PHASE LOG entry; write the ledger back.
Committed mode: resolve the root with memory-root.sh (§0); the seeded docs/build/**, docs/tickets/**
and docs/adr/** that decompose-spec/build-memory init wrote are part of the tree — commit them on the base
branch as the build's first commit, and run bash <skills>/build-memory/scripts/check-build-memory.sh .
(a failure here is a real block). In scratch mode the ledger stays gitignored, unchanged.
Await operator go-ahead before creating the worktree/fixtures unless autonomy=auto. SETUP is a pause point
in checkpoint and manual.
Who runs the loop vs. who runs a unit. Sequencing (read ledger → run next unit → write ledger → repeat) and executing one unit are separate jobs. Under
headlessdispatch the sequencing is an external process (scripts/drive-build.sh), and each fresh agent process — including the one now reading this skill — runs exactly one unit and exits; the loop, not the agent, advances to the next. Undersubagentormanualdispatch a single orchestrator session performs the sequencing itself. Either way, one ticket = one fresh context.
For nextTicket = T#:
Read the ticket's contract and cited §§ from the ledger, and confirm its forks-from dependency has landed. If a
dependency is missing, record the gap and STOP. Re-run §2.3 step 4 for the previous ticket's PR before
dispatching: its closeout commit re-triggered CI, so the head the next ticket stacks on is only known green now.
Print a situation report: the ticket, its branch, its forks-from base, the exact scope (spec §§ +
contract), the verify target, whether acceptance is deterministic or agentic, and the CI read. Then gate per
autonomy (auto: proceed; checkpoint: proceed unless this is a configured Nth-ticket pause; manual: await
go-ahead).
Ticket gate protocol (BM-GATE-01/02). If the ticket's Gate status block has unticked items, pause —
in every autonomy mode. (In auto, an item proceeds without a pause only when a live pre-authorization row
names its id, and you act on that row's words; human, rights, counsel, publication and acceptance items always
pause.) Present the block, record each answer under the gate-record rules below
(| date | ticket | gate | item | answer | consequence | kind | — secrets never; provided: yes/no only),
commit LEDGER.md on the chain tip, and dispatch with the added prompt line: "Gate
answers are in docs/build/LEDGER.md GATE DECISIONS — copy them into the ticket's Gate status block in your
first commit and act on them." An answer of "skip" runs the ticket ungated: it does everything up to the
gate, records the gated remainder as DEFERRALS.md rows, opens its PR, and is listed in RETURN PASS
(| ticket | gates | what the operator must do | re-run line |, and in the returnPass: key) with its re-run
line. Re-running the same ticket file after the operator ticks is idempotent. A pending gate is a pause, not a
blockedOn.
Gate-record rules (BM-GATE-05…09; full text in build-memory layout.md).
answer is the operator's exact words in quotes + the date -u of receipt + the channel;
consequence is your labelled reading; kind ∈ decision | pre-authorization | confirmation | waiver |
correction; a decision is dated at or after the gate's pause.?, "I wonder", "perhaps", "maybe",
"should just", "I think … but") get the concrete decision restated with its consequences and a yes/no
question; record only the answer, as a confirmation row, and act only after it.operator-reported; it never closes a counsel obligation or fills a reviewer field.agent-drafted block with its sha256;
the operator's confirmation quotes the hash prefix. Signing appends a Signature block and changes only the
Status: line — never the guard sentence or pending text.expires: (ticket or date) and voided-by:; a new item
or a material new fact needs a new answer. Planners never pre-answer.A GATE-G<k> marker row (kind gate) is not dispatched to implement-spec: read its readout (or, when the
marker says the orchestrator authors it, draft it from the named evidence sources inside an agent-drafted block
— rule 4), present it, record the operator's disposition verbatim (PASSED / SKIPPED-BY-OPERATOR / NOT PASSABLE +
what would pass it) in GATE DECISIONS and the append-only docs/build/readouts/GATE-G<k>.md, commit on the
chain tip, then continue or stop. Never guessed past (BM-GATE-03).
implement-specHand the ticket to a fresh context via the resolved dispatch tier. In every tier the fresh context is
instructed to invoke the implement-spec skill and follow it completely (full rigor — its ledger,
self-review, gap analysis, and verification are the bar). Resolve implement-spec by its installed skill name,
or by absolute path when the worker runs in another repo's worktree (drive-build.sh passes an absolute skills
root in its prompt for exactly this reason — a repo-relative skills/… path would not resolve there). Inputs:
T# of the <build_name> build. Your CONTRACT is the per-ticket contract for
T# in the build ledger (<ledger path>) plus its cited §§. Honor the cross-cutting invariants: <list>.
Follow the repo's AGENTS.md conventions. Scope strictly to this ticket — do nothing on the out-of-scope list."
(Where the ledger's PHASE PLAN points at per-ticket contract files — decompose-spec's default projection —
pass that ticket file's path as the worker's spec instead; the file is the contract. Older ledgers may
embed contracts inline.)buildWorktree.forks-from (the chainTip for chained tickets).Branch.The dispatch tier only changes how that fresh context is created:
scripts/drive-build.sh) is what creates each fresh top-level process; you
are one such process, so run this one ticket via implement-spec in your own full window, update the
ledger, and stop — do not launch the loop or advance to another unit. (Set up the loop once, outside a
ticket, with drive-build.sh --ledger <path> --yolo. On Claude Code it runs the baseline worker,
--model 'claude-opus-5-5[1m]' --effort high, unless --model/--effort or DRIVE_BUILD_MODEL/
DRIVE_BUILD_EFFORT say otherwise; --effort-for T7,T12=xhigh raises named tickets — see Dispatch.)CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH), so implement-spec's own fresh-context review still runs inside it.
Pass the ticket's effort with the Agent tool's effort parameter. Its model option names a family alias, not
an exact model id, so pinning an exact model per ticket needs the headless tier (a sub-agent's window is its
own model's, and Opus 4.7 and later run 1M natively). Where a harness pins
nesting to 1 (CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH=1), implement-spec falls back to its on-disk review
discipline (it says so itself); where its sub-agents can't compact, the worker has one hard window (§0).orchestrate-build (drive-build.sh --print-prompt prints it after the loop's mechanical checks —
see Dispatch).Acceptance the worker must honor: deterministic tickets → the ticket's unit/integration tests green + any byte-identity/regression guard; agentic tickets → the benchmark-harness run in this worktree's own isolated slot, asserting the running binary == HEAD, repeat-scored (N≥3), against the ticket's sub-metric — never a single whole-set number, and only against safe/tagged fixtures.
In committed mode the worker closes its own ticket (implement-spec Phase 6.5, D4): on the manual floor
there is no orchestrator, which is exactly how a build ends with a ledger that never moved. So after the worker
reports a pushed PR + evidence report, confirm rather than advance:
CURRENT STATE advanced (lastCompleted = this ticket, nextTicket = the next chain row,
chainTip advanced for a chained ticket) and a fixed-shape PHASE LOG "done" entry was appended.BUILD_INDEX.md has this ticket's row, docs/build/runs/<ID>.md exists, and runs/<ID>.trace.jsonl gained
this attempt's line (BM-TRACE-01).bash <skills>/build-memory/scripts/check-build-memory.sh . exits 0, and so does its history mode over
the ticket's commits, check-build-memory.sh . --range <chainTip before the ticket>..<chainTip now>
(BM-HIST-01: protected records only gained lines, at their ends, with dates from the clock).bash <skills>/orchestrate-build/scripts/ci-boundary.sh --ledger <ledger> --ticket <ID> --stack --json <memoryRoot>/logs/ci-<ID>.json (it runs a repo hook <memoryRoot>/tools/ci_boundary.*
instead when one exists, forwarding --ledger, --interval, --max-wait/--no-wait when the hook names them). Exit 0 → its last line (ci: pass #<n>@<sha7> (…), or
ci: none-declared (locally-green)) is the ci: field of the ticket's PHASE LOG done entry and run ledger
— the worker writes it at close (implement-spec §6.5 step 0); confirm it, and add it in the reconcile below
if it is missing. Exit 3 (fail, cancelled, a required check missing), 4 (pending after the bounded wait) or
5 (CI state unreadable) → write its last line as
blockedOn: CI <fail|pending|unknown> on #<n> (<check>): <first failing line>, leave nextTicket unchanged,
STOP. A red inherited from an ancestor PR blocks too, unless GATE DECISIONS holds the operator's
verbatim waiver row naming that PR and check. A local-only result is locally-green, never "green".git fetch, then bash <skills>/orchestrate-build/scripts/external-state.sh --ledger <ledger> — it records origin/<default>'s head, whether the chain still descends from it, and names
what moved: default-advanced (informational — the chain is untouched), chain-merged(<ids>),
retargeted(#n: a → b), rebased-onto-default(<b>), default-merged-in(<b>), bot-commits(<b>: …),
unpushed(<b>), or a chain-merged-partial,
default-rewritten, foreign-commits(<b>: …), foreign-rewrite(<b>) event. Also record PRs merged since the
previous boundary (who, when) and open PRs that are not chain rows. An off-stack merge into the chain, or a
chain PR rebased or retargeted by someone else → blockedOn (the operator decides) — the script's exit 3 and
its blockedOn: external — … line.
Pre-authorized in-order operator merge. When the operator will merge the chain's bottom PRs to the default
branch themselves, bottom-up — merge commit, squash or rebase — and then rebase or merge the default branch
into the remaining chain branch, record that once as a GATE DECISIONS row — the operator's words verbatim,
BM-GATE-05/09: | <date -u> | * | external | ext:merge-in-order | "<words>" (<channel>) | <reading> · expires: <ticket id or date> · voided-by: <what voids it> | pre-authorization | — with mergePolicy: OPERATOR (or
AUTO-BOTTOM-UP). While it is live, chain-merged, retargeted (the next PR's base moved to the default
branch after its base row merged — read with gh), rebased-onto-default and default-merged-in read
external: expected — … (pre-authorized: …) (exit 0): not a blockedOn. A squash merge is recognized from
gh pr view when available, else from the squash commit's (#<PR>) subject or its patch-id; the remaining
branch may then drop the squashed row's own commits (git rebase --onto <default> <old base> <branch>).
Re-sync the build worktree's branch to the remote copy (git reset --keep origin/<b> on that branch) and
record a PHASE LOG repair — external: <events> (pre-authorized <date>) entry; chainTip names the branch,
so it follows. The rule never covers foreign-commits, foreign-rewrite, chain-merged-partial (an
out-of-order or partial merge), default-rewritten, a retarget anywhere else, or an expired or voided row.
Pre-authorized bot commits. When a tool account pushes to chain branches (a formatter, a bot that merges
the default branch in), the operator may accept it with a row naming ext:bot-commits <author-ERE>[, …]
(e.g. ext:bot-commits ci-format-bot), optionally with paths: <glob>[, …] in the consequence cell.
A matching author's commit is then bot-commits(<b>: …), expected, when it only merges the default branch
in, only changes whitespace, or only touches those paths; anything else it pushes is still
foreign-commits. No author is accepted without the row, and there is no default author list.
If any of 1–3 is missing (an older worker, a scratch-mode run, or an interruption), repair it as a PHASE LOG
repair entry that names the gap (repair — close: <which item> (<worker harness>, why)), then re-run the
validator. Never back-fill a done entry for work you did not verify, and never write a trace line on the
worker's behalf: its harness, model and usage are the worker's to record, so a missing one is named in the
repair entry and stays missing. A second close repair in the same round
sets blockedOn: worker close protocol broken (<ids>): fix the worker, not the symptom.
Never fabricate green. If the worker blocked, self-review stayed red, CI is not green, or an agentic metric
regressed: set blockedOn, record it, do NOT advance nextTicket, STOP. A pending gate is a RETURN PASS row,
not a block.decompose-spec on just this ticket's scope (same
dispatch_target and worker); write the sub-tickets as <ID>a/<ID>b files, mark the original
superseded-by-split in its manifest gate cell (keep the original file), add a ## Plan extensions line, and
append a split PHASE LOG entry.decompose-spec mode=extend scoped to the
insert (Phase 3 contract + Phase 4 fresh-context review) — never draft the next ticket ad hoc at a boundary.
Then use the next filename suffix letter (16a_…, 16b_…), add its chain-table row under the current
numbered round banner and a ## Plan extensions line, and append an inserted PHASE LOG entry. Work that
landed outside the loop (an interactive session, an off-stack PR) gets a retroactive chain row and run
ledger before anything else proceeds. Every inserted file is a
chain-table row; a file in docs/tickets/ that is neither a chain row nor a listed companion is a validator
error.## Plan extensions and the PHASE LOG). Re-run the validator after any of these.Only when §2.3 steps 1–5 hold (CI pass or none-declared), emit a one-line progress update (§4) at the
boundary, then hand off to the next unit. Who continues depends on the dispatch tier (see the §2 note): under headless you simply stop — the external loop re-reads the ledger
(honoring pauseRequested) and spawns the next fresh process; under subagent/manual you re-read
pauseRequested and, if false and autonomy permits, proceed to the next ticket in a fresh context. Either
way no human re-invocation is needed between green tickets.
When a build has more than one ticket, decompose-spec appends the tail as ordinary chain rows the loop
runs exactly like any other ticket (there is no special CAPSTONE unit): CAP.1 capstone gap analysis
(independent fresh context; the whole-build BM-VERDICT-01 verdicts — incl. MET-ENGINEERED and WAIVED — before
reading any run ledger; COVERAGE_MATRIX.csv; seam hunt), CAP.2 composed end-to-end
verification (the whole build as one unit; env-blocked runs recorded and routed, never a fabricated green),
CAP.3 closure (close routed gaps on <user>/<build>-capstone; two sums — MET-ENGINEERED never counted as
MET — and the three-part list for signature), the GATE-ACCEPT marker (the operator signs that list — run it as
a gate per §2.1), then REC.1 backlog + readiness, REC.2 spec reconciliation, REC.3 integration plan (each
invokes reconcile-build), and DOC.1/DOC.2 (invoke refresh-repo-docs / agent-docs). That is
tail=full; the default tail=minimal is CAP.1, CAP.3, GATE-ACCEPT and one DOC row. Every tail row
cites the live state it describes (BM-TAIL-04). The independence, gap-hunt, and composed-verify rigor that used
to live here now lives in those tickets' contracts (instantiated from build-memory's templates/tail/); the
loop just runs them.
Done (BM-TAIL-03). projectStatus: DONE requires every chain row landed or consciously skipped (recorded),
BUILD_INDEX.md complete, no OPEN deferral without a landing, and the GATE-ACCEPT readout signed (every
tail, minimal included). After
the last tail row lands and those hold: set projectStatus=DONE, append a "DONE" PHASE LOG entry, and print the
completion summary (every ticket + tail PR). Await operator go-ahead before mutating anything. A real
unclosed gap or a regressing composed result sets blockedOn and does NOT advance to DONE.
For a legacy ledger with nextTicket: CAPSTONE, see §0's routing and
modes/legacy-capstone.md.
T# · PR #n · CI: pass|RED|pending|locally-green · layer: <BM-STATUS-01 word> · prod touched: none|<what> · deferrals +k/−j · <date -u> · next: T#+1. The ledger is the durable progress artifact; in
headless dispatch, stream the child's output for live monitoring.bash <skills>/orchestrate-build/scripts/digest.sh --ledger <ledger> --trigger <why> --write --production "<what you read, what you found>" --spend "<figure + source | not tracked>" --usage "<runs; usage per run (median, max); cumulative; projection; usage-limit events | not measured>" and show the result. It appends
to <memoryRoot>/reports/digests/<date -u +%F>.md and reads the rest itself (harness, state, validator, the CI
of every open chain PR, merges by anyone since the last digest, the external-state verdict on the default
branch, owed human work). Never a secret value: if one
appeared in the transcript, pass --exposed yes and stop for rotation.blockedOn or pause, never proceed — when: a required check is red; production
contradicts a record; a date is not from the clock; operator words are tentative or delegate a signature; a
pre-authorized step meets a new fact; a ticket would touch production outside its contract or rewrite a
protected record; human work would be deferred a second time; the harness or model would change; a usage
limit is hit. Silence is never consent.pauseRequested: true in the ledger (honored at the next boundary), by
a configured Nth-ticket checkpoint, or by interrupting the process (state is safe on disk). Resuming is just
re-invoking orchestrate-build / re-running the loop.blockedOn, change autonomy. The
loop picks them up on the next iteration.The loop is portable; only this step is harness-specific. Bind to the best available initiator; degrade down:
| Tier | Mechanism | Harnesses | Notes |
|---|---|---|---|
| headless (recommended automation) | scripts/drive-build.sh discovers a headless agent CLI and runs a fresh process per ticket | Claude Code (claude -p), Codex (codex exec), Devin CLI (devin -p), Cursor CLI (cursor-agent -p), Gemini CLI (gemini -p), Goose (goose run) — --harness picks one | Zero orchestrator accumulation; truest fresh context; full per-ticket rigor. Scope permissions and set a per-run budget/turn cap. |
| subagent | one isolated sub-context per ticket | Claude Code (Agent tool); any harness with an isolated-subagent primitive | Simplest where available; keeps the orchestrator thin for free. Claude Code sub-agents auto-compact (soft ceiling) and take a per-call effort; elsewhere check whether they compact |
| manual (floor) | print the command; human opens a fresh session | every harness, incl. IDE-only agents (Windsurf, Cursor) and a human with a terminal | No worse than the fully-manual predecessor; still fully ledger-driven and resumable |
Model and effort for headless workers. Run the worker the tickets were sized for (§0). For claude,
drive-build.sh defaults to the baseline, --model 'claude-opus-5-5[1m]' --effort high; --model/--effort
(or DRIVE_BUILD_MODEL/DRIVE_BUILD_EFFORT, none = the CLI's own default) override it for every unit, and
--effort-for <ID>[,<ID>…]=<level> (repeatable) overrides the effort for the named tickets only, e.g. xhigh
for the ones ## Decomposition decisions flags as hardest. An --agent-cmd owns its own flags; a wrapper that
reads the ledger's nextTicket does the same job, e.g. claude -p --model 'claude-opus-5-5[1m]' --effort "$effort" --permission-mode bypassPermissions "$@" with $effort chosen from the ticket id.
A harness with no headless CLI in the discovery list (a desktop or IDE agent): use --agent-cmd if it has a
non-interactive prompt mode, otherwise the manual tier. For manual, drive-build.sh --ledger <path> --print-prompt runs the loop's mechanical checks (status enum, blockedOn, pause, the CI gate) and prints the
exact fresh-session prompt for the next unit without dispatching anything: start one new session with it,
let it run that unit and stop, then re-run --print-prompt. Never continue a finished unit's session into the
next ticket.
Usage and the trace record (BM-TRACE-01). Every worker appends one trace line per attempt at close
(implement-spec §6.5 step 3): ticket, base and head commit, harness / model / effort / dispatch tier, skills
version, wall time, tokens and compactions measured from the harness's own session store (Claude Code, Codex,
Devin CLI and Desktop; any other harness records not-measured), and how verification ended. drive-build.sh
adds the dispatcher's view for any harness: --harness claude|codex|devin|cursor|gemini|goose (with --model and
--effort mapped to each CLI's flags) runs the CLI in its structured mode where it has one (claude --output-format stream-json, codex exec --json, devin --export <atif>, cursor-agent --output-format stream-json, gemini --output-format json), measures the session that output names — or, for an --agent-cmd,
the session found in the harness's store by worktree and time window — and appends one line (harness, sessions,
wall time, exit code, tokens, compactions, cost and turns where reported) to the gitignored
<memoryRoot>/logs/drive-build/usage.jsonl, joined to the trace by dispatch_run. Each unit runs with stdin
closed, without the parent session's harness variables, and with BUILD_TRACE_DISPATCH=headless and
BUILD_TRACE_RUN=<run id>/iter-NNN; --usage-cmd plugs in a harness with no adapter, --no-usage turns it off.
These records are what a later evaluation reads — audit-build mode=evaluate strata, cost per ticket,
replaying tickets at their base commit under another configuration — instead of mining transcripts that the
harness may already have deleted.
A memory root in a monorepo subproject (BM-ROOT-03). drive-build.sh reads it from the ledger's position
(--ledger <toplevel>/<sub>/docs/build/LEDGER.md), exports BUILD_MEMORY_ROOT=<sub>/docs/build to every unit and
names it in the prompt; an operator-set value is kept. An --agent-cmd runs in that environment, so
--agent-cmd "claude -p --permission-mode acceptEdits" needs nothing extra; a wrapper that clears the environment
must pass it on (env BUILD_MEMORY_ROOT=<sub>/docs/build …). subagent and manual sessions inherit it only from
the harness's persistent env (e.g. .claude/settings.local.json "env").
Full autonomy needs some external initiator (a subagent primitive OR a headless CLI); on IDE-only agents with
neither, the honest answer is the manual floor — that is a capability limit of the harness, not a defect of the
build. Do not simulate autonomy by running every ticket in one accumulating context — that reintroduces the
context rot this whole design exists to prevent.
Permissions for unattended headless runs. Headless CLIs do not hang waiting for approval — they run
non-interactively and, by default, silently deny file writes and shell commands, so a ticket makes no
changes and the loop stops at drive-build.sh's no-progress guard. Unattended writes are therefore an explicit
opt-in: pass --yolo (which maps to each CLI's autonomy flag — claude bypass-permissions, codex
workspace-write sandbox, goose GOOSE_MODE=auto, gemini yolo-approval) or configure a tighter posture
out-of-band (a settings allowlist, a scoped --agent-cmd). This is a deliberate safety gate: an autonomous loop
that pushes PRs and touches dev stores across many tickets should require one conscious authorization, not
inherit blanket write access by accident.
parallel=false default). Parallelize only genuinely disjoint out-of-chain
work; even then, the capstone reconciles the seams.RETURN PASS row and, for drive-build.sh,
a clean exit 0 with "gate pending" — never blockedOn (which is reserved for red verification incl. CI, a
missing dependency, or infrastructure the operator refused).date -u + channel; hedged
words get a yes/no confirmation; never sign, tick or attest for the operator, even when asked; agent-drafted
text is labelled and hash-confirmed; auto never answers a human, rights, counsel, publication or acceptance
item.Production mutations: header
(scripted path, pre-state capture, rollback, verification); the worker runs it inside that ticket and records
it in the run ledger. Hosted tickets and every round tail re-read the production state they depend on
(backups, publish surface, scheduler).GATE DECISIONS, run ledgers, PR bodies and readouts record
provided: yes/no for a credential, never its value; the validator greps token shapes and fails on a hit.--yolo or an out-of-band allowlist) — never grant blanket
write/exec access to the loop by default; a missing opt-in surfaces as a no-op, not silent damage.implement-spec full rigor is the bar — this skill sequences it; it does not re-implement or relax it.decompose-spec's ledger (or calls it once up front).implement-spec inside a ticket's fresh
context; this skill never edits the tree itself except to update the build memory (committed or scratch).README.md (opens in a new tab)modes/legacy-capstone.md (opens in a new tab)scripts/ci-boundary.sh (opens in a new tab)scripts/digest.sh (opens in a new tab)scripts/drive-build.sh (opens in a new tab)scripts/external-state.sh (opens in a new tab)tests/run-tests.sh (opens in a new tab)tests/stub-agent.sh (opens in a new tab)tests/stub-gh.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (stevevitali/agent-skills) — no native marketplace selected
npx claudepluginhub p/stevevitali-agent-skills12 skills in this plugin
/address-pr-commentsWork through unresolved review comments on your PR as the author: triage every thread, implement fixes where the reviewer is right, push back with rationale where they aren't, answer questions, commit + push, and reply to every thread with what happened. Use when asked to address, respond to, or resolve PR review feedback./agent-docsCreate or converge agent documentation (AGENTS.md hierarchy) for a codebase — bootstrap mode generates docs from scratch, refresh mode detects and fixes drift/audit-buildIndependent, fresh-context critical re-review of tickets that have already landed in a multi-session build. It covers the last N tickets, every ticket since the previous audit, named tickets, or a git range. Each ticket's acceptance criteria are re-checked against the code, tests and evidence, and claims are compared with what is verified. Faked or weakened checks, cross-ticket duplication and sole-owner violations are hunted down. Every finding is verified before it is reported, and fixes are routed through the build's own repair mechanisms. It also has an evaluation mode: a pre-registered, blinded measurement study of an implementer's work, which estimates how much auditing is actually needed, where and why. Use it to keep cheaper implementation models in check with periodic review by a stronger model, and to decide on evidence how often that review should run. Read-only on the build; never fixes, merges or edits landed records./build-memoryOwns the build-memory contract that the multi-session build skills share: the committed layout under docs/build/, docs/tickets/ and docs/adr/, the templates, the validator, and legacy-scratch migration. Use it to initialise the layout in a repo (init), validate it (check), migrate a legacy gitignored scratch dir into the committed tree (migrate), or regenerate the ADR index (adr-index). Other skills cite skills/build-memory/layout.md rather than restating the layout./decompose-specTurn one large spec into an optimally-partitioned, dependency-ordered ticket plan — the fewest self-contained tickets that each fit one fresh-context implementation run — and seed a durable build ledger plus per-ticket contract files and a manifest runbook (relocatable into the repo tree via tickets_dir). The planning half of a multi-session build; pairs with orchestrate-build./implement-specSpec-driven, autonomous end-to-end: branch → plan + test matrix → implement (tests alongside) → self-review → gap-analysis vs spec → close gaps → rigorous downstream verification → PR + evidence reportOther plugins' skills for the same job