Skip to content

docs(spec): add spec evolution guidance — V1 scoping and delta specs#383

Open
ayobamiseun wants to merge 2 commits into
addyosmani:mainfrom
ayobamiseun:docs/spec-evolution
Open

docs(spec): add spec evolution guidance — V1 scoping and delta specs#383
ayobamiseun wants to merge 2 commits into
addyosmani:mainfrom
ayobamiseun:docs/spec-evolution

Conversation

@ayobamiseun

Copy link
Copy Markdown

Summary

Answers two long-open user questions about what happens to a spec after V1:

Closes #150

What changed

skills/spec-driven-development/SKILL.md

  • The spec template gains an Out of Scope (Deferred) section — V2 ideas are captured in the spec without expanding V1, and the V1 boundary becomes enforceable during implementation (answering Recommended way to handle V2 features without polluting V1 spec? #150's first question directly).
  • New Spec Evolution: V1 Scoping and Follow-Up Changes section: once a spec has shipped, a change gets its own small delta spec (objective / current behavior / new behavior / success criteria / boundary deltas), saved alongside the original (SPEC-postgres-migration.md next to SPEC.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).
  • Two new rationalization rows, two red flags, and two verification items covering mid-build scope creep and "the feature already has a spec" changes.

.claude/commands/spec.md + .gemini/commands/spec.toml (kept in parity; validate-commands passes)

  • One guard line: if SPEC.md exists 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.json

  • Frontmatter description gains the evolution vocabulary ("shipped spec", "V1", "V2 backlog", "follow-up spec"), and two positive trigger prompts phrased the way the issue authors actually asked verify it routes:
    • "We shipped the V1 we specced — how do I spec the V2 features we deferred?"
    • "This feature already has a spec, but now we want OCR instead of the manual step — spec that change before building"

Non-overlap check

Verification

Rebased on current main (6bcfeb9), all tiers green locally:

  • validate-skills.js — 24 skills, 0 errors
  • validate-commands.js — 8 commands, parity holds across Claude/Gemini twins
  • run-evals.js — 126 checks passed, 0 errors; both new trigger prompts route within top-3; rank-1 rate unchanged at 85%

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
@addyosmani

Copy link
Copy Markdown
Owner

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.

Comment thread .claude/commands/spec.md

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread skills/spec-driven-development/SKILL.md Outdated
[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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recommended way to handle V2 features without polluting V1 spec?

3 participants