polytropos · spec-driven development · two pipelines
The usual SDD pipeline, and polytropos's
Part 1 walks through spec-driven development: the stages every spec-driven tool shares, what each one produces, and the gates between them. Part 2 walks through the same stages as polytropos runs them. Part 3 puts the usual AI pipeline beside polytropos's and compares the two.
Part 1
Spec-driven development
Spec-driven development writes down what to build, and why, before any code, and then checks the code against that spec. Every spec-driven tool walks the same stages under different names. Each stage produces an output and ends at a gate: what must be true before the next stage starts.
The stages
Stages 1 to 10 follow the lifecycle table in docs/sdd/guide.md, and stage 11 is its principle P8.
1Standing rules
Constraints every change obeys, set once for the whole project.
Outputa constitution or rules file
Gateexists before the first change
2Research
Map the problem and the existing code before deciding anything.
Outputfindings, not design
Gatethe findings are reviewed
3Specify
What to build and why, without design.
Outputthe goal, scenarios, acceptance criteria and what is out of scope
Gatea person approves it
4Clarify
Surface ambiguity while it is still cheap to fix.
Outputquestions and answers, folded back into the spec
Gateno open question would change the plan
5Plan
How to build it, with the reasons.
Outputthe architecture, the decisions and the risks
Gateconsistent with the standing rules
6Tasks
Break the plan into ordered, checkable work.
Outputa task list with the dependencies between tasks
Gateevery task traces to the plan
7Analyze
Check the spec, plan and tasks against each other before anything is built.
Outputa consistency report
Gateno contradiction or gap
8Implement
Build against the tasks, one task at a time.
Outputcode, task by task
Gateeach task verified
9Verify and converge
Prove the whole matches the spec, not just each piece.
Outputtest results and review verdicts
Gatethe spec's "done" holds
10Feedback
Learn from the run.
Outputupdated rules, and better specs next time
Gaterecorded where the next planner reads it
11Keep in sync
After the change ships, check that the spec and the code still agree.
Outputtests that tie the spec to the code, often run in CI
Gatedrift is detected, not discovered
The flow, with its gates
The same stages as a flow chart, read row by row. A diamond is a gate: yes moves the work on, and no sends it back along a dashed arrow.
Scroll sideways to see the whole chart.
Part 2
polytropos
/polytropos:architect plans a change once, on the frontier tier, and writes an execution kit: PLAN.md, TASKS.md and GUARDRAILS.md. /polytropos:execute runs the kit, sending each task to the cheapest tier that can do it and checking every result. Here are the same stages again, as polytropos runs them.
Each stage in polytropos
The numbers match Part 1. The last line of each card says where the behavior is defined.
Before the run · the architect, on the frontier tier
1Standing rules
CLAUDE.mdholds always-on invariants, many enforced by tests. The architect writes each kit'sGUARDRAILS.md, rules for that change only, and the run re-reads it from disk at every phase start.Wherethe repo's
CLAUDE.md; the kit'sGUARDRAILS.md2Research
The architect explores before planning, optionally grounded in a code graph with
bin/graph_ground.py. Ascoutrole is available.Where
skills/architect/SKILL.md3Specify
The spec half of
PLAN.md: a goal, a checkable "done", constraints and an out-of-scope fence. The architect writes nothing to disk until you approve it.Where
skills/architect/SKILL.md, Step 14Clarify
Scoping questions before the frontier run, then assumptions and open questions listed under the spec draft, for you to settle at the approval pause.
Where
skills/architect/SKILL.md, Steps 0–15Plan
The design half of
PLAN.md: decisions with rationale, risks with tripwires, and optionalautonomy:,budget:,roles:andworkflow:lines.Where
skills/architect/SKILL.md, Step 16Tasks
TASKS.md: per task an id, a pinnedmodel, a self-contained brief, acceptance, a verify command, anevidence:rule and itsdepends:.Where
skills/architect/SKILL.md, Step 2
The run · the execute loop
7Analyze
kit_contract.py graphrejects duplicate ids, unknown dependencies and cycles.analyzechecks the paths each brief names and whether each verify command can run, without running anything. Then, in an interactive run, one opus spec review looks for contradictory acceptance and uncovered goals.Where
bin/kit_contract.py;skills/execute/references/spec-review.md8Implement
Each task goes to the implementer on its pinned tier, with its brief and nothing else; the implementer stops and reports if the brief is wrong. The loop then runs the verify command itself, and a check that already passed before the work blocks the task.
Where
skills/execute/SKILL.md9Verify and converge
A fresh-context verifier re-checks each task, joined by a test-author and red-team when the kit declares them. A failure gets one retry, then a frontier consult. An opus reviewer checks each phase against
PLAN.md, and oncekit_contract.py graphreports every task done, the plan's done check runs.Where
skills/execute/SKILL.md
After the run
10Feedback
outcome:,agent:,reviewer:anddefect:lines inNOTES.md, and an acceptance record fromacceptfor each passing task.bin/routing_scorecard.pygrades the tiers, the review roles and the briefs, and the next architect reads it.Where
skills/execute/references/ledger.md11Keep in sync
kit_contract.py driftre-runs a finished kit's verify commands inside the execution boundary and reports drift, not failure. Within a kit,freshnessmarks a finished task stale when work it relied on is re-accepted, andrefreshre-verifies it. A check that starts its own sandbox reads drifted, a known limit.Where
bin/kit_contract.py
The flow in polytropos
The same flow, with the part of polytropos that does each stage named in its box. Two paths are polytropos's own: a failed task gets one retry and then a frontier consult, and a "done" that does not hold sends the work back to amend PLAN.md.
Scroll sideways to see the whole chart.
Part 3
Side by side
The left column is how most AI spec-driven tools run a change. The right column is how polytropos runs one. Both start from a written spec. The difference is in who checks the work, which model does each part, and what happens to what was learned.
Typical AI spec-driven development
The common shape of tools such as Spec Kit and Kiro, simplified. Individual tools add steps, such as clarify, analyze, checklists, hooks or converge.
- once per projectStanding rulesA constitution or rules file the agent reads as context.rules are context, not enforced; nothing fails when one is broken
- you + the agentSpecifyWhat to build and why: stories, scenarios, acceptance criteria.
- the agentPlanThe technical approach and design documents.
- the agentTasksAn ordered task list, some marked parallel.no model choice per task; one model does everything
- the same agent, same modelImplementWorks through the task list, writing code and tests.
- the same agentVerifyRuns the tests it wrote and reports the result.the builder grades its own work; Anthropic found agents "reliably skew positive" doing so
- after the changeDoneThe spec is set aside, or kept but not re-checked.drift goes unnoticed, and nothing records whether the spec itself was wrong
polytropos
/polytropos:architect writes an execution kit once; /polytropos:execute runs it. The source of each box is named in skills/architect/SKILL.md and skills/execute/SKILL.md.
- always on, plus per kitStanding rules, enforced
CLAUDE.mdinvariants backed by tests, plus the kit's ownGUARDRAILS.md, re-read from disk at every phase start.many invariants fail the test suite when broken - fable · onceSpecThe architect drafts the goal, a checkable "done", constraints and an out-of-scope fence.
- you gateApproval pauseNothing is written to disk until you approve the spec.
- fable · onceDesign and tasksDecisions with reasons, risks with tripwires, and per task a self-contained brief, acceptance, a verify command, an
evidence:rule and a pinned model.every task names its proof and its price - before any dispatchPre-run check
kit_contract.py analyzechecks paths and verify commands without running anything; then one opus spec review for contradictions and uncovered goals, skipped forworkflow: directkits. -
for each task
- haiku / sonnet / opus, as pinnedImplementerBuilds from the brief alone; stops and reports if the brief is wrong.
- the loop, not the builderVerify, red-greenThe orchestrator runs the verify command itself. A check that already passed before the work blocks the task.
- sonnet, fresh contextIndependent verifierRe-checks acceptance against the files, plus a test-author and red-team when the kit declares them.passmarked done; the outcome goes in the ledgerfailone retry with the failure; then a fable consult carrying only the evidence
- opus · each phase endPhase reviewChecks the phase against
PLAN.mdfor drift before the next phase starts. - every outcome, dispatch and reviewLedger
NOTES.mdlines that record what passed, what each reviewer found, and which briefs were wrong (defect:).acceptalso records each acceptance. - after the changeDrift check
kit_contract.py driftre-runs a finished kit's checks against today's code and reports drift, without marking anything failed. - across every kitScorecard
bin/routing_scorecard.py --historygrades the tiers, the review roles and the briefs.↺ read by the next architect before it writes the next spec
What changes
| Question | Typical AI SDD | polytropos |
|---|---|---|
| Who approves the spec? | You, usually informally | You, at an explicit pause before any design |
| Which model builds each part? | One model throughout | The frontier tier plans once; each task is pinned to the cheapest tier that can do it |
| Who decides the work is done? | The agent that built it | The loop runs the check, and a fresh-context verifier and a phase reviewer judge it |
| Can a check that proves nothing pass? | Yes | No: the red-green rule blocks a check that already passed before the work |
| What if the spec is wrong? | The agent works around it | The task stops and reports, and the defect is recorded by kind |
| Is the spec checked before spending anything? | Some tools have an analyze step | analyze and a spec review, both before the first dispatch |
| Is it re-checked after the change ships? | Rarely | drift, a re-run of a finished kit's checks inside the execution boundary |
| Does the next spec learn from this one? | No record | The scorecard's defect kinds and tier and role history feed the next architect |