/sdd2:specfrom sdd2
Writes, revises, reviews, and splits a design spec, the document that states what a capability must do (intent, use cases, and checkable criteria on the outcome) before or alongside its code, and derives tests from one. Use when asked to spec a feature, write, revise, or backfill the spec for X, split a spec, judge whether a spec is ready, or turn a spec into tests, even if they only say "is this spec good" or "review the spec". Not for a node of a first-generation SDD project spec under .agents/specs/ that carries a .feature suite (the sdd plugin's start-mission).
Ships in sdd2. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A design spec fixes what a capability must do, in terms an outsider can check without reading the code. It is a pair: intent (what the capability is for, argued with) and criteria (what must be true of the outcome, evaluated). Intent without criteria cannot be checked. Criteria without intent cannot be questioned when they turn out to encode the wrong goal.
This skill is spec-anchored: the spec stays and is compared against on every change. It is not scaffolding discarded after the build.
| The request | Mode |
|---|---|
| write a spec for a capability, or backfill one for existing code | Write |
| change what an existing spec says | Write, then Review the changed parts |
| split a spec that has grown past what its readers need | Write, the steps under Split a spec |
| judge a spec, or decide whether it is ready | Review |
| derive tests from a spec | Derive tests |
| a criterion whose verdict flipped on an unchanged state | Write: split its graph path, placement test first |
A criterion whose verdict flips on an unchanged state is not a function under its judge. In practice this is an eval-checked criterion of a skill-instruction use case.
Not for a node of a first-generation SDD project spec (under .agents/specs/, with a .feature suite): that is
the sdd plugin's start-mission. This skill covers the design spec only, not the functional spec beneath it.
Put one capability in one folder: README.md holds the spec, graph.md holds the decision graph when the
behavior branches. Write these sections of README.md, in order. Keep each as short as it can be.
A1.1, A1.2, ...), one row per goal. Include people affected
by the outcome who never invoke it; a missed use case usually hides there. Derive use cases from actors, never by
walking the interface.### UCn — <title> (<actor IDs>) with these labelled
bullets, in this order: Trigger, Entry node (only when graph.md exists: the graph node the trigger enters
at), Entry points (grouped by surface, the primary delivery first and named as such), Inputs, Success, and Extensions, every path from the trigger that does not reach the goal, as
UCn.m sub-bullets. A use case with no extensions says extensions: none, <why>. The use case states the goal and
result and is delivery agnostic; the delivery (a skill, a command, a library call) appears only under Entry points,
and in the criteria group for that adapter.Give every item of these lists an ID a reader can cite: N1 for a non-goal, K1 for a key term, A1 for an actor and
A1.1 for its goal, UC1 for a use case and UC1.1 for its extension, R1 for a criterion, E1 for a graph edge,
Q1 for an open question. An ID is never reused: a removed item retires its ID.
An ID labels a criterion's text; the text is the criterion. Use the ID to cite it and to name its tests. Before the spec is first ready, revise criteria freely. After that, changing a criterion's text retires its ID, gives the criterion a new one, and rechecks the tests derived from it. A key term counts as part of the text of every criterion that names it, so changing a key term changes every such criterion and retires each one's ID.
Settle one section at a time. Grill the spec with the user, one section at a time, in the order above. Each section is derived from the ones before it, so a wrong outcome or a missed actor carries into every criterion. For each section:
A change to an earlier section reopens every section after it. With no user to ask (a headless run), draft every section and put each question under Open questions; the spec is not ready until they are answered.
Split by capability, never by layer. A child spec is a capability an actor can name (what they get), such as
update or history, so the folder names say what the system does. Never split into a library spec, a CLI spec, and a
skill spec: one capability reached through three deliveries is one spec, whose use cases list the deliveries as entry
points. A layer split writes the functional spec early and scatters one outcome across files.
Size the spec by the tasks that read it. When the actors and use cases are settled, list the tasks that will read the spec: changing one behavior, deriving its tests, checking scope, a consumer checking its contract. If most of them need less than half of it, split the capability into child specs along the line those tasks share, each with its own outcome; the parent keeps the shared terms and links each child. Do not split by section type, such as a separate criteria file: every task needs a slice of every section.
Split a spec. Decide the line once the use cases are settled, and move the text once every section is agreed, so a revision never straddles files.
Adapters or the output contract), the open questions they share, References, and a table
linking each child with its use cases.graph.md.Leave out implementation design, task lists, stack choices, alternatives analysis, and whether a criterion is built yet. The gap between the criteria and the code is found by checking one against the other; the work to close it lives in the project tracker, linked by criterion ID. Link rationale (an ADR, an issue, a research topic) and do not copy it in.
Design spec versus functional spec. The design spec states outcomes: what the actor gets or can tell apart. An encoding is how an outcome is spelled or carried: names, literal values and codes, exit numbers, output fields and formats, flag syntax, message wording, the order of checks when every order gives the same kind of outcome. Encodings, internal contracts, module behavior, and scenarios belong to the lower rung: the functional spec co-located with the implementation, and the code and tests beneath it.
Notation. The design spec names no scenario form. Use cases and criteria are the contract. A use case may carry Gherkin or EARS for one scenario when it clarifies; the functional spec or test plan owns the form of the rest.
Several surfaces. When the same code is reached through several adapters (a CLI, a library, an MCP server), state
each outcome once without naming an adapter: "the reference is reported missing", not "exit 1". One criteria group,
Adapters, states what each adapter's actor needs of its form, such as each outcome told apart, distinct per cause,
and stable. The mapping from each outcome to an exit code, stream, return value, or thrown error belongs to the lower
rung, pinned by its tests. Group a use case's entry points by surface. Behavior that a skill's instructions add on top, such as a fallback or what to tell the user,
is its own use case. Its criteria are checked by an eval run of the skill, not by a deterministic test.
Decision graph. When the behavior branches, draw the decisions in graph.md, in the format of the decision graph
reference, and cite its edge IDs from the criteria. Omit it for a spec that states facts or a table.
Load the criteria reference and judge the spec against C1 to C9 in number order. A spec is ready when none of C1 to C9 fails, every check under Validate passes, and Open questions is empty.
Iterate before you present. After each judgment, fix every failing criterion in the spec yourself, then judge it again. Repeat a few times, stopping when none fails or when a round fixes nothing new. Churn signals misplacement: a criterion revised in two or more rounds goes through the placement test before it is revised again. Take only the fixes the spec and its sources settle. A fix that needs a decision the user has not made (a scope call, a rule with two reasonable readings) is not a fix: leave it, and put it under Open questions with the options and your recommendation. Keep each round a change of the spec's text only; never move the spec's scope without asking.
Then present, in one message: what you changed across the rounds, grouped by criterion; the final pass or fail of each criterion with the line that still fails it; and the open questions that need the user, each with a recommendation. A reviewer asked only to judge, not to edit (a read-only review of someone else's spec), skips the iteration and reports what is wrong and what would fix it.
Build tests from the criteria list, one test or group per criterion ID, as native, deterministic tests of the project's own test stack. Put the criterion ID in the name of its test or group. Do not write a feature file for an agent to run: an agent running prose scenarios spends tokens on every run and cannot be relied on to follow them. A criterion of a skill-instruction use case is the exception: an eval run of the skill checks it. Any other criterion that cannot become such a test fails C5; send it back to Write instead of guessing.
Lower-rung writes may add, never change. A test that pins an encoding the spec leaves open, such as the exit code for an outcome, is the build adding to the lower rung: a minor change, made freely. Changing what an existing test asserts is a breaking change: take it to the owner instead of making it.
Check the spec folder before you hand it back. A cold reader runs the same checks later against the folder and its
git history, not against your report. Each line is pass or fail; README.md and graph.md are the spec folder's.
README.md has an H1 title followed by a one-sentence outcome, then these ## sections
in this order: What, Non-goals, Key terms, Actors and goals, Use cases, Criteria, Open questions, References. A
child's README.md has an H1 title with its own outcome, a link to the parent's terms, then Use cases, Criteria,
and Open questions (grep -n '^##\? ' README.md).graph.md, starts with its ID (N, K, A, UC, R, Q, E), and no ID labels two items across the parent
and its children.git log -p shows removed from the spec labels a different item now.### UCn — <title> (<actor IDs>) heading with Trigger, Entry points, Inputs, Success, and
Extensions in that order, and its Extensions are UCn.m items or read extensions: none, <why>. When graph.md
exists, an Entry node bullet sits between Trigger and Entry points and names a node that exists in graph.md.graph.md exists, every edge ID a criterion cites exists
in it, and every outcome node in it is reached by an edge some criterion cites.grep -nEi '\b(TBD|TODO)\b|not (yet )?built' README.md graph.md finds nothing.graph.md marked open.N, A, or UC ID.git show -U0 --format= <commit> | grep -E '^[-+][^-+]' | cut -c2- | sort | uniq -u lists only the lines a split adds: each child's title and its link to the parent's terms, and the parent's
table of children..feature file was added for an agent to run.cli, lib, library, skill, mcp).references/criteria.md): C1 to C9 with their pass conditions and the failure modes they
catch. Load it for Review, and for step 2 of each section in Write.references/decision-graph.md): the shape of graph.md, its edge IDs, and the
decision table and state list that may replace it.conclusion.md.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub cyberuni/cyber-sdd --plugin sdd2