Specs
Write persistent domain specifications from code reality. Specs describe stable system boundaries, not features or tasks.
Variables
TARGET_DOMAIN: $ARGUMENTS — optional domain or area to spec
DONE_COMMAND: /dev:done
Prerequisites
- A target domain or area is identified.
- The code for that domain exists and is readable.
Knowledge
Core Principle
Code is the source of truth for what exists; specs capture the why, boundaries, and design decisions that code alone does not explain.
Domain Naming
Use stable system boundaries, not feature names or chronology.
Spec Sizing
Follow references/spec-schema.md for the lightweight/medium/heavyweight guidance, numbered section template, status values, and index format. Every spec needs at least an overview, goals, non-goals, architecture, and code locations.
Spec Status
Use the status values from references/spec-schema.md and be honest about current implementation state.
Workflow
- If invoked by
$DONE_COMMAND, resolve the changed domain(s) from the diff and use the PRD only as intent context.
- If a spec already exists, read it and the index before updating.
- Read the code thoroughly: entry points, types, key flows, integration boundaries, error handling, and tests.
- Write or update
specs/<domain>.md using the spec schema.
- Update
specs/README.md every time a spec is created or its code location changes.
- Commit the spec changes.
Constraints
- Always read the code before writing.
- Do not spec tiny utilities or feature-only names.
- Non-goals are mandatory.
- Specs are organized by stable domain, never chronology.
- Leave the git tree clean after the commit.
Validation
specs/<domain>.md exists with at least overview, goals, non-goals, architecture, and code locations
- The spec reflects actual code, not imagination or stale PRD claims
specs/README.md includes the entry
- The domain name is stable and appropriate
git status --porcelain is clean
1---2name: specs3description: Write or update persistent domain specs from existing code. Updates `specs/<domain>.md` and `specs/README.md`. Triggers on: "dev/specs", "write spec", "update specs", "spec this"4---56# Specs78Write persistent domain specifications from code reality. Specs describe stable system boundaries, not features or tasks.910## Variables1112- `TARGET_DOMAIN`: `$ARGUMENTS` — optional domain or area to spec13- `DONE_COMMAND`: `/dev:done`1415## Prerequisites1617- A target domain or area is identified.18- The code for that domain exists and is readable.1920## Knowledge2122### Core Principle2324Code is the source of truth for what exists; specs capture the why, boundaries, and design decisions that code alone does not explain.2526### Domain Naming2728Use stable system boundaries, not feature names or chronology.2930### Spec Sizing3132Follow `references/spec-schema.md` for the lightweight/medium/heavyweight guidance, numbered section template, status values, and index format. Every spec needs at least an overview, goals, non-goals, architecture, and code locations.3334### Spec Status3536Use the status values from `references/spec-schema.md` and be honest about current implementation state.3738## Workflow39401. If invoked by `$DONE_COMMAND`, resolve the changed domain(s) from the diff and use the PRD only as intent context.412. If a spec already exists, read it and the index before updating.423. Read the code thoroughly: entry points, types, key flows, integration boundaries, error handling, and tests.434. Write or update `specs/<domain>.md` using the spec schema.445. Update `specs/README.md` every time a spec is created or its code location changes.456. Commit the spec changes.4647## Constraints4849- Always read the code before writing.50- Do not spec tiny utilities or feature-only names.51- Non-goals are mandatory.52- Specs are organized by stable domain, never chronology.53- Leave the git tree clean after the commit.5455## Validation5657- `specs/<domain>.md` exists with at least overview, goals, non-goals, architecture, and code locations58- The spec reflects actual code, not imagination or stale PRD claims59- `specs/README.md` includes the entry60- The domain name is stable and appropriate61- `git status --porcelain` is clean