| name | spec-sync |
|---|---|
| description | Keep markdown module specs in specs/<module>/ synchronized with source code using spec-sync. Use this whenever creating, editing, or reviewing code in a module that has (or should have) a spec, or whenever the user mentions specs, spec-sync, companion files (tasks.md/requirements.md/context.md/testing.md/design.md), or asks to add/update a module's documentation. |
This project uses spec-sync for bidirectional spec-to-code validation. Specs live in specs/<module>/<module>.spec.md.
For every meaningful source, test, public documentation, schema, or configuration change:
- Run
specsync change new "<intent>" --jsonand conduct the returned interview with the user. - Use
specsync change answer <id> <question-id> <answer> --jsonuntil no questions remain. - Complete the adaptively selected artifacts and semantic deltas. Requirements use stable
REQ-<module>-<number>IDs, a normative SHALL statement, and acceptance criteria. - Ask the user for the definition approval, then run
specsync change approve <id>. - Run
specsync change start <id>before editing implementation code. - Keep tasks and artifacts current, then run
specsync change verify <id>. - Present verification evidence and ask for closing approval. Only after explicit approval,
run
specsync change accept <id>; archive separately withspecsync change archive <id>.
Never invent or self-grant either human approval. If an approved definition changes, its digest
becomes stale and must be approved again. specsync check validates canonical specs plus approved
active deltas, requirement-to-test evidence, change coverage, and CI gates.
Each canonical spec may have policy-selected companion files. Read and update the ones present; do not create empty companions only for ceremony:
tasks.mdβ Work items for this module. Check off tasks (- [x]) as you complete them. Add new tasks if you discover work needed.requirements.mdβ Acceptance criteria and user stories. These are permanent invariants, not tasks β do not check them off. Update if requirements change.context.mdβ Architectural decisions, key files, and current status. Update when you make design decisions or change what's in progress.testing.mdβ Test strategy: automated test locations, manual QA checklists, and edge cases/boundary conditions.design.md(opt-in) β Layout, component hierarchy, design tokens, and asset references. Present whencompanions.designis enabled in config.
- Read the relevant spec in
specs/<module>/<module>.spec.md - Read whichever companion files are present (
requirements.md,tasks.md,context.md,testing.md,design.md, or project-defined files) - After changes, run
specsync checkto verify specs still pass
- Mark completed items in
tasks.mdβ check off finished tasks, add new ones discovered - Update
context.mdβ record decisions made, update current status - If requirements changed, update
requirements.mdacceptance criteria - If test coverage changed, update
testing.mdwith new test files or edge cases - If UI/layout changed, update
design.mdwith revised layout, components, or tokens
Run specsync check --strict β all specs must pass with zero warnings.
Run specsync scaffold <module-name> to create a spec, companion files, a registry
entry, and auto-detected source files β or specsync new <module-name> for a
minimal spec-only draft. Complete the spec before writing code. The
/specsync:create-spec command (or tool-equivalent) runs this for you, and
accepts either a bare module name or a natural-language feature description
(e.g. /specsync:create-spec "I want a feature that lets users export their data as CSV") β pass a description and it will pick a module name and use
the description to draft the spec's Purpose and Requirements.
specsync checkβ validate all specs against source codespecsync check --jsonβ machine-readable validation outputspecsync coverageβ show which modules lack specsspecsync scoreβ quality score for each spec (0-100)specsync scaffold <name>β full scaffold: spec + companions + registry entry + source detectionspecsync new <name>β quick-create a minimal spec (add--fullfor companions)specsync resolve --remoteβ verify cross-project dependencies