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 +29 -0
- package/README.md +50 -43
- package/agents/codebase-scanner.md +243 -0
- package/agents/impl-reviewer.md +6 -6
- package/agents/spec-auditor.md +5 -5
- package/agents/spec-creator.md +5 -5
- package/agents/spec-executor.md +2 -2
- package/agents/spec-reviser.md +2 -2
- package/agents/spec-splitter.md +1 -1
- package/commands/sf/audit.md +35 -11
- package/commands/sf/deps.md +9 -9
- package/commands/sf/done.md +8 -8
- package/commands/sf/fix.md +7 -7
- package/commands/sf/help.md +63 -63
- package/commands/sf/history.md +8 -8
- package/commands/sf/init.md +4 -4
- package/commands/sf/list.md +5 -5
- package/commands/sf/metrics.md +5 -5
- package/commands/sf/new.md +5 -5
- package/commands/sf/next.md +13 -13
- package/commands/sf/pause.md +2 -2
- package/commands/sf/plan.md +8 -8
- package/commands/sf/priority.md +2 -2
- package/commands/sf/resume.md +5 -5
- package/commands/sf/review.md +44 -13
- package/commands/sf/revise.md +6 -6
- package/commands/sf/run.md +5 -5
- package/commands/sf/scan.md +164 -0
- package/commands/sf/show.md +13 -13
- package/commands/sf/split.md +7 -7
- package/commands/sf/status.md +10 -10
- package/commands/sf/todo.md +5 -5
- package/commands/sf/todos.md +6 -6
- package/package.json +1 -1
- package/templates/audit.md +1 -1
- package/templates/scan.md +96 -0
- package/templates/spec.md +1 -1
- package/templates/state.md +1 -1
package/commands/sf/new.md
CHANGED
|
@@ -34,7 +34,7 @@ Create a new specification from a task description. Asks critical questions if n
|
|
|
34
34
|
```
|
|
35
35
|
SpecFlow not initialized.
|
|
36
36
|
|
|
37
|
-
Run `/sf
|
|
37
|
+
Run `/sf:init` first.
|
|
38
38
|
```
|
|
39
39
|
Exit.
|
|
40
40
|
|
|
@@ -102,14 +102,14 @@ The agent will:
|
|
|
102
102
|
|
|
103
103
|
## Next Step
|
|
104
104
|
|
|
105
|
-
`/sf
|
|
105
|
+
`/sf:audit` — audit specification before implementation
|
|
106
106
|
|
|
107
107
|
{If complexity is large:}
|
|
108
108
|
|
|
109
109
|
### Warning
|
|
110
110
|
|
|
111
111
|
Specification is large (>150k tokens estimated).
|
|
112
|
-
Consider `/sf
|
|
112
|
+
Consider `/sf:split SPEC-XXX` to decompose into smaller specs.
|
|
113
113
|
```
|
|
114
114
|
|
|
115
115
|
</workflow>
|
|
@@ -153,7 +153,7 @@ Create `.specflow/specs/SPEC-XXX.md` with:
|
|
|
153
153
|
|
|
154
154
|
- **Active Specification:** SPEC-XXX
|
|
155
155
|
- **Status:** drafting
|
|
156
|
-
- **Next Step:** /sf
|
|
156
|
+
- **Next Step:** /sf:audit
|
|
157
157
|
```
|
|
158
158
|
|
|
159
159
|
Add to Queue table.
|
|
@@ -167,5 +167,5 @@ Add to Queue table.
|
|
|
167
167
|
- [ ] Complexity estimated (small/medium/large)
|
|
168
168
|
- [ ] Assumptions documented
|
|
169
169
|
- [ ] STATE.md updated with new spec
|
|
170
|
-
- [ ] User knows next step is /sf
|
|
170
|
+
- [ ] User knows next step is /sf:audit
|
|
171
171
|
</success_criteria>
|
package/commands/sf/next.md
CHANGED
|
@@ -28,7 +28,7 @@ Find the highest priority specification that needs action, set it as active in S
|
|
|
28
28
|
```
|
|
29
29
|
SpecFlow not initialized.
|
|
30
30
|
|
|
31
|
-
Run `/sf
|
|
31
|
+
Run `/sf:init` to start.
|
|
32
32
|
```
|
|
33
33
|
Exit.
|
|
34
34
|
|
|
@@ -47,8 +47,8 @@ ls -1 .specflow/specs/SPEC-*.md 2>/dev/null
|
|
|
47
47
|
No specifications ready for work.
|
|
48
48
|
|
|
49
49
|
**Options:**
|
|
50
|
-
- `/sf
|
|
51
|
-
- `/sf
|
|
50
|
+
- `/sf:new "description"` — create new specification
|
|
51
|
+
- `/sf:todos` — view idea backlog
|
|
52
52
|
```
|
|
53
53
|
Exit.
|
|
54
54
|
|
|
@@ -91,9 +91,9 @@ Choose spec with highest score.
|
|
|
91
91
|
All specifications are either completed or blocked.
|
|
92
92
|
|
|
93
93
|
**Options:**
|
|
94
|
-
- `/sf
|
|
95
|
-
- `/sf
|
|
96
|
-
- `/sf
|
|
94
|
+
- `/sf:new "description"` — create new specification
|
|
95
|
+
- `/sf:todos` — view idea backlog
|
|
96
|
+
- `/sf:list` — see all specifications
|
|
97
97
|
```
|
|
98
98
|
Exit.
|
|
99
99
|
|
|
@@ -108,12 +108,12 @@ Update `.specflow/STATE.md`:
|
|
|
108
108
|
|
|
109
109
|
| Status | Recommended Command | Description |
|
|
110
110
|
|--------|---------------------|-------------|
|
|
111
|
-
| draft | `/sf
|
|
111
|
+
| draft | `/sf:audit` | Audit specification |
|
|
112
112
|
| auditing | Continue audit | Complete the audit |
|
|
113
|
-
| revision_requested | `/sf
|
|
114
|
-
| audited | `/sf
|
|
115
|
-
| running | Continue or `/sf
|
|
116
|
-
| review | `/sf
|
|
113
|
+
| revision_requested | `/sf:revise` | Address audit comments |
|
|
114
|
+
| audited | `/sf:run` | Implement specification |
|
|
115
|
+
| running | Continue or `/sf:review` | Complete implementation |
|
|
116
|
+
| review | `/sf:fix` or `/sf:done` | Address review or finalize |
|
|
117
117
|
|
|
118
118
|
## Step 7: Display Next Task
|
|
119
119
|
|
|
@@ -156,7 +156,7 @@ From {audit/review} v{N}:
|
|
|
156
156
|
|
|
157
157
|
**If status is revision_requested:**
|
|
158
158
|
```
|
|
159
|
-
**Tip:** Review audit comments with `/sf
|
|
159
|
+
**Tip:** Review audit comments with `/sf:show {ID}` before revising.
|
|
160
160
|
```
|
|
161
161
|
|
|
162
162
|
**If status is review:**
|
|
@@ -166,7 +166,7 @@ From {audit/review} v{N}:
|
|
|
166
166
|
|
|
167
167
|
**If complexity is large:**
|
|
168
168
|
```
|
|
169
|
-
**Tip:** Consider `/sf
|
|
169
|
+
**Tip:** Consider `/sf:split {ID}` to break into smaller specs.
|
|
170
170
|
```
|
|
171
171
|
|
|
172
172
|
</workflow>
|
package/commands/sf/pause.md
CHANGED
|
@@ -29,7 +29,7 @@ Save the current work context to enable seamless resumption later. Creates a pau
|
|
|
29
29
|
```
|
|
30
30
|
SpecFlow not initialized.
|
|
31
31
|
|
|
32
|
-
Run `/sf
|
|
32
|
+
Run `/sf:init` to start.
|
|
33
33
|
```
|
|
34
34
|
Exit.
|
|
35
35
|
|
|
@@ -192,7 +192,7 @@ Under Current Position, add:
|
|
|
192
192
|
|
|
193
193
|
**Session saved successfully.**
|
|
194
194
|
|
|
195
|
-
Resume with: `/sf
|
|
195
|
+
Resume with: `/sf:resume`
|
|
196
196
|
```
|
|
197
197
|
|
|
198
198
|
</workflow>
|
package/commands/sf/plan.md
CHANGED
|
@@ -23,7 +23,7 @@ Convert a to-do item from the backlog into a full specification. Reuses the spec
|
|
|
23
23
|
</context>
|
|
24
24
|
|
|
25
25
|
<arguments>
|
|
26
|
-
- `[ID or #]` — Optional. Either TODO-XXX ID or list number from `/sf
|
|
26
|
+
- `[ID or #]` — Optional. Either TODO-XXX ID or list number from `/sf:todos`. If omitted, shows todos and prompts for selection.
|
|
27
27
|
</arguments>
|
|
28
28
|
|
|
29
29
|
<workflow>
|
|
@@ -38,7 +38,7 @@ Convert a to-do item from the backlog into a full specification. Reuses the spec
|
|
|
38
38
|
```
|
|
39
39
|
SpecFlow not initialized.
|
|
40
40
|
|
|
41
|
-
Run `/sf
|
|
41
|
+
Run `/sf:init` to start.
|
|
42
42
|
```
|
|
43
43
|
Exit.
|
|
44
44
|
|
|
@@ -52,7 +52,7 @@ Exit.
|
|
|
52
52
|
```
|
|
53
53
|
No to-do items found.
|
|
54
54
|
|
|
55
|
-
Add ideas first with `/sf
|
|
55
|
+
Add ideas first with `/sf:todo "your idea"`.
|
|
56
56
|
```
|
|
57
57
|
Exit.
|
|
58
58
|
|
|
@@ -95,7 +95,7 @@ Read the selected todo:
|
|
|
95
95
|
```
|
|
96
96
|
Todo "{arg}" not found.
|
|
97
97
|
|
|
98
|
-
Use `/sf
|
|
98
|
+
Use `/sf:todos` to see available items.
|
|
99
99
|
```
|
|
100
100
|
Exit.
|
|
101
101
|
|
|
@@ -161,14 +161,14 @@ Update `*Last updated:` timestamp.
|
|
|
161
161
|
|
|
162
162
|
## Next Step
|
|
163
163
|
|
|
164
|
-
`/sf
|
|
164
|
+
`/sf:audit` — audit specification before implementation
|
|
165
165
|
|
|
166
166
|
{If complexity is large:}
|
|
167
167
|
|
|
168
168
|
### Warning
|
|
169
169
|
|
|
170
170
|
Specification is large (>150k tokens estimated).
|
|
171
|
-
Consider `/sf
|
|
171
|
+
Consider `/sf:split SPEC-{YYY}` to decompose.
|
|
172
172
|
```
|
|
173
173
|
|
|
174
174
|
</workflow>
|
|
@@ -183,9 +183,9 @@ Consider `/sf split SPEC-{YYY}` to decompose.
|
|
|
183
183
|
|
|
184
184
|
Read from TODO.md.
|
|
185
185
|
|
|
186
|
-
### Create Spec (same as /sf
|
|
186
|
+
### Create Spec (same as /sf:new)
|
|
187
187
|
|
|
188
|
-
Use `/sf
|
|
188
|
+
Use `/sf:new "{todo description}"` logic:
|
|
189
189
|
1. Generate SPEC-XXX ID
|
|
190
190
|
2. Create spec with todo context
|
|
191
191
|
3. Set priority from todo
|
package/commands/sf/priority.md
CHANGED
|
@@ -30,7 +30,7 @@ Interactively prioritize specifications and to-do items. Allows reordering, sett
|
|
|
30
30
|
```
|
|
31
31
|
SpecFlow not initialized.
|
|
32
32
|
|
|
33
|
-
Run `/sf
|
|
33
|
+
Run `/sf:init` to start.
|
|
34
34
|
```
|
|
35
35
|
Exit.
|
|
36
36
|
|
|
@@ -179,7 +179,7 @@ After changes:
|
|
|
179
179
|
|
|
180
180
|
---
|
|
181
181
|
|
|
182
|
-
Use `/sf
|
|
182
|
+
Use `/sf:next` to work on highest priority task.
|
|
183
183
|
```
|
|
184
184
|
|
|
185
185
|
</workflow>
|
package/commands/sf/resume.md
CHANGED
|
@@ -29,7 +29,7 @@ Restore the work context from the last pause. Reads the pause file, displays ful
|
|
|
29
29
|
```
|
|
30
30
|
SpecFlow not initialized.
|
|
31
31
|
|
|
32
|
-
Run `/sf
|
|
32
|
+
Run `/sf:init` to start.
|
|
33
33
|
```
|
|
34
34
|
Exit.
|
|
35
35
|
|
|
@@ -48,9 +48,9 @@ ls -1 .specflow/sessions/PAUSE-*.md 2>/dev/null | sort -r | head -1
|
|
|
48
48
|
No paused session found.
|
|
49
49
|
|
|
50
50
|
**Options:**
|
|
51
|
-
- `/sf
|
|
52
|
-
- `/sf
|
|
53
|
-
- `/sf
|
|
51
|
+
- `/sf:status` — view current state
|
|
52
|
+
- `/sf:next` — find next task to work on
|
|
53
|
+
- `/sf:list` — see all specifications
|
|
54
54
|
```
|
|
55
55
|
Exit.
|
|
56
56
|
|
|
@@ -228,7 +228,7 @@ Based on your notes and progress:
|
|
|
228
228
|
If more than 5 pause files exist, suggest cleanup:
|
|
229
229
|
|
|
230
230
|
```
|
|
231
|
-
**Note:** {N} old pause files in sessions/. Run `/sf
|
|
231
|
+
**Note:** {N} old pause files in sessions/. Run `/sf:history` to review or clean up.
|
|
232
232
|
```
|
|
233
233
|
|
|
234
234
|
</workflow>
|
package/commands/sf/review.md
CHANGED
|
@@ -32,7 +32,7 @@ Review the implementation of the active specification in a fresh context. The re
|
|
|
32
32
|
```
|
|
33
33
|
SpecFlow not initialized.
|
|
34
34
|
|
|
35
|
-
Run `/sf
|
|
35
|
+
Run `/sf:init` first.
|
|
36
36
|
```
|
|
37
37
|
Exit.
|
|
38
38
|
|
|
@@ -44,7 +44,7 @@ Read `.specflow/STATE.md` and extract Active Specification.
|
|
|
44
44
|
```
|
|
45
45
|
No active specification to review.
|
|
46
46
|
|
|
47
|
-
Run `/sf
|
|
47
|
+
Run `/sf:new "task description"` to create one.
|
|
48
48
|
```
|
|
49
49
|
Exit.
|
|
50
50
|
|
|
@@ -57,10 +57,10 @@ Read the active spec file: `.specflow/specs/SPEC-XXX.md`
|
|
|
57
57
|
Specification SPEC-XXX is not ready for review (status: {status}).
|
|
58
58
|
|
|
59
59
|
{If status is draft/auditing/revision_requested:}
|
|
60
|
-
Run `/sf
|
|
60
|
+
Run `/sf:run` first to implement the specification.
|
|
61
61
|
|
|
62
62
|
{If status is done:}
|
|
63
|
-
Specification already completed. Use `/sf
|
|
63
|
+
Specification already completed. Use `/sf:history` to view archived specs.
|
|
64
64
|
```
|
|
65
65
|
Exit.
|
|
66
66
|
|
|
@@ -72,7 +72,7 @@ Check that Execution Summary exists in spec:
|
|
|
72
72
|
```
|
|
73
73
|
No implementation found for SPEC-XXX.
|
|
74
74
|
|
|
75
|
-
Run `/sf
|
|
75
|
+
Run `/sf:run` to execute the specification first.
|
|
76
76
|
```
|
|
77
77
|
Exit.
|
|
78
78
|
|
|
@@ -108,7 +108,7 @@ The agent will:
|
|
|
108
108
|
|
|
109
109
|
## Step 7: Display Result
|
|
110
110
|
|
|
111
|
-
### If APPROVED:
|
|
111
|
+
### If APPROVED (no minor issues):
|
|
112
112
|
|
|
113
113
|
```
|
|
114
114
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
@@ -133,7 +133,38 @@ The agent will:
|
|
|
133
133
|
|
|
134
134
|
## Next Step
|
|
135
135
|
|
|
136
|
-
`/sf
|
|
136
|
+
`/sf:done` — finalize and archive specification
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### If APPROVED (with minor suggestions):
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
143
|
+
REVIEW PASSED
|
|
144
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
145
|
+
|
|
146
|
+
**Specification:** SPEC-XXX
|
|
147
|
+
**Result:** APPROVED
|
|
148
|
+
|
|
149
|
+
### Verified
|
|
150
|
+
|
|
151
|
+
- [✓] All acceptance criteria met
|
|
152
|
+
- [✓] All files created
|
|
153
|
+
- [✓] All deletions performed
|
|
154
|
+
- [✓] Code quality acceptable
|
|
155
|
+
|
|
156
|
+
### Minor Suggestions (Optional)
|
|
157
|
+
|
|
158
|
+
1. {Suggestion 1}
|
|
159
|
+
2. {Suggestion 2}
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Next Steps
|
|
164
|
+
|
|
165
|
+
Choose one:
|
|
166
|
+
• `/sf:done` — finalize and archive as-is
|
|
167
|
+
• `/sf:fix` — apply minor suggestions first ({N} items)
|
|
137
168
|
```
|
|
138
169
|
|
|
139
170
|
### If CHANGES_REQUESTED:
|
|
@@ -171,12 +202,12 @@ The agent will:
|
|
|
171
202
|
|
|
172
203
|
## Next Step
|
|
173
204
|
|
|
174
|
-
`/sf
|
|
205
|
+
`/sf:fix` — address the issues
|
|
175
206
|
|
|
176
207
|
Options:
|
|
177
|
-
- `/sf
|
|
178
|
-
- `/sf
|
|
179
|
-
- `/sf
|
|
208
|
+
- `/sf:fix all` — apply all fixes
|
|
209
|
+
- `/sf:fix 1,2` — fix specific issues
|
|
210
|
+
- `/sf:fix [instructions]` — custom fixes
|
|
180
211
|
```
|
|
181
212
|
|
|
182
213
|
</workflow>
|
|
@@ -239,8 +270,8 @@ Append Review History to spec.
|
|
|
239
270
|
|
|
240
271
|
### Update STATE.md
|
|
241
272
|
|
|
242
|
-
- If APPROVED: Status → "done", Next Step → "/sf
|
|
243
|
-
- If CHANGES_REQUESTED: Status → "review", Next Step → "/sf
|
|
273
|
+
- If APPROVED: Status → "done", Next Step → "/sf:done"
|
|
274
|
+
- If CHANGES_REQUESTED: Status → "review", Next Step → "/sf:fix"
|
|
244
275
|
|
|
245
276
|
</fallback>
|
|
246
277
|
|
package/commands/sf/revise.md
CHANGED
|
@@ -33,7 +33,7 @@ Revise the active specification based on audit feedback. Can apply all comments,
|
|
|
33
33
|
```
|
|
34
34
|
SpecFlow not initialized.
|
|
35
35
|
|
|
36
|
-
Run `/sf
|
|
36
|
+
Run `/sf:init` first.
|
|
37
37
|
```
|
|
38
38
|
Exit.
|
|
39
39
|
|
|
@@ -45,7 +45,7 @@ Read `.specflow/STATE.md` and extract Active Specification.
|
|
|
45
45
|
```
|
|
46
46
|
No active specification to revise.
|
|
47
47
|
|
|
48
|
-
Run `/sf
|
|
48
|
+
Run `/sf:new "task description"` to create one.
|
|
49
49
|
```
|
|
50
50
|
Exit.
|
|
51
51
|
|
|
@@ -57,7 +57,7 @@ Read the active spec file: `.specflow/specs/SPEC-XXX.md`
|
|
|
57
57
|
```
|
|
58
58
|
Specification SPEC-XXX cannot be revised (status: {status}).
|
|
59
59
|
|
|
60
|
-
Use `/sf
|
|
60
|
+
Use `/sf:status` to see current state.
|
|
61
61
|
```
|
|
62
62
|
Exit.
|
|
63
63
|
|
|
@@ -69,7 +69,7 @@ Find the most recent "Audit v[N]" section in Audit History.
|
|
|
69
69
|
```
|
|
70
70
|
Specification SPEC-XXX has no audit history.
|
|
71
71
|
|
|
72
|
-
Run `/sf
|
|
72
|
+
Run `/sf:audit` first to get feedback.
|
|
73
73
|
```
|
|
74
74
|
Exit.
|
|
75
75
|
|
|
@@ -167,7 +167,7 @@ The agent will:
|
|
|
167
167
|
|
|
168
168
|
## Next Step
|
|
169
169
|
|
|
170
|
-
`/sf
|
|
170
|
+
`/sf:audit` — re-audit revised specification
|
|
171
171
|
```
|
|
172
172
|
|
|
173
173
|
</workflow>
|
|
@@ -216,7 +216,7 @@ In spec frontmatter: `status: auditing`
|
|
|
216
216
|
|
|
217
217
|
In STATE.md:
|
|
218
218
|
- Status → "auditing"
|
|
219
|
-
- Next Step → "/sf
|
|
219
|
+
- Next Step → "/sf:audit"
|
|
220
220
|
|
|
221
221
|
</fallback>
|
|
222
222
|
|
package/commands/sf/run.md
CHANGED
|
@@ -34,7 +34,7 @@ Execute the active specification by implementing all requirements. Creates atomi
|
|
|
34
34
|
```
|
|
35
35
|
SpecFlow not initialized.
|
|
36
36
|
|
|
37
|
-
Run `/sf
|
|
37
|
+
Run `/sf:init` first.
|
|
38
38
|
```
|
|
39
39
|
Exit.
|
|
40
40
|
|
|
@@ -46,7 +46,7 @@ Read `.specflow/STATE.md` and extract Active Specification.
|
|
|
46
46
|
```
|
|
47
47
|
No active specification to execute.
|
|
48
48
|
|
|
49
|
-
Run `/sf
|
|
49
|
+
Run `/sf:new "task description"` to create one.
|
|
50
50
|
```
|
|
51
51
|
Exit.
|
|
52
52
|
|
|
@@ -93,7 +93,7 @@ Continue anyway?
|
|
|
93
93
|
|
|
94
94
|
Use AskUserQuestion with options:
|
|
95
95
|
- "Yes, proceed anyway" → continue, log warning
|
|
96
|
-
- "No, run audit first" → exit with `/sf
|
|
96
|
+
- "No, run audit first" → exit with `/sf:audit` suggestion
|
|
97
97
|
|
|
98
98
|
**If user proceeds anyway:**
|
|
99
99
|
Log in STATE.md Warnings table:
|
|
@@ -200,7 +200,7 @@ The agent will:
|
|
|
200
200
|
|
|
201
201
|
## Next Step
|
|
202
202
|
|
|
203
|
-
`/sf
|
|
203
|
+
`/sf:review` — audit the implementation
|
|
204
204
|
```
|
|
205
205
|
|
|
206
206
|
</workflow>
|
|
@@ -248,7 +248,7 @@ Append Execution Summary to spec.
|
|
|
248
248
|
### Update STATE.md
|
|
249
249
|
|
|
250
250
|
- Status → "review"
|
|
251
|
-
- Next Step → "/sf
|
|
251
|
+
- Next Step → "/sf:review"
|
|
252
252
|
|
|
253
253
|
</fallback>
|
|
254
254
|
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sf:scan
|
|
3
|
+
description: Deep codebase analysis — identifies concerns, tech debt, and improvement opportunities
|
|
4
|
+
argument-hint: "[--focus=concerns|quality|arch|all]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<purpose>
|
|
8
|
+
Perform deep analysis of the codebase to identify technical debt, code quality issues, architectural problems, and improvement opportunities. Results are saved to `.specflow/SCAN.md` for use in creating specifications.
|
|
9
|
+
</purpose>
|
|
10
|
+
|
|
11
|
+
<context>
|
|
12
|
+
@.specflow/PROJECT.md
|
|
13
|
+
@.specflow/STATE.md
|
|
14
|
+
@~/.claude/specflow-cc/templates/scan.md
|
|
15
|
+
@~/.claude/specflow-cc/agents/codebase-scanner.md
|
|
16
|
+
</context>
|
|
17
|
+
|
|
18
|
+
<workflow>
|
|
19
|
+
|
|
20
|
+
## 1. Parse Arguments
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
FOCUS = $ARGUMENTS or "all"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Valid focus areas:
|
|
27
|
+
- `concerns` — Technical debt, bugs, security issues
|
|
28
|
+
- `quality` — Code quality, conventions, test coverage
|
|
29
|
+
- `arch` — Architecture, structure, patterns
|
|
30
|
+
- `all` — Full analysis (default)
|
|
31
|
+
|
|
32
|
+
## 2. Check Prerequisites
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
[ -d .specflow ] && echo "INITIALIZED" || echo "NOT_INITIALIZED"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**If NOT_INITIALIZED:**
|
|
39
|
+
```
|
|
40
|
+
⚠️ Project not initialized
|
|
41
|
+
|
|
42
|
+
Run /sf:init first to set up SpecFlow.
|
|
43
|
+
```
|
|
44
|
+
STOP.
|
|
45
|
+
|
|
46
|
+
## 3. Check Existing Scan
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
[ -f .specflow/SCAN.md ] && echo "EXISTS" || echo "NEW"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**If EXISTS:**
|
|
53
|
+
Ask user:
|
|
54
|
+
```
|
|
55
|
+
📊 Previous scan found (.specflow/SCAN.md)
|
|
56
|
+
|
|
57
|
+
Options:
|
|
58
|
+
1) Refresh — Run new scan (overwrites existing)
|
|
59
|
+
2) View — Show existing scan results
|
|
60
|
+
3) Cancel
|
|
61
|
+
|
|
62
|
+
Choice?
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## 4. Launch Scanner Agent
|
|
66
|
+
|
|
67
|
+
Use the Task tool to spawn codebase-scanner agent:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
subagent_type="sf-codebase-scanner"
|
|
71
|
+
prompt="""
|
|
72
|
+
Focus: {FOCUS}
|
|
73
|
+
Project: {from PROJECT.md}
|
|
74
|
+
|
|
75
|
+
Scan the codebase and write findings to .specflow/SCAN.md
|
|
76
|
+
|
|
77
|
+
Return only confirmation when done.
|
|
78
|
+
"""
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## 5. Verify Results
|
|
82
|
+
|
|
83
|
+
After agent completes:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
[ -f .specflow/SCAN.md ] && wc -l .specflow/SCAN.md
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## 6. Display Summary
|
|
90
|
+
|
|
91
|
+
Read `.specflow/SCAN.md` and extract summary:
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
📊 Codebase Scan Complete
|
|
95
|
+
|
|
96
|
+
Focus: {FOCUS}
|
|
97
|
+
Lines analyzed: ~{estimate}
|
|
98
|
+
|
|
99
|
+
┌─────────────────────────────────────────────┐
|
|
100
|
+
│ Summary │
|
|
101
|
+
├─────────────────────────────────────────────┤
|
|
102
|
+
│ Tech Debt: {count} issues │
|
|
103
|
+
│ Quality Issues: {count} findings │
|
|
104
|
+
│ Security: {count} considerations │
|
|
105
|
+
│ Test Gaps: {count} areas │
|
|
106
|
+
└─────────────────────────────────────────────┘
|
|
107
|
+
|
|
108
|
+
Top Priority Issues:
|
|
109
|
+
1. {issue 1}
|
|
110
|
+
2. {issue 2}
|
|
111
|
+
3. {issue 3}
|
|
112
|
+
|
|
113
|
+
📁 Full report: .specflow/SCAN.md
|
|
114
|
+
|
|
115
|
+
Next steps:
|
|
116
|
+
• /sf:new "Fix: {top concern}" — Create spec for top issue
|
|
117
|
+
• /sf:todo {concern} — Add to backlog for later
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
</workflow>
|
|
121
|
+
|
|
122
|
+
<fallback>
|
|
123
|
+
If agent cannot be spawned, perform scan directly:
|
|
124
|
+
|
|
125
|
+
1. Explore codebase structure
|
|
126
|
+
2. Search for TODO/FIXME comments
|
|
127
|
+
3. Identify large/complex files
|
|
128
|
+
4. Check test coverage gaps
|
|
129
|
+
5. Look for code smells
|
|
130
|
+
6. Write findings to `.specflow/SCAN.md`
|
|
131
|
+
</fallback>
|
|
132
|
+
|
|
133
|
+
<output_format>
|
|
134
|
+
**Success:**
|
|
135
|
+
```
|
|
136
|
+
📊 Codebase Scan Complete
|
|
137
|
+
|
|
138
|
+
[Summary table]
|
|
139
|
+
[Top issues]
|
|
140
|
+
[Next steps]
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**No issues found:**
|
|
144
|
+
```
|
|
145
|
+
✅ Codebase scan complete — no critical concerns found
|
|
146
|
+
|
|
147
|
+
Minor observations saved to .specflow/SCAN.md
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**Error:**
|
|
151
|
+
```
|
|
152
|
+
❌ Scan failed: {reason}
|
|
153
|
+
|
|
154
|
+
Try running manually or check .specflow/ permissions.
|
|
155
|
+
```
|
|
156
|
+
</output_format>
|
|
157
|
+
|
|
158
|
+
<success_criteria>
|
|
159
|
+
- [ ] Focus area parsed correctly
|
|
160
|
+
- [ ] Scanner agent spawned (or fallback executed)
|
|
161
|
+
- [ ] .specflow/SCAN.md created with findings
|
|
162
|
+
- [ ] Summary displayed to user
|
|
163
|
+
- [ ] Next steps provided
|
|
164
|
+
</success_criteria>
|
package/commands/sf/show.md
CHANGED
|
@@ -31,7 +31,7 @@ Display the full content of a specification including context, task, requirement
|
|
|
31
31
|
```
|
|
32
32
|
SpecFlow not initialized.
|
|
33
33
|
|
|
34
|
-
Run `/sf
|
|
34
|
+
Run `/sf:init` to start.
|
|
35
35
|
```
|
|
36
36
|
Exit.
|
|
37
37
|
|
|
@@ -47,8 +47,8 @@ Read `.specflow/STATE.md` and get Active Specification.
|
|
|
47
47
|
```
|
|
48
48
|
No specification specified and no active specification.
|
|
49
49
|
|
|
50
|
-
Use `/sf
|
|
51
|
-
or `/sf
|
|
50
|
+
Use `/sf:show SPEC-XXX` to view a specific spec
|
|
51
|
+
or `/sf:list` to see all specifications.
|
|
52
52
|
```
|
|
53
53
|
Exit.
|
|
54
54
|
|
|
@@ -66,7 +66,7 @@ Exit.
|
|
|
66
66
|
```
|
|
67
67
|
Specification {ID} not found.
|
|
68
68
|
|
|
69
|
-
Use `/sf
|
|
69
|
+
Use `/sf:list` to see available specifications.
|
|
70
70
|
```
|
|
71
71
|
Exit.
|
|
72
72
|
|
|
@@ -101,12 +101,12 @@ Based on current status:
|
|
|
101
101
|
|
|
102
102
|
| Status | Recommended Action |
|
|
103
103
|
|--------|-------------------|
|
|
104
|
-
| draft | `/sf
|
|
105
|
-
| auditing | Complete audit or `/sf
|
|
106
|
-
| revision_requested | `/sf
|
|
107
|
-
| audited | `/sf
|
|
108
|
-
| running | Continue implementation or `/sf
|
|
109
|
-
| review | `/sf
|
|
104
|
+
| draft | `/sf:audit` — audit specification |
|
|
105
|
+
| auditing | Complete audit or `/sf:revise` |
|
|
106
|
+
| revision_requested | `/sf:revise` — address comments |
|
|
107
|
+
| audited | `/sf:run` — implement specification |
|
|
108
|
+
| running | Continue implementation or `/sf:review` |
|
|
109
|
+
| review | `/sf:fix` or `/sf:done` |
|
|
110
110
|
| done | No action (archived) |
|
|
111
111
|
|
|
112
112
|
## Step 7: Display Specification
|
|
@@ -174,8 +174,8 @@ Based on current status:
|
|
|
174
174
|
```
|
|
175
175
|
This specification is complete and archived.
|
|
176
176
|
|
|
177
|
-
To view active specs: `/sf
|
|
178
|
-
To see completed history: `/sf
|
|
177
|
+
To view active specs: `/sf:list`
|
|
178
|
+
To see completed history: `/sf:history`
|
|
179
179
|
```
|
|
180
180
|
|
|
181
181
|
**If spec has outstanding issues:**
|
|
@@ -186,7 +186,7 @@ From {audit/review} v{N}:
|
|
|
186
186
|
1. {issue}
|
|
187
187
|
2. {issue}
|
|
188
188
|
|
|
189
|
-
Address with `/sf
|
|
189
|
+
Address with `/sf:revise` or `/sf:fix`.
|
|
190
190
|
```
|
|
191
191
|
|
|
192
192
|
</workflow>
|