specflow-cc 1.0.0 → 1.2.0

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,35 @@ 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.2.0] - 2026-01-20
9
+
10
+ ### Fixed
11
+
12
+ - Command format: `/sf run` → `/sf:run` (matches Claude Code syntax)
13
+
14
+ ### Changed
15
+
16
+ - `/sf:audit` now shows alternative next steps when APPROVED with recommendations
17
+ - `/sf:review` now shows alternative next steps when APPROVED with minor suggestions
18
+ - User can choose to proceed or apply optional feedback first
19
+
20
+ ---
21
+
22
+ ## [1.1.0] - 2026-01-20
23
+
24
+ ### Added
25
+
26
+ #### Analysis Commands
27
+ - `/sf:scan [--focus]` - Deep codebase analysis for tech debt, concerns, and improvement opportunities
28
+
29
+ #### Agents
30
+ - `codebase-scanner` - Analyzes codebase and writes structured SCAN.md report
31
+
32
+ #### Templates
33
+ - `scan.md` - Codebase scan report template
34
+
35
+ ---
36
+
8
37
  ## [1.0.0] - 2026-01-20
9
38
 
10
39
  ### Added
package/README.md CHANGED
@@ -41,28 +41,28 @@ npx specflow-cc --local
41
41
 
42
42
  ```bash
43
43
  # 1. Initialize project (once per project)
44
- /sf init
44
+ /sf:init
45
45
 
46
46
  # 2. Create a specification
47
- /sf new "Add user authentication with JWT"
47
+ /sf:new "Add user authentication with JWT"
48
48
 
49
49
  # 3. Audit the specification (fresh context)
50
- /sf audit
50
+ /sf:audit
51
51
 
52
52
  # 4. Revise if needed
53
- /sf revise
53
+ /sf:revise
54
54
 
55
55
  # 5. Execute when approved
56
- /sf run
56
+ /sf:run
57
57
 
58
58
  # 6. Review implementation (fresh context)
59
- /sf review
59
+ /sf:review
60
60
 
61
61
  # 7. Fix if needed
62
- /sf fix
62
+ /sf:fix
63
63
 
64
64
  # 8. Complete and archive
65
- /sf done
65
+ /sf:done
66
66
  ```
67
67
 
68
68
  ## Commands
@@ -71,54 +71,60 @@ npx specflow-cc --local
71
71
 
72
72
  | Command | Description |
73
73
  |---------|-------------|
74
- | `/sf init` | Initialize project, analyze codebase |
75
- | `/sf new [description]` | Create new specification |
76
- | `/sf audit` | Audit specification (fresh context) |
77
- | `/sf revise [instructions]` | Revise spec based on audit |
78
- | `/sf run` | Execute specification |
79
- | `/sf review` | Review implementation (fresh context) |
80
- | `/sf fix [instructions]` | Fix based on review |
81
- | `/sf done` | Complete, commit, and archive |
82
- | `/sf status` | Show current state and next step |
74
+ | `/sf:init` | Initialize project, analyze codebase |
75
+ | `/sf:new [description]` | Create new specification |
76
+ | `/sf:audit` | Audit specification (fresh context) |
77
+ | `/sf:revise [instructions]` | Revise spec based on audit |
78
+ | `/sf:run` | Execute specification |
79
+ | `/sf:review` | Review implementation (fresh context) |
80
+ | `/sf:fix [instructions]` | Fix based on review |
81
+ | `/sf:done` | Complete, commit, and archive |
82
+ | `/sf:status` | Show current state and next step |
83
83
 
84
84
  ### Navigation
85
85
 
86
86
  | Command | Description |
87
87
  |---------|-------------|
88
- | `/sf list` | List all specifications |
89
- | `/sf show [ID]` | Show specification details |
90
- | `/sf next` | Switch to next priority task |
88
+ | `/sf:list` | List all specifications |
89
+ | `/sf:show [ID]` | Show specification details |
90
+ | `/sf:next` | Switch to next priority task |
91
91
 
92
92
  ### To-Do Management
93
93
 
94
94
  | Command | Description |
95
95
  |---------|-------------|
96
- | `/sf todo [text]` | Add idea or future task |
97
- | `/sf todos` | List all todos with priorities |
98
- | `/sf plan [ID]` | Convert todo into specification |
99
- | `/sf priority` | Interactive prioritization |
96
+ | `/sf:todo [text]` | Add idea or future task |
97
+ | `/sf:todos` | List all todos with priorities |
98
+ | `/sf:plan [ID]` | Convert todo into specification |
99
+ | `/sf:priority` | Interactive prioritization |
100
100
 
101
101
  ### Decomposition
102
102
 
103
103
  | Command | Description |
104
104
  |---------|-------------|
105
- | `/sf split [ID]` | Split large spec into smaller parts |
106
- | `/sf deps` | Show dependency graph |
105
+ | `/sf:split [ID]` | Split large spec into smaller parts |
106
+ | `/sf:deps` | Show dependency graph |
107
107
 
108
108
  ### Session Management
109
109
 
110
110
  | Command | Description |
111
111
  |---------|-------------|
112
- | `/sf pause` | Save context for later |
113
- | `/sf resume` | Restore saved context |
112
+ | `/sf:pause` | Save context for later |
113
+ | `/sf:resume` | Restore saved context |
114
+
115
+ ### Analysis
116
+
117
+ | Command | Description |
118
+ |---------|-------------|
119
+ | `/sf:scan [--focus]` | Deep codebase analysis for concerns and tech debt |
114
120
 
115
121
  ### Utilities
116
122
 
117
123
  | Command | Description |
118
124
  |---------|-------------|
119
- | `/sf help [command]` | Show help for commands |
120
- | `/sf history [ID]` | View completed specifications |
121
- | `/sf metrics` | Project statistics |
125
+ | `/sf:help [command]` | Show help for commands |
126
+ | `/sf:history [ID]` | View completed specifications |
127
+ | `/sf:metrics` | Project statistics |
122
128
 
123
129
  ## Workflow Diagram
124
130
 
@@ -127,43 +133,44 @@ npx specflow-cc --local
127
133
  │ SPECFLOW WORKFLOW │
128
134
  ├─────────────────────────────────────────────────────────────┤
129
135
  │ │
130
- │ /sf init ──→ Initialize project (once) │
136
+ │ /sf:init ──→ Initialize project (once) │
131
137
  │ ↓ │
132
- │ /sf new ──→ Create specification │
138
+ │ /sf:new ──→ Create specification │
133
139
  │ ↓ │
134
140
  │ ┌─────────────────────────────────────┐ │
135
141
  │ │ SPEC AUDIT LOOP │ │
136
- │ │ /sf audit ──→ APPROVED? ──yes──→ ──┼──→ │
142
+ │ │ /sf:audit ──→ APPROVED? ──yes──→ ──┼──→ │
137
143
  │ │ │ │ ↓ │
138
144
  │ │ no │ │
139
145
  │ │ ↓ │ │
140
- │ │ /sf revise ────────→ loop back │ │
146
+ │ │ /sf:revise ────────→ loop back │ │
141
147
  │ └─────────────────────────────────────┘ │
142
148
  │ ↓ │
143
- │ /sf run ──→ Execute specification │
149
+ │ /sf:run ──→ Execute specification │
144
150
  │ ↓ │
145
151
  │ ┌─────────────────────────────────────┐ │
146
152
  │ │ IMPL REVIEW LOOP │ │
147
- │ │ /sf review ──→ APPROVED? ──yes──→ ─┼──→ │
153
+ │ │ /sf:review ──→ APPROVED? ──yes──→ ─┼──→ │
148
154
  │ │ │ │ ↓ │
149
155
  │ │ no │ │
150
156
  │ │ ↓ │ │
151
- │ │ /sf fix ───────────→ loop back │ │
157
+ │ │ /sf:fix ───────────→ loop back │ │
152
158
  │ └─────────────────────────────────────┘ │
153
159
  │ ↓ │
154
- │ /sf done ──→ Complete and archive │
160
+ │ /sf:done ──→ Complete and archive │
155
161
  │ │
156
162
  └─────────────────────────────────────────────────────────────┘
157
163
  ```
158
164
 
159
165
  ## Project Structure
160
166
 
161
- After `/sf init`, SpecFlow creates:
167
+ After `/sf:init`, SpecFlow creates:
162
168
 
163
169
  ```
164
170
  .specflow/
165
171
  ├── PROJECT.md # Project overview and patterns
166
172
  ├── STATE.md # Current state and queue
173
+ ├── SCAN.md # Codebase scan results (from /sf:scan)
167
174
  ├── config.json # Configuration
168
175
  ├── specs/ # Active specifications
169
176
  │ └── SPEC-001.md
@@ -215,7 +222,7 @@ created: 2026-01-20
215
222
  |------|--------|--------|
216
223
  | Small | ≤50k | Execute directly |
217
224
  | Medium | 50-150k | Warning, proceed |
218
- | Large | >150k | Requires `/sf split` |
225
+ | Large | >150k | Requires `/sf:split` |
219
226
 
220
227
  ## Statusline
221
228
 
@@ -228,8 +235,8 @@ SpecFlow includes a statusline hook showing:
228
235
 
229
236
  | Aspect | GSD | SpecFlow |
230
237
  |--------|-----|----------|
231
- | Commands | 25 | 22 |
232
- | Agents | 11 | 6 |
238
+ | Commands | 25 | 23 |
239
+ | Agents | 11 | 7 |
233
240
  | Phases per task | 5+ | 3-4 |
234
241
  | Quality audit | No | Yes (explicit) |
235
242
  | Revision loop | No | Yes |
@@ -0,0 +1,243 @@
1
+ ---
2
+ name: sf-codebase-scanner
3
+ description: Analyzes codebase for concerns, quality issues, and improvement opportunities. Writes SCAN.md directly.
4
+ tools: Read, Bash, Grep, Glob, Write
5
+ ---
6
+
7
+ <role>
8
+ You are a SpecFlow codebase scanner. You analyze a codebase to identify technical debt, code quality issues, security concerns, and improvement opportunities.
9
+
10
+ You are spawned by `/sf:scan` with a focus area:
11
+ - **concerns** — Technical debt, bugs, security issues
12
+ - **quality** — Code quality, conventions, test coverage gaps
13
+ - **arch** — Architecture problems, structure issues
14
+ - **all** — Complete analysis (default)
15
+
16
+ Your job: Explore thoroughly, analyze deeply, write `.specflow/SCAN.md` directly. Return only confirmation.
17
+ </role>
18
+
19
+ <philosophy>
20
+ **Actionable findings only:**
21
+ Every issue should have enough context to create a specification. Include file paths, line numbers when relevant, and suggested fixes.
22
+
23
+ **Prioritize by impact:**
24
+ Order findings by severity. A security vulnerability matters more than a missing comment.
25
+
26
+ **Be specific, not vague:**
27
+ "UserService.ts:45 has SQL injection risk" not "there might be security issues"
28
+
29
+ **Include file paths:**
30
+ Every finding needs a file path in backticks. This enables direct navigation.
31
+ </philosophy>
32
+
33
+ <process>
34
+
35
+ ## 1. Parse Focus Area
36
+
37
+ Read focus from prompt. Default to "all" if not specified.
38
+
39
+ ## 2. Explore Codebase
40
+
41
+ **For concerns focus:**
42
+ ```bash
43
+ # TODO/FIXME/HACK comments
44
+ grep -rn "TODO\|FIXME\|HACK\|XXX\|BUG" src/ --include="*.ts" --include="*.tsx" --include="*.js" --include="*.py" 2>/dev/null | head -50
45
+
46
+ # Large files (complexity indicators)
47
+ find . -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.py" | xargs wc -l 2>/dev/null | sort -rn | head -20
48
+
49
+ # Empty catches / swallowed errors
50
+ grep -rn "catch.*{}" src/ --include="*.ts" --include="*.tsx" 2>/dev/null | head -20
51
+
52
+ # Hardcoded secrets patterns
53
+ grep -rn "password\|secret\|api_key\|apikey" src/ --include="*.ts" --include="*.tsx" --include="*.env*" 2>/dev/null | head -20
54
+
55
+ # console.log in production code
56
+ grep -rn "console.log\|console.error" src/ --include="*.ts" --include="*.tsx" 2>/dev/null | head -30
57
+ ```
58
+
59
+ **For quality focus:**
60
+ ```bash
61
+ # Check for linting/formatting config
62
+ ls .eslintrc* .prettierrc* eslint.config.* biome.json tsconfig.json 2>/dev/null
63
+
64
+ # Test file coverage
65
+ find . -name "*.test.*" -o -name "*.spec.*" | wc -l
66
+ find . -name "*.ts" -o -name "*.tsx" | grep -v test | grep -v spec | wc -l
67
+
68
+ # Type safety issues (any usage)
69
+ grep -rn ": any\|as any" src/ --include="*.ts" --include="*.tsx" 2>/dev/null | head -30
70
+
71
+ # Duplicate code patterns (similar function names)
72
+ grep -rn "function\|const.*=" src/ --include="*.ts" | cut -d: -f3 | sort | uniq -d | head -20
73
+ ```
74
+
75
+ **For arch focus:**
76
+ ```bash
77
+ # Directory structure
78
+ find . -type d -not -path '*/node_modules/*' -not -path '*/.git/*' -not -path '*/dist/*' | head -40
79
+
80
+ # Circular dependency indicators
81
+ grep -rn "import.*from" src/ --include="*.ts" | head -100
82
+
83
+ # Entry points
84
+ ls src/index.* src/main.* src/app.* app/page.* pages/index.* 2>/dev/null
85
+
86
+ # Large directories (potential god modules)
87
+ find src/ -type f | cut -d/ -f1-3 | sort | uniq -c | sort -rn | head -10
88
+ ```
89
+
90
+ ## 3. Deep Analysis
91
+
92
+ Read key files identified during exploration:
93
+ - Largest files (complexity hotspots)
94
+ - Files with most TODO comments
95
+ - Entry points and core modules
96
+ - Test files (or lack thereof)
97
+
98
+ ## 4. Write SCAN.md
99
+
100
+ Use the Write tool to create `.specflow/SCAN.md`:
101
+
102
+ ```markdown
103
+ # Codebase Scan Report
104
+
105
+ **Date:** [YYYY-MM-DD]
106
+ **Focus:** [focus area]
107
+
108
+ ## Executive Summary
109
+
110
+ [2-3 sentence overview of codebase health]
111
+
112
+ **Health Score:** [Good | Moderate | Needs Attention | Critical]
113
+
114
+ ---
115
+
116
+ ## Tech Debt
117
+
118
+ ### High Priority
119
+
120
+ **[Issue Title]**
121
+ - Files: `[file paths]`
122
+ - Problem: [What's wrong]
123
+ - Impact: [Why it matters]
124
+ - Fix: [How to address]
125
+
126
+ ### Medium Priority
127
+
128
+ ...
129
+
130
+ ### Low Priority
131
+
132
+ ...
133
+
134
+ ---
135
+
136
+ ## Code Quality Issues
137
+
138
+ ### Type Safety
139
+
140
+ **[Issue]**
141
+ - Files: `[paths]`
142
+ - Count: [N occurrences]
143
+ - Fix: [Approach]
144
+
145
+ ### Error Handling
146
+
147
+ ...
148
+
149
+ ### Code Duplication
150
+
151
+ ...
152
+
153
+ ---
154
+
155
+ ## Security Considerations
156
+
157
+ **[Risk Area]**
158
+ - Files: `[paths]`
159
+ - Risk: [What could happen]
160
+ - Severity: [Critical | High | Medium | Low]
161
+ - Mitigation: [What to do]
162
+
163
+ ---
164
+
165
+ ## Test Coverage Gaps
166
+
167
+ **[Untested Area]**
168
+ - Files: `[paths]`
169
+ - What's missing: [Description]
170
+ - Priority: [High | Medium | Low]
171
+
172
+ ---
173
+
174
+ ## Architecture Observations
175
+
176
+ **[Observation]**
177
+ - Current: [How it is]
178
+ - Concern: [Why it's problematic]
179
+ - Suggestion: [Improvement]
180
+
181
+ ---
182
+
183
+ ## Suggested Specifications
184
+
185
+ Based on this scan, consider creating specs for:
186
+
187
+ 1. **[Spec title]** — [brief description]
188
+ - Priority: [High | Medium | Low]
189
+ - Complexity: [small | medium | large]
190
+
191
+ 2. **[Spec title]** — [brief description]
192
+ ...
193
+
194
+ ---
195
+
196
+ *Scan completed: [timestamp]*
197
+ ```
198
+
199
+ ## 5. Return Confirmation
200
+
201
+ Return ONLY a brief confirmation:
202
+
203
+ ```
204
+ ## Scan Complete
205
+
206
+ **Focus:** {focus}
207
+ **Document:** `.specflow/SCAN.md` ({N} lines)
208
+
209
+ **Findings:**
210
+ - Tech Debt: {N} issues
211
+ - Quality: {N} issues
212
+ - Security: {N} considerations
213
+ - Test Gaps: {N} areas
214
+
215
+ Ready for review.
216
+ ```
217
+
218
+ </process>
219
+
220
+ <critical_rules>
221
+
222
+ **WRITE SCAN.MD DIRECTLY.** Do not return findings to orchestrator.
223
+
224
+ **ALWAYS INCLUDE FILE PATHS.** Every finding needs a file path in backticks.
225
+
226
+ **PRIORITIZE FINDINGS.** Most impactful issues first.
227
+
228
+ **BE SPECIFIC.** Line numbers, function names, concrete examples.
229
+
230
+ **SUGGEST SPECS.** End with actionable specification ideas.
231
+
232
+ **RETURN ONLY CONFIRMATION.** Your response should be ~15 lines max.
233
+
234
+ </critical_rules>
235
+
236
+ <success_criteria>
237
+ - [ ] Focus area understood
238
+ - [ ] Codebase explored thoroughly
239
+ - [ ] `.specflow/SCAN.md` written with structured findings
240
+ - [ ] File paths included throughout
241
+ - [ ] Suggested specifications provided
242
+ - [ ] Confirmation returned (not full document)
243
+ </success_criteria>
@@ -196,8 +196,8 @@ Append to specification's Review History:
196
196
 
197
197
  ## Step 8: Update STATE.md
198
198
 
199
- - If APPROVED: Status → "done", Next Step → "/sf done"
200
- - If CHANGES_REQUESTED: Status → "review", Next Step → "/sf fix"
199
+ - If APPROVED: Status → "done", Next Step → "/sf:done"
200
+ - If CHANGES_REQUESTED: Status → "review", Next Step → "/sf:fix"
201
201
 
202
202
  </process>
203
203
 
@@ -246,13 +246,13 @@ Return review result:
246
246
 
247
247
  ## Next Step
248
248
 
249
- {If APPROVED:} `/sf done` — finalize and archive
249
+ {If APPROVED:} `/sf:done` — finalize and archive
250
250
 
251
- {If CHANGES_REQUESTED:} `/sf fix` — address issues
251
+ {If CHANGES_REQUESTED:} `/sf:fix` — address issues
252
252
 
253
253
  Options:
254
- - `/sf fix all` — apply all fixes
255
- - `/sf fix 1,2` — fix specific issues
254
+ - `/sf:fix all` — apply all fixes
255
+ - `/sf:fix 1,2` — fix specific issues
256
256
  ```
257
257
 
258
258
  </output>
@@ -100,7 +100,7 @@ Separate findings into:
100
100
 
101
101
  **Critical (blocks implementation):**
102
102
  - Numbered list: 1, 2, 3...
103
- - Must be fixed before `/sf run`
103
+ - Must be fixed before `/sf:run`
104
104
 
105
105
  **Recommendations (improvements):**
106
106
  - Numbered list continuing from critical
@@ -138,8 +138,8 @@ N+1. [recommendation]
138
138
  ## Step 7: Update STATE.md
139
139
 
140
140
  Update status:
141
- - If APPROVED: Status → "audited", Next Step → "/sf run"
142
- - If NEEDS_REVISION: Status → "revision_requested", Next Step → "/sf revise"
141
+ - If APPROVED: Status → "audited", Next Step → "/sf:run"
142
+ - If NEEDS_REVISION: Status → "revision_requested", Next Step → "/sf:revise"
143
143
 
144
144
  </process>
145
145
 
@@ -168,7 +168,7 @@ Return formatted audit result:
168
168
 
169
169
  ### Next Step
170
170
 
171
- `/sf revise` — address critical issues
171
+ `/sf:revise` — address critical issues
172
172
 
173
173
  ---
174
174
 
@@ -180,7 +180,7 @@ Return formatted audit result:
180
180
 
181
181
  ### Next Step
182
182
 
183
- `/sf run` — implement specification
183
+ `/sf:run` — implement specification
184
184
  ```
185
185
 
186
186
  </output>
@@ -24,7 +24,7 @@ Ask ONLY questions that:
24
24
  - Cannot be reasonably assumed from PROJECT.md context
25
25
  - Have mutually exclusive answers (not "yes/no/maybe")
26
26
 
27
- Everything else becomes an assumption that can be corrected during `/sf revise`.
27
+ Everything else becomes an assumption that can be corrected during `/sf:revise`.
28
28
 
29
29
  ## Spec Quality
30
30
 
@@ -40,7 +40,7 @@ Good specifications are:
40
40
  |------|--------|---------------|
41
41
  | small | ≤50k | Single file, simple feature |
42
42
  | medium | 50-150k | Multiple files, moderate feature |
43
- | large | >150k | Many files, complex feature — needs /sf split |
43
+ | large | >150k | Many files, complex feature — needs /sf:split |
44
44
 
45
45
  </philosophy>
46
46
 
@@ -111,7 +111,7 @@ Mark as small/medium/large in frontmatter.
111
111
  Update `.specflow/STATE.md`:
112
112
  - Set Active Specification to new spec
113
113
  - Set Status to "drafting"
114
- - Set Next Step to "/sf audit"
114
+ - Set Next Step to "/sf:audit"
115
115
  - Add spec to Queue
116
116
 
117
117
  </process>
@@ -136,11 +136,11 @@ Return structured result:
136
136
  - .specflow/specs/SPEC-XXX.md
137
137
 
138
138
  ### Next Step
139
- `/sf audit` — audit specification before implementation
139
+ `/sf:audit` — audit specification before implementation
140
140
 
141
141
  {If complexity is large:}
142
142
  ### Warning
143
- Specification is large (>150k tokens estimated). Consider `/sf split SPEC-XXX` to decompose.
143
+ Specification is large (>150k tokens estimated). Consider `/sf:split SPEC-XXX` to decompose.
144
144
  ```
145
145
 
146
146
  </output>
@@ -182,7 +182,7 @@ Append to specification:
182
182
  ## Step 8: Update STATE.md
183
183
 
184
184
  - Status → "review"
185
- - Next Step → "/sf review"
185
+ - Next Step → "/sf:review"
186
186
 
187
187
  </process>
188
188
 
@@ -216,7 +216,7 @@ Return execution result:
216
216
 
217
217
  ### Next Step
218
218
 
219
- `/sf review` — audit implementation
219
+ `/sf:review` — audit implementation
220
220
  ```
221
221
 
222
222
  </output>
@@ -137,7 +137,7 @@ Set status to "auditing" (ready for re-audit).
137
137
  ## Step 7: Update STATE.md
138
138
 
139
139
  - Status → "auditing"
140
- - Next Step → "/sf audit"
140
+ - Next Step → "/sf:audit"
141
141
 
142
142
  </process>
143
143
 
@@ -167,7 +167,7 @@ Return formatted revision result:
167
167
 
168
168
  ### Next Step
169
169
 
170
- `/sf audit` — re-audit revised specification
170
+ `/sf:audit` — re-audit revised specification
171
171
  ```
172
172
 
173
173
  </output>
@@ -179,7 +179,7 @@ SPEC-XXXc
179
179
 
180
180
  ### Next Step
181
181
 
182
- `/sf audit SPEC-XXXa` — start with first sub-specification
182
+ `/sf:audit SPEC-XXXa` — start with first sub-specification
183
183
  ```
184
184
 
185
185
  </output>