Execute the autopilot-director Spec run below.
What this skill does
A Spec run completes one spec issue and its child tickets as a single Spec
PR. The Director (you, running on the main effective model) dispatches a
Worker subagent per ticket for code development, re-verifies every claim
with code-run gates, and advances a ticket only when a Two-axis gate
(Standards + Spec, run by fresh reviewers) reaches absolute zero. Every
state transition is owned by the director CLI — a change you cannot record
through the CLI did not happen.
One run lands exactly one PR; each ticket contributes exactly one Ticket
boundary commit. The vocabulary this file uses is defined in CONTEXT.md
("Autopilot Director"); the decisions behind it are ADR 0046 (role-pinned
models), ADR 0047 (one Spec PR, one commit per ticket) and ADR 0048 (two-axis
gate, absolute-zero bar, escalation).
Parameters
| parameter |
default |
meaning |
| spec issue |
required |
the spec issue number to complete |
| worker model |
deepseek-flash |
the Role-pinned model the Worker is dispatched on; pin it at dispatch time, never in a committed agent definition |
| auto-merge |
off |
off means: open the Spec PR and stop for human approval. On means: merge once CI is green and both gates are at zero |
| worktree |
current checkout |
the target worktree; run state lives in its .director/ (project-local, worktree-local, git-ignored) |
Preconditions
- The
director CLI is available. When the toolkit is installed, read
~/.agents/skills/.autopilot/director.env if it exists and use
AUTOPILOT_DIRECTOR_BIN as the executable path; otherwise use the stable
~/.agents/skills/.autopilot/bin/director. In a source checkout, build it
with cargo build --release -p director-cli. Verify with director --help.
gh is authenticated for the repository that hosts the spec.
- You are in the target worktree, and
/.director/ is git-ignored (the CLI
establishes the rule or refuses — never override it).
Roles
- Director — the main effective model. Dispatches Workers, runs the repo's
test gates itself, adjudicates findings, squashes boundary commits, opens the
Spec PR. Never pinned to a fast model.
- Worker — one per ticket, dispatched on the Role-pinned fast model, bound
by
references/worker-contract.md and the upstream tdd skill. Its own
reports are never gate evidence.
- Reviewers — fresh effective-model agents, one per axis, one per round.
They never see Worker context and never review their own round.
The loop
1. Read the spec
gh issue view <spec> --json number,title,body and list its children
(gh issue list --state open --json number,title,body — children name the spec
in a Parent section). Build the task graph from the Blocked by sections:
that graph, not ticket order, defines the frontier. v1 runs tickets serially.
2. Open or resume the run
- Fresh:
director init --worktree <wt> --spec-issue <N> --slug <slug> where
<slug> is the title-derived slug of the spec branch
(codex/spec-<N>-<slug>). Then
director run transition --worktree <wt> --to running.
- Resuming:
director resume --worktree <wt>. A drift error is a hard stop:
inspect what moved and re-run with --accept-drift only after a human agrees,
or abandon and report.
- Register every child ticket once:
director ticket add --worktree <wt> --ticket <n> --title <title> [--blocked-by <m>]....
3. Per-ticket loop
For the next ticket on the frontier:
director ticket transition --ticket <n> --to implementing.
director dispatch begin --ticket <n> --worker <label> (the attempt is
recorded before the Worker exists).
- Dispatch the Worker on the pinned model with: the ticket issue reference,
the worktree and branch, the ticket's
Seam: annotation or a
Seam(inferred) you supply, and — on a fix round — the findings to resolve.
The Worker reads references/worker-contract.md, follows tdd, and returns
a WORKER_REPORT: envelope.
- Validate the envelope:
director report validate --ticket <n> (stdin) or
--file <path>. Then
director dispatch finish --ticket <n> --outcome ok|failed [--reason <text>].
A malformed envelope or a blocked report is a failed dispatch; the state
machine allows exactly one same-Worker retry and then escalates by itself.
- Run the repo's test gates yourself (
cargo test, the suite the ticket
names). Worker self-reports are not evidence. Failing gates send the same
Worker back to work: --to implementing.
director ticket transition --ticket <n> --to gating, then run the review
rounds below.
4. Two-axis gate (per ticket, then once for the spec)
Flattened dispatch — spawn the two axis reviewers directly; do not invoke the
code-review skill as a nested layer:
director round open (--ticket <n> | --spec).
- Spawn a Standards reviewer and a Spec reviewer, each fresh, each with
the full axis prompt of the upstream
code-review process: the smell
baseline pasted in full, the standards sources listed, the spec content
quoted. Reviewers never see the Worker's context or each other's findings.
- The Standards axis also carries this repo's two review rules: for every guard
or predicate the diff adds or changes, the reviewer names its single
implementation and confirms the contract's boundary state (unset, open,
empty, zero) has a test at the decision point; and for every rename, that the
same diff moved every usage string, help text, doc comment and inventory
count that names it.
- Record every finding:
director finding record (--ticket <n> | --spec) --round <k> --axis <standards|spec> --id <id> --hash <hash> --summary <text>.
director round close (--ticket <n> | --spec) --round <k>.
- Adjudicate to absolute zero: each finding is either fixed by the Worker or
rejected by you with a written reason —
director finding dispose ... --fixed <commit> or
director finding dispose ... --rejected "<reason>".
director gate --ticket <n> (ticket layer) and director gate (spec layer —
the layer is the no-flag form; gate does not take --spec) must exit 0
(zero) before you advance. If findings remain, transition the ticket
--to fixing, hand the findings to the same Worker, and open the next round.
The cap is three rounds per layer and it is enforced in code: a fourth
round open refuses and moves the layer to escalated.
5. Ticket boundary commit
Once the ticket's gate is at zero: squash its work-in-progress commits into one
commit whose message references the ticket (feat: <title> (ticket #N)), then
director ticket transition --ticket <n> --to done (refused while the gate is
open). Start the next frontier ticket.
6. Aggregate spec gate and the Spec PR
- When every ticket is
done:
director run transition --to spec-gating.
- Run the same two-axis gate over the aggregate diff (
--spec), with the same
absolute-zero bar and round cap.
- Push the branch only now, open the single Spec PR whose body lists every
ticket with
Closes #…, then director run transition --to pr-open.
- Default (auto-merge off): stop and hand the PR to the human for approval.
With auto-merge on: wait for CI green plus
director gate at zero, merge
with a merge commit (squash-merge is forbidden — it would flatten the
boundary commits), then director run transition --to done.
- Verify each ticket issue closed, then report.
Escalation
An escalation is not a failure you may retry your way out of. When a layer
escalates (round cap exhausted, dispatch budget exhausted, or an unparseable
report twice), stop the run and report:
- the finding evolution across rounds (what each round found, what was fixed,
what you rejected and why),
- the Worker's self-reports,
- your diagnosis and the decision you need (grant more rounds, implement
directly, or abandon the ticket).
The run resumes only on an explicit human decision, recorded by the allowed
transition (escalated → reviewing buys another cap's worth of rounds;
escalated → implementing means you implement it directly).
Boundaries
- One Spec PR per run; never per-ticket PRs.
- Never merge, label, or close anything the CLI did not first make legal, and
never claim a gate passed on prose evidence.
- Do not modify
autopilot-orchestrator or autopilot-reviewer; the two
workflows are meant to be comparable side by side.
- Workers never review; reviewers never implement; the Director never
delegates a judgment it can check itself.
1---2name: autopilot-director3description: Complete one whole spec as a single PR: a Director drives child tickets through code-run gates and a two-axis review gate, delegating code development to a role-pinned fast-model Worker. State transitions are owned by the director CLI. Use when the user asks to run a spec end to end.4---56Execute the autopilot-director Spec run below.78## What this skill does910A **Spec run** completes one spec issue and its child tickets as a single Spec11PR. The Director (you, running on the main effective model) dispatches a12**Worker** subagent per ticket for code development, re-verifies every claim13with code-run gates, and advances a ticket only when a **Two-axis gate**14(Standards + Spec, run by fresh reviewers) reaches **absolute zero**. Every15state transition is owned by the `director` CLI — a change you cannot record16through the CLI did not happen.1718One run lands exactly one PR; each ticket contributes exactly one Ticket19boundary commit. The vocabulary this file uses is defined in `CONTEXT.md`20("Autopilot Director"); the decisions behind it are ADR 0046 (role-pinned21models), ADR 0047 (one Spec PR, one commit per ticket) and ADR 0048 (two-axis22gate, absolute-zero bar, escalation).2324## Parameters2526| parameter | default | meaning |27| --- | --- | --- |28| spec issue | required | the spec issue number to complete |29| worker model | `deepseek-flash` | the Role-pinned model the Worker is dispatched on; pin it at dispatch time, never in a committed agent definition |30| auto-merge | off | off means: open the Spec PR and stop for human approval. On means: merge once CI is green and both gates are at zero |31| worktree | current checkout | the target worktree; run state lives in its `.director/` (project-local, worktree-local, git-ignored) |3233## Preconditions34351. The `director` CLI is available. When the toolkit is installed, read36 `~/.agents/skills/.autopilot/director.env` if it exists and use37 `AUTOPILOT_DIRECTOR_BIN` as the executable path; otherwise use the stable38 `~/.agents/skills/.autopilot/bin/director`. In a source checkout, build it39 with `cargo build --release -p director-cli`. Verify with `director --help`.402. `gh` is authenticated for the repository that hosts the spec.413. You are in the target worktree, and `/.director/` is git-ignored (the CLI42 establishes the rule or refuses — never override it).4344## Roles4546- **Director** — the main effective model. Dispatches Workers, runs the repo's47 test gates itself, adjudicates findings, squashes boundary commits, opens the48 Spec PR. Never pinned to a fast model.49- **Worker** — one per ticket, dispatched on the Role-pinned fast model, bound50 by `references/worker-contract.md` and the upstream `tdd` skill. Its own51 reports are never gate evidence.52- **Reviewers** — fresh effective-model agents, one per axis, one per round.53 They never see Worker context and never review their own round.5455## The loop5657### 1. Read the spec5859`gh issue view <spec> --json number,title,body` and list its children60(`gh issue list --state open --json number,title,body` — children name the spec61in a `Parent` section). Build the task graph from the `Blocked by` sections:62that graph, not ticket order, defines the frontier. v1 runs tickets serially.6364### 2. Open or resume the run6566- Fresh: `director init --worktree <wt> --spec-issue <N> --slug <slug>` where67 `<slug>` is the title-derived slug of the spec branch68 (`codex/spec-<N>-<slug>`). Then69 `director run transition --worktree <wt> --to running`.70- Resuming: `director resume --worktree <wt>`. A drift error is a hard stop:71 inspect what moved and re-run with `--accept-drift` only after a human agrees,72 or abandon and report.73- Register every child ticket once:74 `director ticket add --worktree <wt> --ticket <n> --title <title> [--blocked-by <m>]...`.7576### 3. Per-ticket loop7778For the next ticket on the frontier:79801. `director ticket transition --ticket <n> --to implementing`.812. `director dispatch begin --ticket <n> --worker <label>` (the attempt is82 recorded before the Worker exists).833. Dispatch the Worker on the pinned model with: the ticket issue reference,84 the worktree and branch, the ticket's `Seam:` annotation or a85 `Seam(inferred)` you supply, and — on a fix round — the findings to resolve.86 The Worker reads `references/worker-contract.md`, follows `tdd`, and returns87 a `WORKER_REPORT:` envelope.884. Validate the envelope: `director report validate --ticket <n>` (stdin) or89 `--file <path>`. Then90 `director dispatch finish --ticket <n> --outcome ok|failed [--reason <text>]`.91 A malformed envelope or a `blocked` report is a failed dispatch; the state92 machine allows exactly one same-Worker retry and then escalates by itself.935. Run the repo's test gates yourself (`cargo test`, the suite the ticket94 names). Worker self-reports are not evidence. Failing gates send the same95 Worker back to work: `--to implementing`.966. `director ticket transition --ticket <n> --to gating`, then run the review97 rounds below.9899### 4. Two-axis gate (per ticket, then once for the spec)100101Flattened dispatch — spawn the two axis reviewers directly; do not invoke the102`code-review` skill as a nested layer:103104- `director round open (--ticket <n> | --spec)`.105- Spawn a **Standards** reviewer and a **Spec** reviewer, each fresh, each with106 the full axis prompt of the upstream `code-review` process: the smell107 baseline pasted in full, the standards sources listed, the spec content108 quoted. Reviewers never see the Worker's context or each other's findings.109- The Standards axis also carries this repo's two review rules: for every guard110 or predicate the diff adds or changes, the reviewer names its single111 implementation and confirms the contract's boundary state (unset, open,112 empty, zero) has a test at the decision point; and for every rename, that the113 same diff moved every usage string, help text, doc comment and inventory114 count that names it.115- Record every finding:116 `director finding record (--ticket <n> | --spec) --round <k> --axis117 <standards|spec> --id <id> --hash <hash> --summary <text>`.118- `director round close (--ticket <n> | --spec) --round <k>`.119- Adjudicate to absolute zero: each finding is either fixed by the Worker or120 rejected by you with a written reason —121 `director finding dispose ... --fixed <commit>` or122 `director finding dispose ... --rejected "<reason>"`.123- `director gate --ticket <n>` (ticket layer) and `director gate` (spec layer —124 the layer is the no-flag form; `gate` does not take `--spec`) must exit 0125 (zero) before you advance. If findings remain, transition the ticket126 `--to fixing`, hand the findings to the same Worker, and open the next round.127128The cap is three rounds per layer and it is enforced in code: a fourth129`round open` refuses and moves the layer to `escalated`.130131### 5. Ticket boundary commit132133Once the ticket's gate is at zero: squash its work-in-progress commits into one134commit whose message references the ticket (`feat: <title> (ticket #N)`), then135`director ticket transition --ticket <n> --to done` (refused while the gate is136open). Start the next frontier ticket.137138### 6. Aggregate spec gate and the Spec PR1391401. When every ticket is `done`:141 `director run transition --to spec-gating`.1422. Run the same two-axis gate over the aggregate diff (`--spec`), with the same143 absolute-zero bar and round cap.1443. Push the branch only now, open the single Spec PR whose body lists every145 ticket with `Closes #…`, then `director run transition --to pr-open`.1464. Default (auto-merge off): stop and hand the PR to the human for approval.147 With auto-merge on: wait for CI green plus `director gate` at zero, merge148 with a **merge commit** (squash-merge is forbidden — it would flatten the149 boundary commits), then `director run transition --to done`.1505. Verify each ticket issue closed, then report.151152## Escalation153154An escalation is not a failure you may retry your way out of. When a layer155escalates (round cap exhausted, dispatch budget exhausted, or an unparseable156report twice), stop the run and report:1571581. the finding evolution across rounds (what each round found, what was fixed,159 what you rejected and why),1602. the Worker's self-reports,1613. your diagnosis and the decision you need (grant more rounds, implement162 directly, or abandon the ticket).163164The run resumes only on an explicit human decision, recorded by the allowed165transition (`escalated → reviewing` buys another cap's worth of rounds;166`escalated → implementing` means you implement it directly).167168## Boundaries169170- One Spec PR per run; never per-ticket PRs.171- Never merge, label, or close anything the CLI did not first make legal, and172 never claim a gate passed on prose evidence.173- Do not modify `autopilot-orchestrator` or `autopilot-reviewer`; the two174 workflows are meant to be comparable side by side.175- Workers never review; reviewers never implement; the Director never176 delegates a judgment it can check itself.