docs(spec): add spec evolution guidance — V1 scoping and delta specs#383
docs(spec): add spec evolution guidance — V1 scoping and delta specs#383ayobamiseun wants to merge 2 commits into
Conversation
Answers addyosmani#150 (how to mark a V1 and work on V2 features after /ship) and the workflow half of addyosmani#180 (avoiding a single overwritten global spec.md): - Spec template gains an 'Out of Scope (Deferred)' section so V2 ideas are captured in the spec without expanding V1. - New 'Spec Evolution' section: post-ship changes get a small delta spec (own template, same gated workflow), folded back into the original spec after shipping. - /spec command (Claude + Gemini twins) no longer overwrites an existing SPEC.md for change requests; it writes SPEC-<change-slug>.md. - Two positive trigger prompts added to the eval case; description gains the evolution vocabulary. All Tier 1/2 checks pass. Closes addyosmani#150
|
I like this one a lot. V1-scoping-with-a-V2-delta is a real question people hit the moment a spec survives contact with a second feature, and answering #150 and #180 inside the spec skill itself is the right home for it rather than a separate doc. Nice that you kept the command files in parity and shipped an eval case with it, that's the bar now. Let me read the guidance end to end to make sure it doesn't bloat the spec flow, but this is on-mission and close to a yes. |
|
|
||
| Save the spec as SPEC.md in the project root and confirm with the user before proceeding. | ||
|
|
||
| If SPEC.md already exists and this request is a change to what it describes, do not overwrite it: write a delta spec (e.g. SPEC-<change-slug>.md) covering only the change, per the skill's Spec Evolution section. |
There was a problem hiding this comment.
Could we mirror this guard in commands/spec.toml too? Antigravity still instructs the agent to always overwrite SPEC.md; validate-commands does not compare prompt bodies.
There was a problem hiding this comment.
Good catch — I'd missed that commands/ is a third twin and that validate-commands only diffs presence/descriptions, not bodies. Added the same guard line to commands/spec.toml in ce60dbc.
| [Only deltas from the original spec's boundaries; everything else inherits.] | ||
| ``` | ||
|
|
||
| Save it alongside the original (e.g. `SPEC-postgres-migration.md` next to `SPEC.md`) and run it through the same gated workflow: human review, then plan, tasks, implement. Keep one change per delta spec — that keeps each plan/build cycle small and reviewable. |
There was a problem hiding this comment.
Could we align this filename with the downstream workflow? /build auto only recognizes SPEC.md, docs/SPEC.md, or files under spec/, and does not allow root-level SPEC-*.md files as uncommitted planning artifacts. It may therefore select the old spec or stop at the clean-baseline check.
There was a problem hiding this comment.
Confirmed on both counts: discovery wouldn't select a root-level delta spec, and the clean-baseline check would stop on it. Rather than move delta specs into spec/ (which would drift into #73's storage-convention territory), ce60dbc updates all three /build twins: a root-level SPEC-<change>.md is now an accepted spec path (taking precedence over SPEC.md when the run is building that follow-up change) and SPEC-*.md is included in the planning-artifact exclusions. SKILL.md now states the convention is recognized downstream.
| Once a spec has shipped, a new requirement — swapping the storage engine, replacing a manual step with OCR, promoting a deferred V2 item — gets its own small spec rather than a hand-edit of the shipped one. A delta spec covers only what changes: | ||
|
|
||
| ```markdown | ||
| # Spec Delta: [Change Name] |
There was a problem hiding this comment.
How should a delta spec satisfy the existing “covers all six core areas” verification? This template intentionally omits Commands, Project Structure, Code Style, and Testing Strategy. Could the verification distinguish full specs from delta specs and require only the affected core areas?
There was a problem hiding this comment.
Agreed, the checklist item contradicted the delta template. In ce60dbc it now distinguishes the two: full specs cover all six areas; delta specs cover only the areas the change affects (at minimum objective, success criteria, and boundary deltas) and inherit the rest from the original.
|
|
||
| A spec describes one version of the work. New ideas and post-ship changes don't expand it — they queue behind it. | ||
|
|
||
| ### Scope each version explicitly |
There was a problem hiding this comment.
Could we explicitly answer whether the spec itself should be labeled V1? The Deferred section explains how to capture the V2 backlog, but the version-labeling part of #150 remains ambiguous.
There was a problem hiding this comment.
Made it explicit in ce60dbc: the spec template title is now # Spec: [Name] — V[N], and Spec Evolution says to label the version in the title and bump it when a shipped delta is folded back in, so the V1/V2 boundary is stated in the artifact itself rather than implied.
…pport, delta verification, V1 labeling
Summary
Answers two long-open user questions about what happens to a spec after V1:
/buildand/ship?/specwrites a single globalSPEC.md, which gets overwritten when you spec something else.Closes #150
What changed
skills/spec-driven-development/SKILL.mdSPEC-postgres-migration.mdnext toSPEC.md), run through the same gated workflow, and folded back into the original after shipping — the original spec always describes the current system, delta specs describe transitions (answering Recommended way to handle V2 features without polluting V1 spec? #150's second question)..claude/commands/spec.md+.gemini/commands/spec.toml(kept in parity;validate-commandspasses)SPEC.mdexists and the request is a change to what it describes, write a delta spec instead of overwriting. This fixes the overwrite pain in Support for multiple/parallel specs #180 at the workflow level.evals/cases/spec-driven-development.jsonNon-overlap check
Verification
Rebased on current main (6bcfeb9), all tiers green locally:
validate-skills.js— 24 skills, 0 errorsvalidate-commands.js— 8 commands, parity holds across Claude/Gemini twinsrun-evals.js— 126 checks passed, 0 errors; both new trigger prompts route within top-3; rank-1 rate unchanged at 85%