Skip to content

Commit 0b82a1d

Browse files
authored
docs: document spec persistence models (#2856)
1 parent d3f872f commit 0b82a1d

3 files changed

Lines changed: 114 additions & 0 deletions

File tree

docs/concepts/sdd.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ Spec-Driven Development is a structured process that emphasizes:
1111
- **Multi-step refinement** rather than one-shot code generation from prompts
1212
- **Heavy reliance** on advanced AI model capabilities for specification interpretation
1313

14+
Spec Kit does not prescribe how teams preserve or mutate `spec.md`, `plan.md`,
15+
and `tasks.md` after requirements change. See
16+
[Spec Persistence Models](spec-persistence.md) for three common ways to manage
17+
those artifacts over time.
18+
1419
## Development Phases
1520

1621
| Phase | Focus | Key Activities |

docs/concepts/spec-persistence.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Spec Persistence Models
2+
3+
Spec Kit intentionally leaves teams in control of what happens to `spec.md`,
4+
`plan.md`, and `tasks.md` after requirements change. The toolkit gives you a
5+
repeatable workflow, but it does not force one artifact maintenance strategy.
6+
7+
This page names three common models so teams can make that choice explicit.
8+
None is the default, and none is required by Spec Kit.
9+
10+
## Two Separate Questions
11+
12+
Spec-driven development has a temporal question: how long should the
13+
specification matter? One
14+
[overview of SDD tooling](https://martinfowler.com/articles/exploring-gen-ai/sdd-3-tools.html)
15+
frames that lifecycle in three levels:
16+
17+
- **Spec-first**: write a spec before coding, then allow it to be discarded.
18+
- **Spec-anchored**: keep the spec after implementation and use it for future
19+
changes.
20+
- **Spec-as-source**: treat the spec as the only human-edited source and
21+
regenerate implementation artifacts from it.
22+
23+
Spec Kit also exposes a second question: what happens to the artifact set when
24+
requirements change? The models below describe that mutation strategy.
25+
26+
## Flow-Back Spec
27+
28+
Use flow-back when `spec.md`, `plan.md`, `tasks.md`, and the implementation are
29+
all allowed to inform each other.
30+
31+
In this model, edits can begin in any artifact. A developer might update
32+
`tasks.md` during implementation, revise `plan.md` after a technical discovery,
33+
or adjust `spec.md` after a product clarification. The team then reconciles the
34+
artifact set manually so the final project history still makes sense.
35+
36+
Flow-back works well when:
37+
38+
- the team is small enough to notice and reconcile drift quickly
39+
- implementation discoveries are expected to reshape the original plan
40+
- speed matters more than preserving each intermediate decision as immutable
41+
history
42+
43+
The main risk is silent divergence. If the team changes lower-level artifacts
44+
without reflecting the decision back into `spec.md`, future contributors may
45+
not know which artifact to trust.
46+
47+
## Flow-Forward Spec
48+
49+
Use flow-forward when each feature directory should remain a historical record.
50+
51+
In this model, completed artifacts are treated as immutable. When requirements
52+
change, the team creates a new feature directory instead of mutating the
53+
existing `spec.md`, `plan.md`, or `tasks.md`. The older directory remains useful
54+
for audit, comparison, or explaining how the project reached its current state.
55+
56+
Flow-forward works well when:
57+
58+
- auditability and traceability matter
59+
- features are well-scoped and rarely revisited in place
60+
- the team wants a clear sequence of requirement changes over time
61+
62+
The main tradeoff is duplication. Related decisions can be spread across
63+
multiple feature directories, so teams need naming, linking, or review habits
64+
that make the lineage easy to follow.
65+
66+
## Living Spec
67+
68+
Use living spec when `spec.md` is the contract and the other artifacts are
69+
derived from it.
70+
71+
In this model, teams update `spec.md` first and then regenerate or revise
72+
`plan.md` and `tasks.md` from that source. The plan and task list are still
73+
valuable, but they are treated as disposable derivations rather than permanent
74+
sources of truth.
75+
76+
Living spec works well when:
77+
78+
- the product contract is stable enough to own the workflow
79+
- the team is comfortable regenerating derived artifacts after spec changes
80+
- consistency between requirements and implementation matters more than keeping
81+
every intermediate plan intact
82+
83+
The main risk is losing useful implementation rationale if derived artifacts are
84+
discarded without preserving important decisions elsewhere.
85+
86+
## Choosing a Model
87+
88+
The model is a team convention, not a CLI setting. A project can even use
89+
different models in different areas, as long as contributors know which one
90+
applies.
91+
92+
| Model | Mutation rule | Best fit | Watch out for |
93+
|---|---|---|---|
94+
| Flow-back spec | Edit any artifact, then reconcile | Fast iteration and close collaboration | Silent drift between artifacts |
95+
| Flow-forward spec | Create a new feature directory for new requirements | Audit trails and historical clarity | Duplicate or fragmented context |
96+
| Living spec | Edit `spec.md`; regenerate derived artifacts | Spec as contract | Lost rationale in regenerated files |
97+
98+
If your team has not chosen a model yet, start by answering two questions:
99+
100+
1. Should completed feature directories be historical records or editable work
101+
areas?
102+
2. Is `spec.md` the single source of truth, or are `plan.md` and `tasks.md`
103+
allowed to become co-equal sources?
104+
105+
Once those answers are clear, document the convention in your project
106+
constitution or team onboarding notes so future contributors know how to handle
107+
changes.

docs/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
items:
4242
- name: What is SDD?
4343
href: concepts/sdd.md
44+
- name: Spec Persistence Models
45+
href: concepts/spec-persistence.md
4446

4547
# Development workflows
4648
- name: Development

0 commit comments

Comments
 (0)