Skip to content

The core four, mapped to polytropos

Note

Mirrored from docs/sdd/core-four.md — edit the source, then run python3 bin/docs_build.py build.

Standalone page

The standalone HTML version of this page is core-four.html.

Spec Kit's Specify → Plan → Tasks → Implement, and the polytropos file or command that does each job.

GitHub's Spec Kit names the spec-driven development loop as four core phases: Specify (what and why, with no technology choices), Plan (the technical approach), Tasks (the plan cut into ordered, checkable work items), and Implement (executing those items). A project constitution sits above all four. Clarification and consistency checks sit between them: in Spec Kit's methodology document as [NEEDS CLARIFICATION] markers and self-review checklists inside the templates, and in its walkthrough as optional steps. The current README also pairs Implement with a converge command, which checks progress; implement and converge repeat until converge reports Converged. The command syntax has changed across versions (/specify, then /speckit.specify, now /speckit-specify in the README), so this report names the phases, not the commands. The official github/spec-kit README is the authority on its current behavior.

polytropos runs the same loop under different names. It splits the loop across two skills and adds a fifth step that Spec Kit does not have. This report maps each phase, then names where polytropos goes further and where it does less. Every polytropos claim below names the file that makes it true. The long form of the argument is docs/SPEC-DRIVEN.md.

At a glance

Spec Kit polytropos Where it lives Who runs it
constitution the repo's CLAUDE.md invariants, plus each kit's GUARDRAILS.md the target repo; .claude/kits/<slug>/GUARDRAILS.md written by people (repo) and by the architect (kit)
Specify the spec half of PLAN.md: goal, checkable "done", constraints, out-of-scope fence, with an approval pause skills/architect/SKILL.md Steps 0–1 /polytropos:architect, frontier tier, once
clarify scoping questions before the frontier run; assumptions and open questions listed under the spec draft skills/architect/SKILL.md Steps 0–1 the architect, with the user
Plan the design half of PLAN.md: decisions with rationale, risks with tripwires, optional autonomy:, budget:, roles: and workflow: lines skills/architect/SKILL.md Step 1 the architect, after approval
Tasks TASKS.md: one block per task with a pinned model, a self-contained brief, acceptance, a verify command and evidence: skills/architect/SKILL.md Step 2; bin/kit_contract.py the architect writes it; kit_contract.py graph validates it
analyze structural graph check before the run; drift review at each phase end bin/kit_contract.py graph; the kit's reviewer agent execute
Implement per-task dispatch to the pinned tier, orchestrator-run verify, fresh-context verifier, phase reviewer, one retry, then a frontier consult skills/execute/SKILL.md; bin/claude_execute.py and its peers /polytropos:execute on cheaper tiers
converge the loop ends when bin/kit_contract.py graph reports every task done; each task already converged through its own verify, verifier and retry bin/kit_contract.py; skills/execute/SKILL.md execute
(none) Measure: a ledger in NOTES.md and a scorecard that grades the tiers, the review roles and the spec skills/execute/references/ledger.md; bin/routing_scorecard.py execute writes it; the next architect reads it

1 · Specify

Spec Kit. The specify phase captures what to build and why: user stories, scenarios, edge cases and measurable outcomes, deliberately free of implementation detail.

polytropos. PLAN.md opens with the spec, under the heading the architect skill gives it: "what and why, no design yet". It holds two sections: the goal with a "done" that is "checkable, not vibes", and the constraints with an explicit out-of-scope fence that says what executors must not do.

Then comes the approval pause. The architect drafts those two sections, shows them, and stops. It writes nothing into .claude/kits/<slug>/ until the user approves the draft in the conversation. The skill gives the reason: "A misread requirement caught here costs one exchange; caught after the kit is written, it costs the whole Fable run." The approved text is the spec. If the design later shows the spec cannot hold, the architect brings the conflict back to the user instead of quietly rewriting it. The pause is skipped only when the user explicitly says to plan straight through, and then the handoff says so.

In dispatch mode a subagent cannot ask the user anything, so the run takes two hops. The first hop explores and returns only the spec draft, the main session relays it and collects approval, and the second hop writes the kit.

The difference. Spec Kit's spec is product-shaped (stories and scenarios). polytropos's spec is change-shaped: one goal, one checkable done, and a fence. The fence matters more than it looks, because it is what the executors and reviewers enforce later.

2 · Plan

Spec Kit. The plan phase records the technical approach and checks it against the constitution, producing supporting research, data-model, contract and quickstart artifacts.

polytropos. Once the spec is approved, the rest of PLAN.md is the design:

  • Architecture and key decisions, each with rationale. The skill's reason: "the 'why' is what lets a cheaper model make consistent micro-decisions later". The rationale is written for the executors, not for the record.
  • Risks and their tripwires: what an executor should watch for, and what to do when one hits.
  • Run posture, as optional one-line dials. autonomy: (advisory or auto), budget: (caps on dispatches, escalations and consults), roles: (optional review roles beyond the standard trio, out of a fixed vocabulary of seven) and workflow: (reviewed, extended or direct).
  • Grounding: when the target repo carries a graphify-out/graph.json, the architect can ground the plan with bin/graph_ground.py. The graph is a first map, never the sole evidence for a dependency claim.

The constitution's role is split. Always-on rules live in the repo's CLAUDE.md. Rules that bind only while one kit runs live in that kit's GUARDRAILS.md, which the architect must always write. tests/test_guardrails_layout.py fails the suite for a kit that skips it.

The difference. polytropos has no separate research, data-model or quickstart files. The design and its reasons sit in PLAN.md, next to the spec they serve. There is no explicit "check the plan against the constitution" gate at planning time. The fences are enforced later, at every phase start and every review.

3 · Tasks

Spec Kit. The tasks phase breaks the plan into work items with stable ids, exact file paths, parallel markers and story labels.

polytropos. TASKS.md has one block per task, under ## Phase N headings:

  • id, title, and status (pending, in-progress, done or blocked).
  • model: the tier the task runs on. sonnet is the default, opus is for the genuinely hard tasks and haiku for trivial mechanical ones. Execute passes it as the dispatch's model, overriding the agent's own default. The field is never rewritten at run time.
  • A self-contained brief, executable "by a model with zero access to this conversation": files, conventions, exact interfaces, known gotchas, and the why.
  • Acceptance criteria, concrete and checkable.
  • A verify command: a shell command that proves the task done.
  • evidence:: red-green by default, meaning the verify must be able to fail before the work. regression or precondition mark tasks where passing beforehand is the point.
  • depends: or independent:, read by machine. Independent tasks fan out in parallel. This is Spec Kit's parallel marker as an explicit graph.

Before the first dispatch, bin/kit_contract.py graph rejects a duplicate id, an unknown or self dependency, or a cycle, and names the fix for each. Execute will not route around an invalid plan.

The kit also gets its own agents in .claude/agents/: an implementer, a read-only verifier and a read-only reviewer, each with the project's conventions written into its prompt.

The difference. A polytropos task carries its own proof (verify plus evidence) and its own price (the model pin). A Spec Kit task says what to do. A polytropos task also says how to show it was done and how much model to spend on it.

4 · Implement

Spec Kit. The implement phase executes the generated tasks, and converge checks the result; the two repeat until converge reports Converged.

polytropos. /polytropos:execute runs the kit as an orchestrator on the daily-driver tier. For each task it:

  1. Marks the task in-progress, checks the budget dial, and dispatches the brief verbatim to the implementer on the task's pinned tier.
  2. Runs the verify command itself: "the implementer's claim of success is not evidence."
  3. Sends non-trivial tasks to a fresh-context verifier that re-checks the acceptance criteria against the files, on sonnet by default and on haiku only when every check is mechanical.
  4. Enforces the red-green gate: a red-green task whose verify already passed on the pre-task tree is blocked, not done.
  5. On failure, retries once with the failure output. After a second failure it marks the task blocked and offers a frontier consult that carries only that brief, the evidence and the relevant PLAN.md excerpts.
  6. At each phase end, dispatches an opus reviewer to check the phase against PLAN.md for drift, and re-reads the fences from disk before the next phase starts.

The same kit also runs headless. bin/claude_execute.py, bin/copilot_execute.py, bin/codex_execute.py and bin/cursor_execute.py honor the same task contract and the same budget dial. They run verify commands inside bin/exec_policy.py and record every dispatch in bin/attempt_ledger.py.

The difference. Spec Kit's implement phase hands the task list to the agent. polytropos splits that agent into roles on different tiers and never takes the builder's word for it.

5 · Measure (no Spec Kit equivalent)

Every finished task, dispatch and phase review appends a machine-read line to the kit's NOTES.md: outcome:, agent:, reviewer: and defect:. The grammar is in skills/execute/references/ledger.md. python3 bin/routing_scorecard.py --history turns those lines into per-tier pass, retry, escalation and block counts across every kit, per-role findings against confirmed findings, and a tally of the kinds of brief defect found.

That last tally grades the spec. When execute confirms that a brief itself was wrong (a stale pin, a verify that could never fail, a path nobody specified, acceptance criteria that contradict each other), it records a defect: line instead of widening the task until it passes. The architect's routing guidance tells the next planner to read those kinds "as evidence about YOUR OWN briefs", and to consult --history when choosing model pins. That closes the loop: the next Specify and Plan are informed by how well the last ones held.

Where polytropos does less

  • No cross-artifact consistency pass before the run. Spec Kit's analyze step checks the artifacts against each other first. kit_contract.py graph checks only the task graph's structure. Semantic drift between PLAN.md and TASKS.md is caught by the phase reviewer, after a phase has run.
  • No product-level spec format. There are no user-story or scenario templates and no requirement ids. The spec is a goal, a done check and a fence, which suits code changes better than product features.
  • No planning-time constitution gate. Fences are enforced during execution and review, not checked against the design before tasks are written.
  • Specs per change, not per product. A kit is one change's spec. Nothing aggregates kits into a living product specification.

Where polytropos goes further

  • A cost dimension in the spec. Every task names its tier, so frontier judgment is spent once, on Specify and Plan, and execution runs cheaper. /polytropos:route estimates the cost before a run, and python3 bin/routing_scorecard.py <slug> --session <id> prices a finished kit against an all-frontier counterfactual, both from data/pricing.json.
  • Proof built into every task. Verify commands, the red-green rule and independent review are part of the task contract, not a convention.
  • The spec is graded. The defect: ledger measures the planner, not just the builders.
  • Bounded autonomy. Re-routing is advisory by default. Under autonomy: auto it moves only upward, one tier, never to the frontier. Budget caps stop a run cleanly and say so.

Run it

/polytropos:architect <task>                # Specify (approval pause), then Plan and Tasks
/polytropos:execute <slug>                  # Implement, on the pinned tiers
python3 bin/routing_scorecard.py --history  # Measure, across every kit

Sources for Spec Kit's phases: the official github/spec-kit README; the Augment Code practical guide; Perficient's core-commands guide.

Long form for polytropos: docs/SPEC-DRIVEN.md · Source: github.com/agentmc15/polytropos