specflow-cc 1.0.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.
@@ -0,0 +1,234 @@
1
+ ---
2
+ name: sf:deps
3
+ description: Show dependency graph between specifications
4
+ allowed-tools:
5
+ - Read
6
+ - Bash
7
+ - Glob
8
+ - Grep
9
+ ---
10
+
11
+ <purpose>
12
+ Display the dependency graph between specifications. Shows which specs can be worked on immediately (no dependencies), which are blocked, and the chains of dependent work. Helps plan execution order.
13
+ </purpose>
14
+
15
+ <context>
16
+ @.specflow/STATE.md
17
+ @.specflow/specs/SPEC-*.md
18
+ </context>
19
+
20
+ <arguments>
21
+ - `[ID]` — Specification ID to show dependencies for. Optional — shows full graph if omitted.
22
+ </arguments>
23
+
24
+ <workflow>
25
+
26
+ ## Step 1: Verify Initialization
27
+
28
+ ```bash
29
+ [ -d .specflow ] && echo "OK" || echo "NOT_INITIALIZED"
30
+ ```
31
+
32
+ **If NOT_INITIALIZED:**
33
+ ```
34
+ SpecFlow not initialized.
35
+
36
+ Run `/sf init` first.
37
+ ```
38
+ Exit.
39
+
40
+ ## Step 2: Scan All Specifications
41
+
42
+ ```bash
43
+ ls .specflow/specs/SPEC-*.md 2>/dev/null
44
+ ```
45
+
46
+ **If no specs:**
47
+ ```
48
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
49
+ DEPENDENCY GRAPH
50
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
51
+
52
+ No specifications found.
53
+
54
+ Create your first spec: `/sf new "task description"`
55
+ ```
56
+ Exit.
57
+
58
+ ## Step 3: Parse Dependencies
59
+
60
+ For each specification, read frontmatter and extract:
61
+ - `id` — Specification ID
62
+ - `status` — Current status
63
+ - `depends_on` — Array of dependency IDs (may be empty)
64
+ - `title` — From first heading
65
+
66
+ Build dependency map:
67
+ ```
68
+ {
69
+ "SPEC-001a": { status: "done", depends_on: [], title: "..." },
70
+ "SPEC-001b": { status: "running", depends_on: ["SPEC-001a"], title: "..." },
71
+ "SPEC-001c": { status: "draft", depends_on: ["SPEC-001b"], title: "..." }
72
+ }
73
+ ```
74
+
75
+ ## Step 4: Branch Based on Arguments
76
+
77
+ **If specific ID provided:** Go to Step 5a (Specific View)
78
+ **If no ID provided:** Go to Step 5b (Full Graph View)
79
+
80
+ ## Step 5a: Specific Spec Dependencies
81
+
82
+ **Check spec exists:**
83
+ ```bash
84
+ [ -f ".specflow/specs/{ID}.md" ] && echo "FOUND" || echo "NOT_FOUND"
85
+ ```
86
+
87
+ **If NOT_FOUND:**
88
+ ```
89
+ Specification {ID} not found.
90
+
91
+ Use `/sf list` to see available specifications.
92
+ ```
93
+ Exit.
94
+
95
+ **Display specific dependencies:**
96
+
97
+ ```
98
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
99
+ DEPENDENCIES: {ID}
100
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
101
+
102
+ **Spec:** {ID} — {title}
103
+ **Status:** {status}
104
+
105
+ ## Depends On (upstream)
106
+
107
+ {If no dependencies:}
108
+ None — this specification can be worked on immediately.
109
+
110
+ {If has dependencies:}
111
+ | ID | Title | Status | |
112
+ |-----------|--------------------------|---------|-----|
113
+ | SPEC-XXX | {title} | done | ✓ |
114
+ | SPEC-YYY | {title} | running | ← blocking |
115
+
116
+ ## Depended By (downstream)
117
+
118
+ {If nothing depends on this:}
119
+ None — no other specifications depend on this.
120
+
121
+ {If has dependents:}
122
+ | ID | Title | Status |
123
+ |-----------|--------------------------|---------|
124
+ | SPEC-ZZZ | {title} | blocked |
125
+
126
+ ---
127
+
128
+ {If blocked:}
129
+ **Blocked by:** {blocking spec ID} must complete first.
130
+
131
+ When {blocking ID} is done, run: `/sf run {ID}`
132
+
133
+ {If ready:}
134
+ **Ready:** All dependencies satisfied.
135
+
136
+ Next: `/sf audit {ID}` or `/sf run {ID}`
137
+
138
+ {If done:}
139
+ **Complete:** This specification is done.
140
+
141
+ {If has dependents that are now ready:}
142
+ **Unblocked:** The following can now proceed:
143
+ - {dependent ID}
144
+ ```
145
+ Exit.
146
+
147
+ ## Step 5b: Full Graph View
148
+
149
+ ### Categorize Specs
150
+
151
+ **Independent (no depends_on):**
152
+ - Can be started immediately
153
+ - Status: draft, audited, etc.
154
+
155
+ **In Chains (has depends_on or is depended upon):**
156
+ - Part of dependency sequences
157
+ - Show chains visually
158
+
159
+ **Blocked (depends on incomplete spec):**
160
+ - Cannot proceed until dependency completes
161
+
162
+ ### Build Chain Visualization
163
+
164
+ For each chain, create visual:
165
+ ```
166
+ SPEC-001a [done] → SPEC-001b [running] → SPEC-001c [blocked]
167
+ ↑ you are here
168
+ ```
169
+
170
+ ### Display Full Graph
171
+
172
+ ```
173
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
174
+ DEPENDENCY GRAPH
175
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
176
+
177
+ ## Independent (can start now)
178
+
179
+ {If any:}
180
+ | ID | Title | Status |
181
+ |----------|--------------------------|---------|
182
+ | SPEC-002 | API rate limiting | draft |
183
+ | SPEC-005 | Settings page | audited |
184
+
185
+ {If none:}
186
+ None — all specifications are in dependency chains.
187
+
188
+ ## Chains
189
+
190
+ {For each chain:}
191
+ ```
192
+ SPEC-001a [done] → SPEC-001b [running] → SPEC-001c [blocked] → SPEC-001d [blocked]
193
+ ↑ current
194
+ ```
195
+
196
+ {If parallel chains:}
197
+ ```
198
+ SPEC-003 [audited] → SPEC-004 [draft]
199
+ ```
200
+
201
+ ## Summary
202
+
203
+ | Category | Count |
204
+ |-------------|-------|
205
+ | Ready | {N} |
206
+ | In Progress | {N} |
207
+ | Blocked | {N} |
208
+ | Done | {N} |
209
+
210
+ ---
211
+
212
+ **Next actionable:**
213
+ {List specs that are ready to work on, sorted by priority}
214
+
215
+ - `/sf run SPEC-001b` (running)
216
+ - `/sf audit SPEC-005` (audited)
217
+ - `/sf audit SPEC-002` (draft)
218
+
219
+ **Tip:** `/sf deps SPEC-XXX` for details on a specific spec.
220
+ ```
221
+
222
+ </workflow>
223
+
224
+ <success_criteria>
225
+ - [ ] Initialization verified
226
+ - [ ] All specs scanned and parsed
227
+ - [ ] Dependencies extracted from frontmatter
228
+ - [ ] Graph built correctly (no circular deps assumed)
229
+ - [ ] Independent specs identified
230
+ - [ ] Chains visualized clearly
231
+ - [ ] Blocked specs identified with blocker
232
+ - [ ] Summary statistics provided
233
+ - [ ] Next actionable specs suggested
234
+ </success_criteria>
@@ -0,0 +1,271 @@
1
+ ---
2
+ name: sf:done
3
+ description: Finalize specification, archive, and update state
4
+ allowed-tools:
5
+ - Read
6
+ - Write
7
+ - Bash
8
+ - Glob
9
+ - Grep
10
+ - AskUserQuestion
11
+ ---
12
+
13
+ <purpose>
14
+ Finalize the completed specification. Archives the spec, updates STATE.md, extracts decisions, and prepares for the next task.
15
+ </purpose>
16
+
17
+ <context>
18
+ @.specflow/STATE.md
19
+ @.specflow/PROJECT.md
20
+ </context>
21
+
22
+ <workflow>
23
+
24
+ ## Step 1: Verify Initialization
25
+
26
+ ```bash
27
+ [ -d .specflow ] && echo "OK" || echo "NOT_INITIALIZED"
28
+ ```
29
+
30
+ **If NOT_INITIALIZED:**
31
+ ```
32
+ SpecFlow not initialized.
33
+
34
+ Run `/sf init` first.
35
+ ```
36
+ Exit.
37
+
38
+ ## Step 2: Get Active Specification
39
+
40
+ Read `.specflow/STATE.md` and extract Active Specification.
41
+
42
+ **If no active specification:**
43
+ ```
44
+ No active specification to finalize.
45
+
46
+ Run `/sf new "task description"` to create one.
47
+ ```
48
+ Exit.
49
+
50
+ ## Step 3: Load Specification
51
+
52
+ Read the active spec file: `.specflow/specs/SPEC-XXX.md`
53
+
54
+ ## Step 4: Check Review Status
55
+
56
+ **If status is "done" (already approved):**
57
+ Continue to finalization.
58
+
59
+ **If status is "review" but has APPROVED review:**
60
+ Continue to finalization.
61
+
62
+ **If status is NOT approved:**
63
+ Show warning:
64
+
65
+ ```
66
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
67
+ WARNING: Specification has not passed review
68
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
69
+
70
+ **Specification:** SPEC-XXX
71
+ **Current Status:** {status}
72
+
73
+ {If review exists with issues:}
74
+ ### Outstanding Issues
75
+
76
+ From last review (v{N}):
77
+
78
+ 1. {Critical issue}
79
+ 2. {Major issue}
80
+
81
+ ---
82
+
83
+ Proceeding without review approval may result in:
84
+ - Incomplete or buggy implementation in production
85
+ - Technical debt
86
+
87
+ Continue anyway?
88
+ ```
89
+
90
+ Use AskUserQuestion with options:
91
+ - "Yes, finalize anyway" → continue, log warning
92
+ - "No, run review first" → exit with `/sf review` suggestion
93
+
94
+ **If user proceeds anyway:**
95
+ Log in STATE.md Warnings table:
96
+ ```
97
+ | {date} | SPEC-XXX | Finalized without review approval |
98
+ ```
99
+
100
+ ## Step 5: Create Archive Directory
101
+
102
+ ```bash
103
+ mkdir -p .specflow/archive
104
+ ```
105
+
106
+ ## Step 6: Update Specification Status
107
+
108
+ Update frontmatter:
109
+ - status → "done"
110
+
111
+ Add completion timestamp:
112
+
113
+ ```markdown
114
+ ---
115
+
116
+ ## Completion
117
+
118
+ **Completed:** {date} {time}
119
+ **Total Commits:** {count from Execution Summary}
120
+ **Review Cycles:** {count of Review v[N] entries}
121
+ ```
122
+
123
+ ## Step 7: Extract Decisions
124
+
125
+ Scan specification for important decisions:
126
+ - Technology choices mentioned in Context or Assumptions
127
+ - Patterns established during implementation
128
+ - Constraints discovered
129
+
130
+ If significant decisions found, add to STATE.md Decisions table:
131
+
132
+ ```markdown
133
+ | {date} | SPEC-XXX | {decision description} |
134
+ ```
135
+
136
+ ## Step 8: Archive Specification
137
+
138
+ Move spec to archive:
139
+
140
+ ```bash
141
+ mv .specflow/specs/SPEC-XXX.md .specflow/archive/
142
+ ```
143
+
144
+ ## Step 9: Update STATE.md
145
+
146
+ ### Clear Active Specification
147
+
148
+ - Active Specification → "none"
149
+ - Status → "idle"
150
+ - Next Step → "/sf new or /sf next"
151
+
152
+ ### Remove from Queue
153
+
154
+ Remove SPEC-XXX row from Queue table.
155
+
156
+ ### Update Project Patterns (if applicable)
157
+
158
+ If implementation established new patterns, add to Project Patterns section.
159
+
160
+ ## Step 10: Create Final Commit (if needed)
161
+
162
+ Check for uncommitted changes:
163
+
164
+ ```bash
165
+ git status --porcelain
166
+ ```
167
+
168
+ If changes exist:
169
+
170
+ ```bash
171
+ git add .specflow/
172
+ git commit -m "docs(sf): complete SPEC-XXX
173
+
174
+ - Archived specification
175
+ - Updated STATE.md
176
+ "
177
+ ```
178
+
179
+ ## Step 11: Display Completion Summary
180
+
181
+ ```
182
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
183
+ SPECIFICATION COMPLETED
184
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
185
+
186
+ **Specification:** SPEC-XXX
187
+ **Title:** {title}
188
+ **Type:** {feature|refactor|bugfix}
189
+
190
+ ### Summary
191
+
192
+ - **Files created:** {count}
193
+ - **Files modified:** {count}
194
+ - **Files deleted:** {count}
195
+ - **Commits:** {count}
196
+ - **Audit cycles:** {count}
197
+ - **Review cycles:** {count}
198
+
199
+ ### Archived To
200
+
201
+ `.specflow/archive/SPEC-XXX.md`
202
+
203
+ {If decisions extracted:}
204
+ ### Decisions Recorded
205
+
206
+ - {decision 1}
207
+ - {decision 2}
208
+
209
+ ---
210
+
211
+ ## Queue Status
212
+
213
+ {If queue has more specs:}
214
+ **Next in queue:** SPEC-YYY — {title}
215
+
216
+ Run `/sf next` to start the next specification.
217
+
218
+ {If queue is empty:}
219
+ Queue is empty.
220
+
221
+ Run `/sf new "task"` to create a new specification
222
+ or `/sf todos` to see pending ideas.
223
+ ```
224
+
225
+ </workflow>
226
+
227
+ <fallback>
228
+
229
+ ## Inline Finalization
230
+
231
+ ### Update Spec
232
+
233
+ Set frontmatter status to "done".
234
+ Add Completion section with timestamp.
235
+
236
+ ### Archive
237
+
238
+ ```bash
239
+ mkdir -p .specflow/archive
240
+ mv .specflow/specs/SPEC-XXX.md .specflow/archive/
241
+ ```
242
+
243
+ ### Update STATE.md
244
+
245
+ 1. Set Active Specification to "none"
246
+ 2. Set Status to "idle"
247
+ 3. Set Next Step to "/sf new or /sf next"
248
+ 4. Remove from Queue table
249
+ 5. Add any extracted decisions
250
+
251
+ ### Commit
252
+
253
+ ```bash
254
+ git add .specflow/
255
+ git commit -m "docs(sf): complete SPEC-XXX"
256
+ ```
257
+
258
+ </fallback>
259
+
260
+ <success_criteria>
261
+ - [ ] Active specification identified
262
+ - [ ] Review status checked (warning if not approved)
263
+ - [ ] Spec status updated to "done"
264
+ - [ ] Completion section added
265
+ - [ ] Decisions extracted (if any)
266
+ - [ ] Spec moved to archive
267
+ - [ ] STATE.md updated (cleared active, removed from queue)
268
+ - [ ] Final commit created
269
+ - [ ] Clear completion summary shown
270
+ - [ ] Next steps provided
271
+ </success_criteria>