specflow-cc 1.9.3 → 1.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,24 @@ All notable changes to SpecFlow will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.9.4] - 2026-02-05
9
+
10
+ ### Fixed
11
+
12
+ - **Spec ID collision bug** — numbering now checks both `specs/` and `archive/` directories
13
+ - Previously, when all specs were archived, new specs would start from SPEC-001 again
14
+ - This caused ID collisions with archived specs
15
+ - Affected files: `spec-creator.md`, `new.md`
16
+
17
+ ### Added
18
+
19
+ - **State consistency validation** in `/sf:status` (Step 4.5)
20
+ - Detects orphan specs (files in `specs/` but STATE.md shows "None")
21
+ - Detects duplicate IDs (same spec in both `specs/` and `archive/`)
22
+ - Provides actionable warnings with suggested fixes
23
+
24
+ ---
25
+
8
26
  ## [1.9.1] - 2026-02-02
9
27
 
10
28
  ### Fixed
@@ -105,13 +105,15 @@ Limit: 1-3 questions maximum. Zero is fine if task is clear or discussion is com
105
105
 
106
106
  ## Step 4: Generate Spec ID
107
107
 
108
- Find next available SPEC-XXX number:
108
+ Find next available SPEC-XXX number by checking BOTH specs and archive directories:
109
109
 
110
110
  ```bash
111
- ls .specflow/specs/SPEC-*.md 2>/dev/null | sort -V | tail -1
111
+ ls .specflow/specs/SPEC-*.md .specflow/archive/SPEC-*.md 2>/dev/null | grep -oP 'SPEC-\K\d+' | sort -n | tail -1
112
112
  ```
113
113
 
114
- If no specs exist, start with SPEC-001.
114
+ If no specs exist in either directory, start with SPEC-001.
115
+
116
+ **Important:** Always check both directories to prevent ID collisions with archived specs.
115
117
 
116
118
  ## Step 5: Create Specification
117
119
 
@@ -176,7 +176,8 @@ Consider `/sf:split SPEC-XXX` to decompose into smaller specs.
176
176
  ### Get Next Spec Number
177
177
 
178
178
  ```bash
179
- LAST=$(ls .specflow/specs/SPEC-*.md 2>/dev/null | sort -V | tail -1 | grep -oP 'SPEC-\K\d+')
179
+ # Check BOTH specs and archive directories to prevent ID collisions
180
+ LAST=$(ls .specflow/specs/SPEC-*.md .specflow/archive/SPEC-*.md 2>/dev/null | grep -oP 'SPEC-\K\d+' | sort -n | tail -1)
180
181
  NEXT=$(printf "%03d" $((${LAST:-0} + 1)))
181
182
  echo "SPEC-$NEXT"
182
183
  ```
@@ -61,6 +61,38 @@ DONE=$(ls .specflow/archive/SPEC-*.md 2>/dev/null | wc -l)
61
61
  TODOS=$(ls .specflow/todos/*.md 2>/dev/null | wc -l)
62
62
  ```
63
63
 
64
+ ## Step 4.5: Validate State Consistency
65
+
66
+ Check for mismatches between STATE.md and actual files:
67
+
68
+ ```bash
69
+ # Check for orphan specs (exist in specs/ but STATE.md says "None")
70
+ ORPHAN_SPECS=$(ls .specflow/specs/SPEC-*.md 2>/dev/null | head -1)
71
+
72
+ # Check for duplicate IDs (same spec in both specs/ and archive/)
73
+ for f in .specflow/specs/SPEC-*.md; do
74
+ [ -f "$f" ] || continue
75
+ ID=$(basename "$f")
76
+ [ -f ".specflow/archive/$ID" ] && echo "DUPLICATE: $ID"
77
+ done
78
+ ```
79
+
80
+ **If STATE.md shows "Active Specification: None" but specs exist in specs/:**
81
+ Add warning:
82
+ ```
83
+ STATE MISMATCH: Found {N} spec(s) in specs/ but STATE.md shows no active spec.
84
+ Likely cause: STATE.md was not updated after spec creation.
85
+ Run: Read the spec file and manually update STATE.md, or delete orphan spec if duplicate.
86
+ ```
87
+
88
+ **If duplicate IDs found:**
89
+ Add warning:
90
+ ```
91
+ DUPLICATE ID: {SPEC-XXX} exists in both specs/ and archive/.
92
+ Likely cause: Spec numbering bug - archive was not checked when generating ID.
93
+ Fix: Rename the spec in specs/ to next available ID.
94
+ ```
95
+
64
96
  ## Step 5: Determine Next Action
65
97
 
66
98
  Based on current status:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specflow-cc",
3
- "version": "1.9.3",
3
+ "version": "1.9.4",
4
4
  "description": "Spec-driven development system for Claude Code — quality-first workflow with explicit audit cycles",
5
5
  "bin": {
6
6
  "specflow-cc": "bin/install.js"