Repository navigation
How to keep specs consistent and up-to-date with spec-kit? #5241
Replies: 16 comments
|
Following up on my own question: I think the up-to-date centralized documentation could be considered an integral part of the spec constitution, not just a supporting tool. |
|
I have a similar concern. I think it's essential that specs are maintained/curated/refactored to maintain a single, logically organized source of truth that both humans and AI can refer to. An implementation path could be to do a git commit on the spec update(s), and then use that commit to kick-off planning of a migration plan to implement the spec change. Doing that, your example might be extended as:
|
|
What if SpecKit could compact multiple implemented features into a single “milestone” spec — kind of like how LLMs summarize long conversations? After several /specify → /plan → /tasks → implement cycles, we could run /speckit.compact to: Synthesize all completed specs into a concise milestone summary Capture shared patterns, architecture, and lessons Detect drift between intent and implementation Optionally trigger a light refactor phase to align the codebase with the consolidated spec Basically: milestones not as planning containers, but as post-implementation compaction points — compressing implementation history into reusable context and keeping both specs and code coherent as the system evolves. |
|
This is indeed a key point! |
|
I agree, it would be great if there was a centralised/consolidated spec that keeps track of the entire current definition |
|
That is exactly the killer feature of Openspec. |
|
I also ran into this very early in my testing of this tool. The generated output after the spec is implmented quickly becomes out of date due the the fine tuning changes applied to get the feature ready for actual use. In a perfect world there would be some background job that can detect when feature deviate from the original spec and suggests changes to bring it up to date. I envision this could also be used to create specs for existing features that are missing specs within your project. |
|
I once considered not merging the specs directory into the main branch each time a branch is merged, so as to ensure that the development branch retains its own archival information from the development process. |
|
This issue has been automatically marked as stale because it has not had any activity for 150 days. It will be closed in 30 days if no further activity occurs. |
|
just came across this FR while investigating the same problems, wonder if there is an extension available that would solve this |
|
I have the same concern. There's also a discussion about this here: #152 |
|
The 001-login / 009-2FA example is exactly the case I hit, and I ended up splitting it into two problems that turned out to need different tools. "What did we already decide?" — context from earlier specs never reaching the current one. I published spec-kit-memory for that (community catalog id "Which earlier promise did this new spec just invalidate?" — the sharper half of your question, and the one that actually bit me. A merged spec in my project made a closed per-intent allowlist its central safety control. A later spec made that intent set page-derived and unbounded. The first spec was not wrong — an assumption underneath it moved, and nobody wrote the amendment. Both merged separately, each passing its own gate. So I wrote spec-kit-coherence. It hooks Two halves on purpose:
On your example it would surface 001's "log in with email + password" as a closed-world promise sitting against 009's added step, and say plainly that the artefact to amend is 001 — and that this is a governance change to 001's promises, not a code edit. Answering @dan-s-github's June question directly: this is that extension, such as it is. Fair warning that it is new — source is public, but no release is cut yet and it is not in the community catalog, so it is a |
|
As indicated above you can deliver an extension and/or preset to deliver this above and beyond the core SDD process |
|
This issue has been automatically marked as stale because it has had no activity for 60 days. It will be closed in 30 days unless there is a substantive update. If the problem still applies, please provide updated context such as whether it is still reproducible, the affected version or environment, its current impact, and any new reproduction details. A comment that only states that the issue is "still relevant" does not give maintainers enough information to reconsider it. |
|
We measured how big this problem is on a real repo. We took frank-fs/frank: 17 features in specs/, one Spec Kit template. Then we folded all 17 into one backlog, oldest first. At each feature we asked: is this story new, does it revise an earlier one, or is it a duplicate? 70 user stories as written became 45. 10 were rewritten by later features, 14 were the same story written again, 1 was dropped. Five features added no new stories at all, they only changed old ones. One story was touched by four features: 001 → 010 → 014 → 015, all about API compatibility. To know what it says today, you read four spec.md files in order. And 20 times a later requirement looked like it replaces an earlier one, but no spec says so. One requirement, "all HTML through Hox h()", was put in doubt three times. So per-feature specs work like a change log, not a spec of the system. The 001-login / 009-2FA case is the normal case, not an edge case. |
|
I've hit the same wall, and I think the answer is not "consolidate the specs into one" — it's "detect the drift mechanically, and keep the history". Reason: merging 001 into 009 destroys the only record of why 001 existed. What's actually missing is a way to know, without reading everything, which specs no longer describe current behaviour. So I built a zero-dependency checker and ran it against a reproduction of the exact example in this issue (001 login + 009 2FA). Real output, trimmed in three documented ways to keep it readable: the per-finding evidence JSON and re-check command are omitted, and findings 3–6 have their repeated claim wording abbreviated with
That last one (D4) is the actual question you asked: "is 001's spec now outdated because of 009?" The tool doesn't answer it — it points at the pair and quotes both texts, and a human decides. What I learned building it: all three obvious approaches fail1. Don't grep the test files. Comments and docstrings poison the result. My own test file had a trailing comment — 2. Drop the vocabulary every spec shares. 3. One matching word is not a match. A test named The generalisable point: "the vocabulary overlaps" and "the requirement is covered" are different claims, and grep can't tell them apart without these three filters. What it deliberately does not do
The part that makes it useful day-to-day
(One detail I got wrong the first time: my CI ran that gate with I ran it on real projects before posting this — and the first version was unusableRather than tune thresholds on my own two-spec toy, I cloned three public repos that actually use spec-kit and ran the checker on their real specs:
406 findings on one repo is not a strict checker, it's a broken one. Cause: D4 compares every pair of specs, so 35 specs produce ~600 pairs — and specs from the same project are consecutive iterations that share vocabulary by construction. Three fixes brought it to 31: threshold 34% → 45%, keep only the strongest overlap per spec pair, and cap the list at 20 with an explicit "N more folded" line. The other two repos are where the signal held up:
Then I scanned the ecosystem, and found something bigger than driftI pulled every
The number that reframes this issue isn't the overlap count. It's that 44% of specs are If almost half the specs in the wild never reach any terminal state, then "is this spec That's why I think the useful fix isn't consolidation and isn't a Concretely, three small changes would make this problem tractable:
The checker I built detects the symptom. Those three changes remove the cause. I'd rather What I still don't knowWhether the 31 remaining findings in So if this is worth pursuing at all: pick one spec pair from your own output and I'll walk through why it fired. That's the fastest way to find out whether the heuristic deserves to exist — much faster than me tuning it in the dark. Known limits
Repo + run instructions: https://github.com/chenhz01/spec-drift git clone https://github.com/chenhz01/spec-drift && cd spec-drift
python selfcheck.py # 14 assertions: must fire on demo/, must stay silent on clean/
python spec_drift.py --root demo # reproduces the output above
I'm not proposing this as the solution — just as a concrete starting point that others can re-run and argue with, which seemed more useful than a sixteenth "+1, we need this" on a thread that's been open for 13 months. |
Uh oh!
There was an error while loading. Please reload this page.
With
spec-kit, each feature defines its own spec. This works well at first, but over time and with the multiplication of features, some descriptions become outdated or are enriched by new features.Example
In this case, the original spec of feature 001 becomes partially outdated or needs to be complemented by feature 009.
Discussion
/closecommand (or equivalent) to mark a feature as deprecated and automatically update a centralized project documentation?All reactions