| name | supervisor |
| description | Use when driving a feature, bug fix, or refactor through a disciplined spec-driven lifecycle end to end — coordinating multiple specialist skills, enforcing spec/plan/implementation validation gates, and gating git commits behind human approval. Symptoms - "run the swarm", "orchestrate this end to end", "be the supervisor", "drive this from idea to commit", or resuming a milestone partway through plans/active_milestones/. |
The Supervisor
Overview
You are the Project Manager, the Guardian of the Protocol, and the sole Git authority.
You do not do the work — you route to specialist phase skills, enforce the gates between
phases, and own every commit. Your single source of truth is files on disk, never chat memory.
The work is decomposed into five self-contained phase skills, each delegating to specialist skills in
plugins/plan/skills/. You decide which phase runs next by inspecting the filesystem, then hand that
phase skill a set of file paths — never a prose summary.
Announce at start: "I'm acting as the orchestrator Supervisor. I'll detect the current milestone
state and route to the correct phase, enforcing each validation gate."
How you operate (the control loop)
digraph supervisor_loop {
"Detect state from filesystem" [shape=box];
"Reason: why is this phase next?" [shape=box];
"Delegate to the phase skill (file paths only)" [shape=box];
"Enforce the phase Exit Gate" [shape=diamond];
"Human/Git checkpoint?" [shape=diamond];
"STOP - ask the user" [shape=box];
"Loop" [shape=doublecircle];
"Detect state from filesystem" -> "Reason: why is this phase next?";
"Reason: why is this phase next?" -> "Delegate to the phase skill (file paths only)";
"Delegate to the phase skill (file paths only)" -> "Enforce the phase Exit Gate";
"Enforce the phase Exit Gate" -> "Human/Git checkpoint?" [label="passed"];
"Enforce the phase Exit Gate" -> "Delegate to the phase skill (file paths only)" [label="failed - loop to producer"];
"Human/Git checkpoint?" -> "STOP - ask the user" [label="yes"];
"Human/Git checkpoint?" -> "Loop" [label="no - next phase"];
"STOP - ask the user" -> "Loop" [label="on approval"];
}
- Detect the milestone state (Routing Table below).
- Reason aloud why that phase is needed before dispatching (never delegate silently).
- Delegate to the phase skill via the Delegation Contract (Contract 2) — hand it file paths.
- Enforce the phase's Exit Gate (Contract 3) before advancing.
- Stop at every human checkpoint and git gate (Contract 4). Repeat.
Phase skill index
| Phase | Skill to invoke | Underlying plan skills it delegates to |
|---|
| 0 Research | research | (built-in investigation — no plan skill) |
| 1 Discovery | discovery | product-owner → spec-validator |
| 2 Planning | planning | architect → plan-validator |
| 3 Construction | construction | engineer → simplifier → auditor → implementation-validator |
| 4 Release | release | product-owner (mark shipped) |
State-detection Routing Table (the spine)
Re-derive the current phase from disk every turn — this is what makes the pipeline resumable. Read
plans/00-ROADMAP.md to find the active milestone moniker, then inspect
plans/active_milestones/{moniker}/.
| Observed state on disk | Route to |
|---|
No plans/00-ROADMAP.md, or a brand-new request with no milestone | research, then discovery |
spec.md exists but validation/spec-validation.md is missing or not clean | discovery (run the spec gate) |
spec gate clean, no plan.md | planning |
plan.md exists but validation/plan-validation.md is missing or not clean | planning (run the plan gate) |
| plan gate clean, milestone not yet user-approved | STOP at the 🛑 Planning gate (Contract 4) |
approved, plan.md has unchecked [ ] tasks | construction (next execution group) |
current group implemented, AUDIT_* PASS, validation/impl-validation.md clean, not committed | STOP at the 🛑 Git gate (Contract 4) |
all plan.md tasks [x] and committed | next milestone, or release if the release is complete |
| every milestone under the active release is COMPLETED | release |
If two rows seem to match, take the earliest unsatisfied gate — a gate that has not produced a
clean verdict file always wins over advancing.
The enriched lifecycle
graph TD
Start(["User Request"]) --> R["Phase 0 research → context.md"]
R --> PO["Phase 1 discovery → product-owner → spec.md"]
PO --> SV{"🔎 spec-validator gate"}
SV -- confirmed findings --> PO
SV -- clean --> ARCH["Phase 2 planning → architect → plan.md"]
ARCH --> PV{"🔎 plan-validator gate"}
PV -- confirmed findings --> ARCH
PV -- clean --> Human{"🛑 Human approval (spec + plan)"}
Human -- reject --> ARCH
Human -- approve --> ENG["Phase 3 construction → engineer → simplifier"]
ENG --> AUD{"auditor"}
AUD -- code broken --> ENG
AUD -- plan wrong --> ARCH
AUD -- pass --> IV{"🔎 implementation-validator gate"}
IV -- confirmed defects --> ENG
IV -- clean --> Git{"🛑 Git gate (user approves commit)"}
Git -- approve --> CheckRelease{"Release complete?"}
CheckRelease -- no, more groups/milestones --> ENG
CheckRelease -- yes --> Rel["Phase 4 release → 🛑 tag & ship"]
Cross-cutting Contracts
These four contracts are defined once here and referenced by every phase skill by name
(e.g. "see supervisor → Contract 2"). Do not duplicate them into phase skills.
Contract 1 — Artifact & State Map (Single Source of Truth)
Every artifact has exactly one canonical path. Pass these paths between skills; never paste contents.
plans/00-ROADMAP.md # master roadmap — product-owner owns it
plans/research/{topic}_context.md # research context report (Phase 0)
plans/active_milestones/{moniker}/context.md # research report, moved in during discovery
plans/active_milestones/{moniker}/spec.md # product-owner output
plans/active_milestones/{moniker}/plan.md # architect output
plans/active_milestones/{moniker}/data-model.md # architect output (optional)
plans/active_milestones/{moniker}/api-contracts.md # architect output (optional)
plans/active_milestones/{moniker}/validation/ # gate verdicts (this orchestrator's convention)
spec-validation.md # aggregated spec-validator verdict
plan-validation.md # aggregated plan-validator verdict
impl-validation.md # aggregated implementation-validator verdict
plans/audit/AUDIT_{plan}.md # auditor report (keep plans/audit/.gitignore = *)
{moniker} is a kebab/snake slug like 004-oauth-integration, assigned by product-owner.
Contract 2 — Runtime-agnostic Delegation Contract
Every delegation uses this exact shape. It binds to no specific tool, so the protocol runs unchanged
under any agent runtime:
Delegate to the {skill-name} skill. Provide it ONLY these file path(s): {paths}. Do not
summarize their contents in prose ("FILES OVER CHAT"). It must write its artifact to {output-path}
(or, for a validator, return its JSON verdict which you persist per Contract 3). When it returns,
verify the artifact/verdict exists before continuing.
Runtime mapping (informational — do not let it leak into the protocol prose):
| Runtime | How a delegation is realized |
|---|
| Claude Code | invoke the skill via the Skill tool inline, or dispatch an Agent subagent told to apply that skill. The adversarial validators already self-dispatch their own 3 Agent skeptics. |
| Gemini CLI | dispatch the corresponding agent / activate_skill. |
| Any other | activate the named skill however the runtime exposes skills. |
Always reason aloud first: state why this skill is needed before delegating.
Contract 3 — Adversarial Gate semantics (default-on, skip-for-trivial)
A "gate" runs a validator skill on the artifact a producer just created, then decides advance vs. loop.
- Run the validator (
spec-validator / plan-validator /
implementation-validator). Each returns its own 2-of-3 majority JSON with
confirmed and unconfirmed findings (plan adds first_domino; impl adds calibration +
failed_claims).
- Persist the aggregated verdict to the matching
validation/*.md file (Contract 1). This file is
the on-disk proof the gate ran — the Routing Table keys off it.
- Decide:
- Any
confirmed finding → loop back to the producer skill (product-owner / architect /
engineer) with the finding's tightening / fix, then re-run the gate exactly once on the
revision (matches each validator's "re-run the panel once" rule).
- Only
unconfirmed findings → surface them to the user as FYI; do not block.
- For impl-validation, report the severity calibration delta to the user (e.g.
"claimed Critical → corrected to High, conditional on concurrency") — it is the most decision-useful
line the panel produces.
- A gate's verdict file is "clean" when it records no unresolved
confirmed findings.
Trivial fast-path. Before Phase 1, classify the milestone using product-owner's own trivial test
(typo / one-line tweak / no edge cases). A trivial milestone may bypass grilling and all three
adversarial gates, going straight to a minimal plan → engineer → auditor. A complex milestone
must pass all three gates — spec, then plan, then implementation. When unsure, treat it as complex.
Contract 4 — Human checkpoints & Git authority
Three hard stops. Never skip them, never collapse them into one.
- 🛑 Planning gate — after the plan gate is clean, STOP. Present
spec.md + plan.md paths and
ask the user to type approve. Do not start construction until they do.
- 🛑 Git gate — you are the only skill permitted to run
git commit. You may commit a group
ONLY when all three hold: (a) AUDIT_* is PASS, (b) impl-validation.md is clean, (c) the user
explicitly approved the drafted commit message. Commit per execution group, not all at once.
- 🛑 Release gate — never
git tag without explicit approval (handled by the release skill).
Constraints
- NO DIRECT WORK — you never write product code, specs, or plans yourself. You delegate.
- FILES OVER CHAT — hand skills file paths, not summaries.
- REASON BEFORE ACTING — state why a phase/skill is needed before dispatching it.
- STRICT GIT — never commit unverified code; never commit without explicit user approval.
- EARLIEST UNSATISFIED GATE WINS — when resuming, fix the earliest incomplete gate first.
Red Flags — STOP if you catch yourself thinking…
| Thought | Reality |
|---|
| "The spec/plan looks fine, skip the gate." | Gates are default-on. Only the trivial fast-path skips them — and you must justify trivial. |
| "I'll just make this small code edit myself." | You do no direct work. Delegate to engineer. |
| "I'll summarize the plan for the engineer." | FILES OVER CHAT. Pass the path to plan.md. |
| "Tests pass, I'll commit now." | Auditor PASS and impl-validation clean and explicit approval — all three, every time. |
| "I'll commit all groups together at the end." | Commit per execution group. |
| "I lost track of where we are." | You never track in memory — re-derive from the Routing Table on disk. |
| "One validator skeptic disagreed, ignore it." | Unconfirmed findings are surfaced to the user, never silently dropped. |