Documentation Index
Fetch the complete documentation index at: https://mintlify.com/jorgeferrando/sdd-skills/llms.txt
Use this file to discover all available pages before exploring further.
/sdd-spec creates the behavior specification for a change — it describes what the system does, not how it does it. It reads the approved proposal.md, identifies the affected domain, checks whether a canonical spec already exists, and produces a focused delta spec covering only what changes. Edge cases, validation rules, and error behaviors are clarified interactively before the document is written. Use /sdd-spec after proposal.md is approved and reviewed.
Usage
Prerequisites
openspec/changes/{change-name}/proposal.mdcreated and reviewed
What it does
Read proposal and identify the domain
Reads
proposal.md to understand the problem, scope, and proposed solution. From that context, determines the domain (bounded context) affected by the change. Checks whether a canonical spec already exists at openspec/specs/{domain}/spec.md. Creates the target directory:Read existing specs
If
openspec/specs/{domain}/spec.md exists, reads it before writing anything. The change spec is a delta — it documents only what is new or different, not a full replacement of the canonical spec. This keeps each spec concise and makes merging straightforward during /sdd-archive.Clarify behavior interactively
Before writing, asks targeted questions to resolve:
- Edge cases not covered by the proposal
- Validation rules for inputs and boundaries
- Error behavior: what error code, message, or fallback applies
- Any open questions left in the proposal
AskUserQuestion for each unresolved area and waits for answers before proceeding.Write the delta spec
Creates
openspec/changes/{change-name}/specs/{domain}/spec.md with all behaviors expressed in Given/When/Then format. All content is written in English.Output
openspec/changes/{change-name}/specs/{domain}/spec.md
Given/When/Then format
Every behavior is expressed as a scenario. For example:The spec phase is where most bugs are prevented. A precise spec means fewer surprises during implementation — and fewer back-and-forth corrections after code is written. Invest time here.
Key concepts
Delta spec vs. canonical spec
Delta spec vs. canonical spec
The change spec at
openspec/changes/{change-name}/specs/{domain}/spec.md is a delta — it only documents behaviors that are new or modified by this change. The canonical spec at openspec/specs/{domain}/spec.md represents the full current state of the domain. During /sdd-archive, the delta is merged into the canonical, keeping the canonical always up to date.Behavior, not implementation
Behavior, not implementation
Specs describe observable behavior at the system boundary: inputs, outputs, errors, and rules. They do not describe classes, methods, algorithms, or database schemas. Those belong in
design.md. Keeping specs implementation-free means they stay valid across refactors.Skill metadata
| Property | Value |
|---|---|
model_hint | sonnet |
requires | openspec/changes/{change}/proposal.md |
produces | openspec/changes/{change}/specs/*/spec.md |
Next steps
With the spec approved, run/sdd-continue to advance to the design phase. /sdd-design will read both proposal.md and specs/{domain}/spec.md to produce the implementation plan.