spec-driven

A specification-first development workflow that writes a SPEC.md file, has a four-person council review it, and turns its acceptance criteria into failing tests before implementation. Acceptance criteria are the concrete conditions a feature must meet.

In plain words
What is it for?
Use it with a Linear ticket or a feature description to document the problem, goal, API contract, acceptance criteria, and edge cases. It then creates language-specific failing tests from those criteria.
Why use it?
It exposes unclear goals, missing edge cases, inconsistent interfaces, and security concerns before code is written. Tests created from the specification make the intended behavior checkable during implementation.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/stoa-platform/stoa/spec-driven
Any agent
npx skills add stoa-platform/stoa --skill spec-driven
Clone the repo
git clone --depth 1 https://github.com/stoa-platform/stoa

Made for: Claude Code, Codex.

Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 571 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00025 $0.00571
Opus 5 $0.00013 $0.00285
Sonnet 5 $0.00005 $0.00114
Haiku 4.5 $0.00003 $0.00057

Measured 2d ago against content hash 9372f6d19111, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

spec-driven scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/spec-driven/SKILL.md · 65 lines

How it starts

The opening of the file, as written. The whole thing — 65 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Spec-Driven Development

CAB-2005: Formalize the spec-first pattern. Council validates the spec BEFORE code. Acceptance criteria become test cases. Tests are written BEFORE implementation.

Usage

/spec-driven CAB-XXXX
/spec-driven "feature description"

Step 1: Create Spec

  1. If a CAB-XXXX ID is given, fetch the ticket from Linear: linear.get_issue("CAB-XXXX")
  2. Copy template from .claude/templates/SPEC.md
  3. Fill in: Problem, Goal, API Contract, Acceptance Criteria, Edge Cases
  4. Write to branch root as SPEC.md

Step 2: Council on Spec (Stage 1 variant)

Run the 4-persona Council but evaluate the spec quality, not the feature itself:

  • Chucky: Are edge cases covered? Missing failure modes?
  • OSS Killer: Is the goal measurable? Will this deliver user value?
  • Archi: Is the API contract consistent with existing patterns? Breaking changes?
  • Better Call Saul: Security considerations complete? PII/GDPR noted?

Threshold: >= 7.0 to proceed. Below 7.0: revise spec first.

Step 3: Generate Failing Tests

From each acceptance criterion, generate a test:

  • Python (api): test_spec_ac1_<description>() in tests/test_spec_<ticket>.py
  • TypeScript (ui/portal): describe('spec/CAB-XXXX', () => { it('AC1: ...') }) in src/__tests__/spec/
  • Rust (gateway): fn spec_ac1_description() in inline #[cfg(test)] mod tests

All tests MUST fail (red) at this stage. If any passes, the criterion is already met or the test is wrong.

Step 4: Implement

Write code to make all tests pass. Standard Pattern 3 workflow.

Step 5: Verify

  • All spec tests green
  • No other tests broken
  • SPEC.md stays in the branch (committed with the PR) as documentation

Rules

  • Spec lives in branch root, committed in the same PR as the implementation
  • Council scores the spec, not the implementation plan
  • Every acceptance criterion = exactly one test
  • Edge cases table = additional tests (tagged @edge-case)
  • If spec changes during implementation, re-run Council
  • .spec.md = technical only. Business data → stoa-strategy (private repo)

Read the full file on GitHub · 65 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 65 lines · 25 tokens per session scan A 9372f6d19111

Subscribe to this mod's changes

spec-driven is a skill published in the GitHub repository stoa-platform/stoa (5 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 25 tokens to every session and 571 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.