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,248 @@
1
+ ---
2
+ name: sf:resume
3
+ description: Restore context from last pause and continue work
4
+ allowed-tools:
5
+ - Read
6
+ - Write
7
+ - Bash
8
+ - Glob
9
+ - AskUserQuestion
10
+ ---
11
+
12
+ <purpose>
13
+ Restore the work context from the last pause. Reads the pause file, displays full context summary, verifies current state matches, and provides clear next steps. Essential for seamless session continuity.
14
+ </purpose>
15
+
16
+ <context>
17
+ @.specflow/STATE.md
18
+ </context>
19
+
20
+ <workflow>
21
+
22
+ ## Step 1: Verify Initialization
23
+
24
+ ```bash
25
+ [ -d .specflow ] && echo "OK" || echo "NOT_INITIALIZED"
26
+ ```
27
+
28
+ **If NOT_INITIALIZED:**
29
+ ```
30
+ SpecFlow not initialized.
31
+
32
+ Run `/sf init` to start.
33
+ ```
34
+ Exit.
35
+
36
+ ## Step 2: Find Latest Pause File
37
+
38
+ ```bash
39
+ ls -1 .specflow/sessions/PAUSE-*.md 2>/dev/null | sort -r | head -1
40
+ ```
41
+
42
+ **If no pause files found:**
43
+ ```
44
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
45
+ NO PAUSED SESSION
46
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
47
+
48
+ No paused session found.
49
+
50
+ **Options:**
51
+ - `/sf status` — view current state
52
+ - `/sf next` — find next task to work on
53
+ - `/sf list` — see all specifications
54
+ ```
55
+ Exit.
56
+
57
+ ## Step 3: Read Pause File
58
+
59
+ Parse the pause file and extract:
60
+ - Timestamp
61
+ - Specification ID and title
62
+ - Status at pause
63
+ - Progress (criteria checked/total)
64
+ - Recent changes list
65
+ - User notes
66
+ - Conversation summary
67
+
68
+ ## Step 4: Calculate Time Since Pause
69
+
70
+ Calculate elapsed time:
71
+ - If < 1 hour: "X minutes ago"
72
+ - If < 24 hours: "X hours ago"
73
+ - If < 7 days: "X days ago"
74
+ - Otherwise: show date
75
+
76
+ ## Step 5: Verify Current State
77
+
78
+ Read `.specflow/STATE.md` and compare:
79
+ - Active Specification: same or different?
80
+ - Status: same or different?
81
+
82
+ ### If State Matches
83
+
84
+ Continue to Step 7.
85
+
86
+ ### If State Changed
87
+
88
+ Display warning:
89
+
90
+ ```
91
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
92
+ STATE CHANGED SINCE PAUSE
93
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
94
+
95
+ **Pause State:**
96
+ - Specification: {SPEC-XXX}
97
+ - Status: {status_at_pause}
98
+
99
+ **Current State:**
100
+ - Specification: {SPEC-YYY or same}
101
+ - Status: {current_status}
102
+
103
+ **Changes Detected:**
104
+ - {description of what changed}
105
+
106
+ ---
107
+ ```
108
+
109
+ Use AskUserQuestion:
110
+ - header: "State"
111
+ - question: "How should we proceed?"
112
+ - options:
113
+ 1. "Use current state (recommended)" — Accept changes, show current context
114
+ 2. "Restore pause state" — Revert STATE.md to pause state
115
+ 3. "View diff" — Show detailed differences
116
+
117
+ **If "Restore pause state":**
118
+ Update STATE.md to match pause state.
119
+
120
+ **If "View diff":**
121
+ Show detailed comparison and ask again.
122
+
123
+ ## Step 6: Update STATE.md (if needed)
124
+
125
+ Ensure active specification and status match the resumed context.
126
+
127
+ ## Step 7: Load Current Specification Details
128
+
129
+ If specification exists, read `.specflow/specs/SPEC-XXX.md`:
130
+ - Full acceptance criteria with current checkbox state
131
+ - Context and Task sections
132
+ - Any audit/review history
133
+
134
+ ## Step 8: Check Current Git State
135
+
136
+ ```bash
137
+ git status --porcelain 2>/dev/null
138
+ ```
139
+
140
+ Compare with pause state changes to identify:
141
+ - Files still modified
142
+ - New changes since pause
143
+
144
+ ## Step 9: Display Full Resume Context
145
+
146
+ ```
147
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
148
+ SESSION RESUMED
149
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
150
+
151
+ **Restoring:** PAUSE-{YYYYMMDD}-{HHMMSS} ({time_ago})
152
+
153
+ ---
154
+
155
+ ## Context
156
+
157
+ **Specification:** {SPEC-XXX} — {title}
158
+ **Status:** {status}
159
+ **Priority:** {priority} | **Complexity:** {complexity}
160
+
161
+ ---
162
+
163
+ ## Where You Left Off
164
+
165
+ {Conversation summary from pause file}
166
+
167
+ {If user notes exist:}
168
+ **Your Notes:**
169
+ > {notes}
170
+
171
+ ---
172
+
173
+ ## Progress
174
+
175
+ **Acceptance Criteria:** {checked}/{total} ({percentage}%)
176
+
177
+ | Status | Criterion |
178
+ |--------|-----------|
179
+ | [x] | {completed criterion 1} |
180
+ | [x] | {completed criterion 2} |
181
+ | [ ] | {pending criterion 3} |
182
+ | [ ] | {pending criterion 4} |
183
+
184
+ ---
185
+
186
+ ## Files in Progress
187
+
188
+ {If files tracked at pause:}
189
+ | File | Status at Pause | Current |
190
+ |------|-----------------|---------|
191
+ | src/auth/middleware.ts | Created | ✓ exists |
192
+ | src/types/auth.ts | Created | ✓ exists |
193
+ | src/utils/jwt.ts | Modified | ✓ modified |
194
+
195
+ {If new uncommitted changes since pause:}
196
+ **New Changes Since Pause:**
197
+ - {new file or modification}
198
+
199
+ ---
200
+
201
+ ## Recommended Action
202
+
203
+ Based on status `{status}`:
204
+
205
+ **Next Step:** `{recommended_command}` — {description}
206
+
207
+ {Context-specific guidance based on where they left off}
208
+ ```
209
+
210
+ ## Step 10: Provide Focus Hints
211
+
212
+ Based on notes and context:
213
+
214
+ ```
215
+ ---
216
+
217
+ ## Focus Points
218
+
219
+ Based on your notes and progress:
220
+
221
+ 1. {Key thing to focus on next}
222
+ 2. {Related file or section}
223
+ 3. {Pending acceptance criterion to complete}
224
+ ```
225
+
226
+ ## Step 11: Clean Up Old Pause Files (Optional)
227
+
228
+ If more than 5 pause files exist, suggest cleanup:
229
+
230
+ ```
231
+ **Note:** {N} old pause files in sessions/. Run `/sf history` to review or clean up.
232
+ ```
233
+
234
+ </workflow>
235
+
236
+ <success_criteria>
237
+ - [ ] Initialization verified
238
+ - [ ] Latest pause file found and read
239
+ - [ ] Time since pause calculated
240
+ - [ ] Current state compared with pause state
241
+ - [ ] State conflict handled if detected
242
+ - [ ] Full context restored and displayed
243
+ - [ ] Acceptance criteria progress shown
244
+ - [ ] Files in progress tracked
245
+ - [ ] User notes displayed
246
+ - [ ] Clear recommended next action
247
+ - [ ] Focus hints provided
248
+ </success_criteria>
@@ -0,0 +1,258 @@
1
+ ---
2
+ name: sf:review
3
+ description: Review the implementation against specification
4
+ allowed-tools:
5
+ - Read
6
+ - Write
7
+ - Bash
8
+ - Glob
9
+ - Grep
10
+ - Task
11
+ ---
12
+
13
+ <purpose>
14
+ Review the implementation of the active specification in a fresh context. The reviewer evaluates code quality, specification compliance, security, and completeness without bias from the implementation process.
15
+ </purpose>
16
+
17
+ <context>
18
+ @.specflow/STATE.md
19
+ @.specflow/PROJECT.md
20
+ @~/.claude/specflow-cc/agents/impl-reviewer.md
21
+ </context>
22
+
23
+ <workflow>
24
+
25
+ ## Step 1: Verify Initialization
26
+
27
+ ```bash
28
+ [ -d .specflow ] && echo "OK" || echo "NOT_INITIALIZED"
29
+ ```
30
+
31
+ **If NOT_INITIALIZED:**
32
+ ```
33
+ SpecFlow not initialized.
34
+
35
+ Run `/sf init` first.
36
+ ```
37
+ Exit.
38
+
39
+ ## Step 2: Get Active Specification
40
+
41
+ Read `.specflow/STATE.md` and extract Active Specification.
42
+
43
+ **If no active specification:**
44
+ ```
45
+ No active specification to review.
46
+
47
+ Run `/sf new "task description"` to create one.
48
+ ```
49
+ Exit.
50
+
51
+ ## Step 3: Load Specification
52
+
53
+ Read the active spec file: `.specflow/specs/SPEC-XXX.md`
54
+
55
+ **If status is not 'running' or 'review':**
56
+ ```
57
+ Specification SPEC-XXX is not ready for review (status: {status}).
58
+
59
+ {If status is draft/auditing/revision_requested:}
60
+ Run `/sf run` first to implement the specification.
61
+
62
+ {If status is done:}
63
+ Specification already completed. Use `/sf history` to view archived specs.
64
+ ```
65
+ Exit.
66
+
67
+ ## Step 4: Verify Implementation Exists
68
+
69
+ Check that Execution Summary exists in spec:
70
+
71
+ **If no Execution Summary:**
72
+ ```
73
+ No implementation found for SPEC-XXX.
74
+
75
+ Run `/sf run` to execute the specification first.
76
+ ```
77
+ Exit.
78
+
79
+ ## Step 5: Spawn Reviewer Agent
80
+
81
+ Launch the impl-reviewer subagent with fresh context:
82
+
83
+ ```
84
+ Task(prompt="
85
+ <specification>
86
+ @.specflow/specs/SPEC-XXX.md
87
+ </specification>
88
+
89
+ <project_context>
90
+ @.specflow/PROJECT.md
91
+ </project_context>
92
+
93
+ Review this implementation following the impl-reviewer agent instructions.
94
+ Evaluate compliance, quality, security, and completeness.
95
+ Do NOT read any conversation history — review with fresh eyes.
96
+ ", subagent_type="sf-impl-reviewer", description="Review implementation")
97
+ ```
98
+
99
+ ## Step 6: Handle Agent Response
100
+
101
+ The agent will:
102
+ 1. Verify all files created/deleted
103
+ 2. Check acceptance criteria
104
+ 3. Review code quality
105
+ 4. Categorize findings
106
+ 5. Append Review v[N] to spec
107
+ 6. Update STATE.md
108
+
109
+ ## Step 7: Display Result
110
+
111
+ ### If APPROVED:
112
+
113
+ ```
114
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
115
+ REVIEW PASSED
116
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
117
+
118
+ **Specification:** SPEC-XXX
119
+ **Result:** APPROVED
120
+
121
+ ### Summary
122
+
123
+ {Brief assessment from reviewer}
124
+
125
+ ### Verified
126
+
127
+ - [✓] All acceptance criteria met
128
+ - [✓] All files created
129
+ - [✓] All deletions performed
130
+ - [✓] Code quality acceptable
131
+
132
+ ---
133
+
134
+ ## Next Step
135
+
136
+ `/sf done` — finalize and archive specification
137
+ ```
138
+
139
+ ### If CHANGES_REQUESTED:
140
+
141
+ ```
142
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
143
+ REVIEW: CHANGES REQUESTED
144
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
145
+
146
+ **Specification:** SPEC-XXX
147
+ **Result:** CHANGES_REQUESTED
148
+
149
+ ### Critical Issues
150
+
151
+ 1. **{Title}**
152
+ - File: `{path}:{line}`
153
+ - Issue: {description}
154
+ - Fix: {suggestion}
155
+
156
+ ### Major Issues
157
+
158
+ 2. **{Title}**
159
+ - File: `{path}:{line}`
160
+ - Issue: {description}
161
+
162
+ ### Minor Issues
163
+
164
+ 3. {description}
165
+
166
+ ### Passed
167
+
168
+ - [✓] {What's working}
169
+
170
+ ---
171
+
172
+ ## Next Step
173
+
174
+ `/sf fix` — address the issues
175
+
176
+ Options:
177
+ - `/sf fix all` — apply all fixes
178
+ - `/sf fix 1,2` — fix specific issues
179
+ - `/sf fix [instructions]` — custom fixes
180
+ ```
181
+
182
+ </workflow>
183
+
184
+ <fallback>
185
+
186
+ **If agent spawning fails**, execute inline:
187
+
188
+ ## Inline Review
189
+
190
+ ### Load Requirements
191
+
192
+ From specification:
193
+ - List of acceptance criteria
194
+ - Files to create
195
+ - Files to delete
196
+ - Interfaces defined
197
+
198
+ ### Verify Files
199
+
200
+ Check created files exist:
201
+ ```bash
202
+ [ -f "path/to/file" ] && echo "EXISTS" || echo "MISSING"
203
+ ```
204
+
205
+ Check deleted files removed:
206
+ ```bash
207
+ [ ! -f "path/to/old" ] && echo "DELETED" || echo "STILL_EXISTS"
208
+ ```
209
+
210
+ ### Check Acceptance Criteria
211
+
212
+ For each criterion, verify:
213
+ - Feature works as specified
214
+ - Edge cases handled
215
+ - Constraints respected
216
+
217
+ ### Code Quality Review
218
+
219
+ For each file, check:
220
+ - Clean, readable code
221
+ - No obvious bugs
222
+ - Proper error handling
223
+ - Follows project patterns
224
+
225
+ ### Determine Result
226
+
227
+ - APPROVED: No critical/major issues
228
+ - CHANGES_REQUESTED: Has critical or major issues
229
+
230
+ ### Record Review
231
+
232
+ Get review version:
233
+ ```bash
234
+ REVIEW_COUNT=$(grep -c "### Review v" .specflow/specs/SPEC-XXX.md 2>/dev/null || echo 0)
235
+ NEXT_VERSION=$((REVIEW_COUNT + 1))
236
+ ```
237
+
238
+ Append Review History to spec.
239
+
240
+ ### Update STATE.md
241
+
242
+ - If APPROVED: Status → "done", Next Step → "/sf done"
243
+ - If CHANGES_REQUESTED: Status → "review", Next Step → "/sf fix"
244
+
245
+ </fallback>
246
+
247
+ <success_criteria>
248
+ - [ ] Active specification identified
249
+ - [ ] Implementation exists (Execution Summary present)
250
+ - [ ] Fresh context review performed
251
+ - [ ] All acceptance criteria checked
252
+ - [ ] File operations verified
253
+ - [ ] Code quality evaluated
254
+ - [ ] Findings categorized
255
+ - [ ] Review recorded in spec
256
+ - [ ] STATE.md updated
257
+ - [ ] Clear next step provided
258
+ </success_criteria>