| name | spec-reconcile |
| description | Compare implementation with Spec Guided Dev documents and decide whether no update, cleanup, replacement, or temporary deviation is needed. |
Spec reconcile
Read:
docs/spec-guided-dev-method.md
- relevant current
.specs/NNNN.*.md documents
- related ADRs and spikes when they explain the selected approach
- related
.specs/deviations/*.md documents when current implementation state matters
- current git diff
- recent commits if needed
- relevant tests or verification output if available
Task:
Compare the implementation with the relevant specs.
Decide one of:
-
No spec update needed.
Use this when the implementation still matches current product intent and
there is no changed durable intent, decision, or investigation result.
-
Non-semantic cleanup needed.
Use this when the spec still means the same thing, but wording, structure,
terminology, or references should be improved. This case may edit the
existing document in place.
-
New spec or ADR needed because product intent changed.
Use this when requirements, product behavior, domain contracts,
architecture decisions, scope, non-goals, or durable constraints changed.
-
Temporary deviation needed.
Use this when the current implementation temporarily differs from a still
correct specification.
-
Existing deviation resolved and should be deleted.
Use this when implementation is back in sync with the related spec.
Rules:
- Do not treat implementation completion as a reason to archive a spec.
- Do not use specs as task status records.
- Do not document implementation completion in
.specs.
- If the spec or ADR still describes current product intent, leave it unchanged.
- If only execution notes changed, report that they belong in commit, PR, or issue, not
.specs.
- Do not rewrite old requirements to mean something new.
- Do not rewrite accepted ADR decisions.
- If durable product intent changed, move the old current document from
.specs/ to .specs/archive/, create a new current document in .specs/ with a new number, add Replaces: with the archived document number, do not rewrite the semantic content of the archived document, and update .specs/INDEX.md.
- Distinguish semantic changes from non-semantic cleanup.
- Existing specs may be edited in place when the cleanup only removes duplicated common behavior, adds a plain-text reference to the shared spec, and preserves feature-specific behavior.
- Do not archive and replace specs only because shared behavior was extracted.
- Do not create follow-up spec documents for product-neutral dependency updates, library API migrations, executor/source-generator style changes, or framework idiom alignment when behavior, domain contracts, and architecture decisions stay the same.
- If implementation temporarily differs from the spec, create or update a deviation under
.specs/deviations/.
- If a deviation is resolved, delete the deviation document from the current tree. Git history is enough.
- Do not create
.specs/deviations/archive/.
- If there are uncommitted changes, describe them based on the actual diff.
- If no durable intent, decision, investigation result, or temporary deviation needs to be recorded, report that no spec update is needed.
If implementation introduced reusable behavior that should be extracted into a shared spec, the extraction may be followed by cleanup edits to existing specs.
If product intent changed:
- Move the old current document from
.specs/ to .specs/archive/.
- Create a new current document in
.specs/ with a new number.
- Add
Replaces: with the archived document number.
- Do not rewrite the semantic content of the archived document.
- Update
.specs/INDEX.md.