validate-spec
Check a spec for completeness, internal consistency, and adherence to SDD principles.
When to use
- Before changing a spec's status from Draft → Approved
- Before changing a spec's status from Approved → Implemented
- When asked to review a spec
Checklist
Run each check and report findings. Fix issues inline if possible; flag for human review if not.
Required sections
-
Statusfield present and valid (Draft / Approved / Implemented / Deprecated) -
Whatsection present and non-empty -
Whysection present and non-empty — "Why" is never optional -
Command surface / APIsection present (or explicitly noted as N/A with justification) - Link to
.featurefile present -
.featurefile exists at the linked path
Content quality
-
Whatdescribes observable behavior, not implementation internals -
Whyexplains the problem, not just restates the What -
Design decisionssection present if any non-obvious choices were made - No placeholder text ("TBD", "TODO", "...", empty sections)
- No contradictions between sections
.feature file quality
- At least one happy-path scenario per operation in the command surface
- At least one error-case scenario per operation
- Scenarios use BDD language (Given/When/Then)
- Scenarios describe observable behavior only (no internal state references)
-
--jsonscenarios present if the command supports--json
Status consistency
- If status is
Implemented: confirm passing tests exist that correspond to the scenarios - If status is
Approved: confirm the spec has been reviewed (PR approval or recorded acknowledgment) - If status is
Draft: no implementation exists yet (or backfill is in progress)
Output
Report:
- PASS / FAIL per check
- Summary: how many checks passed, how many failed
- List of required fixes before the spec can advance to the next status