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,211 @@
1
+ ---
2
+ name: sf:pause
3
+ description: Save current work context for later resumption
4
+ allowed-tools:
5
+ - Read
6
+ - Write
7
+ - Bash
8
+ - Glob
9
+ - AskUserQuestion
10
+ ---
11
+
12
+ <purpose>
13
+ Save the current work context to enable seamless resumption later. Creates a pause file with active specification, progress, recent changes, and optional notes. Essential for context preservation across sessions.
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: Get Current State
37
+
38
+ Read `.specflow/STATE.md` and extract:
39
+ - Active Specification
40
+ - Status
41
+ - Next Step
42
+
43
+ **If no active specification:**
44
+ ```
45
+ No active work to pause.
46
+
47
+ Current state: idle
48
+ ```
49
+ But still allow pausing to capture general notes.
50
+
51
+ ## Step 3: Load Active Specification Details
52
+
53
+ If active spec exists, read `.specflow/specs/SPEC-XXX.md`:
54
+ - Title
55
+ - Type
56
+ - Priority
57
+ - Complexity
58
+ - Acceptance Criteria (for progress tracking)
59
+
60
+ ## Step 4: Capture Git State
61
+
62
+ ```bash
63
+ # Get uncommitted changes
64
+ git status --porcelain 2>/dev/null
65
+
66
+ # Get recent commits related to spec (if any)
67
+ git log --oneline -5 2>/dev/null
68
+ ```
69
+
70
+ Categorize changes:
71
+ - New files (A or ??)
72
+ - Modified files (M)
73
+ - Deleted files (D)
74
+
75
+ ## Step 5: Estimate Progress
76
+
77
+ If acceptance criteria exist with checkboxes:
78
+ - Count total criteria
79
+ - Count checked criteria
80
+ - Calculate progress percentage
81
+
82
+ Also count:
83
+ - Files created
84
+ - Files modified
85
+ - Commits made (from Execution Summary if exists)
86
+
87
+ ## Step 6: Ask for Notes
88
+
89
+ Use AskUserQuestion:
90
+ - header: "Notes"
91
+ - question: "Add notes for next session? (Enter to skip)"
92
+ - options: (freeform text)
93
+
94
+ Notes help remember context that isn't captured in code.
95
+
96
+ ## Step 7: Create Sessions Directory
97
+
98
+ ```bash
99
+ mkdir -p .specflow/sessions
100
+ ```
101
+
102
+ ## Step 8: Generate Pause File
103
+
104
+ Create `.specflow/sessions/PAUSE-{YYYYMMDD}-{HHMMSS}.md`:
105
+
106
+ ```markdown
107
+ # Session Pause — {YYYY-MM-DD HH:MM:SS}
108
+
109
+ ## Context
110
+
111
+ - **Specification:** {SPEC-XXX} ({title}) | none
112
+ - **Status:** {status}
113
+ - **Workflow Position:** {description based on status}
114
+
115
+ ## Specification Details
116
+
117
+ {If active spec:}
118
+ - **Type:** {feature|refactor|bugfix}
119
+ - **Priority:** {priority}
120
+ - **Complexity:** {complexity}
121
+
122
+ ## Progress
123
+
124
+ - **Acceptance Criteria:** {checked}/{total} ({percentage}%)
125
+ - **Files Created:** {count}
126
+ - **Files Modified:** {count}
127
+ - **Commits:** {count}
128
+
129
+ ## Recent Changes
130
+
131
+ {If uncommitted changes:}
132
+ ```
133
+ + {new file 1}
134
+ + {new file 2}
135
+ M {modified file 1}
136
+ D {deleted file 1}
137
+ ```
138
+
139
+ {If no uncommitted changes:}
140
+ No uncommitted changes.
141
+
142
+ ## Notes
143
+
144
+ {User's notes or "No notes added."}
145
+
146
+ ## Conversation Summary
147
+
148
+ {Brief summary of what was being worked on}
149
+ {Key decisions made}
150
+ {What needs to happen next}
151
+
152
+ ---
153
+ *Paused at: {YYYY-MM-DD HH:MM:SS}*
154
+ ```
155
+
156
+ ## Step 9: Update STATE.md
157
+
158
+ Add reference to pause file:
159
+
160
+ Under Current Position, add:
161
+ ```markdown
162
+ - **Last Pause:** PAUSE-{YYYYMMDD}-{HHMMSS}
163
+ ```
164
+
165
+ ## Step 10: Display Confirmation
166
+
167
+ ```
168
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
169
+ SESSION PAUSED
170
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
171
+
172
+ **Saved:** PAUSE-{YYYYMMDD}-{HHMMSS}
173
+
174
+ ---
175
+
176
+ ## Context
177
+
178
+ - **Specification:** {SPEC-XXX} — {title}
179
+ - **Status:** {status}
180
+ - **Progress:** {checked}/{total} criteria ({percentage}%)
181
+
182
+ ## Recent Changes
183
+
184
+ {List of changed files}
185
+
186
+ {If notes provided:}
187
+ ## Notes Saved
188
+
189
+ "{notes}"
190
+
191
+ ---
192
+
193
+ **Session saved successfully.**
194
+
195
+ Resume with: `/sf resume`
196
+ ```
197
+
198
+ </workflow>
199
+
200
+ <success_criteria>
201
+ - [ ] Initialization verified
202
+ - [ ] Current state captured from STATE.md
203
+ - [ ] Active spec details loaded (if any)
204
+ - [ ] Git state captured
205
+ - [ ] Progress estimated
206
+ - [ ] User notes captured (optional)
207
+ - [ ] Sessions directory created
208
+ - [ ] PAUSE-{timestamp}.md created with full context
209
+ - [ ] STATE.md updated with pause reference
210
+ - [ ] Clear confirmation with resume instructions
211
+ </success_criteria>
@@ -0,0 +1,210 @@
1
+ ---
2
+ name: sf:plan
3
+ description: Convert a to-do item into a full specification
4
+ allowed-tools:
5
+ - Read
6
+ - Write
7
+ - Bash
8
+ - Glob
9
+ - Grep
10
+ - Task
11
+ - AskUserQuestion
12
+ ---
13
+
14
+ <purpose>
15
+ Convert a to-do item from the backlog into a full specification. Reuses the spec-creator agent with the todo's context pre-filled. After creating the spec, removes the todo from the list.
16
+ </purpose>
17
+
18
+ <context>
19
+ @.specflow/todos/TODO.md
20
+ @.specflow/PROJECT.md
21
+ @.specflow/STATE.md
22
+ @~/.claude/specflow-cc/agents/spec-creator.md
23
+ </context>
24
+
25
+ <arguments>
26
+ - `[ID or #]` — Optional. Either TODO-XXX ID or list number from `/sf todos`. If omitted, shows todos and prompts for selection.
27
+ </arguments>
28
+
29
+ <workflow>
30
+
31
+ ## Step 1: Verify Initialization
32
+
33
+ ```bash
34
+ [ -d .specflow ] && echo "OK" || echo "NOT_INITIALIZED"
35
+ ```
36
+
37
+ **If NOT_INITIALIZED:**
38
+ ```
39
+ SpecFlow not initialized.
40
+
41
+ Run `/sf init` to start.
42
+ ```
43
+ Exit.
44
+
45
+ ## Step 2: Check for Todos
46
+
47
+ ```bash
48
+ [ -f .specflow/todos/TODO.md ] && echo "EXISTS" || echo "NO_TODOS"
49
+ ```
50
+
51
+ **If NO_TODOS:**
52
+ ```
53
+ No to-do items found.
54
+
55
+ Add ideas first with `/sf todo "your idea"`.
56
+ ```
57
+ Exit.
58
+
59
+ ## Step 3: Determine Target Todo
60
+
61
+ **If argument is a number (e.g., "1", "2"):**
62
+ Parse TODO.md, sort by priority, and select the Nth item.
63
+
64
+ **If argument is TODO-XXX format:**
65
+ Find todo with matching ID.
66
+
67
+ **If no argument:**
68
+ Display todos and prompt:
69
+
70
+ ```
71
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
72
+ SELECT TODO TO CONVERT
73
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
74
+
75
+ | # | ID | Description | Priority |
76
+ |----|----------|--------------------------|----------|
77
+ | 1 | TODO-001 | Add caching for API | high |
78
+ | 2 | TODO-003 | Refactor AuthService | medium |
79
+ | 3 | TODO-002 | Update documentation | low |
80
+
81
+ Enter number or ID to convert:
82
+ ```
83
+
84
+ Use AskUserQuestion with options as todo items.
85
+
86
+ ## Step 4: Extract Todo Details
87
+
88
+ Read the selected todo:
89
+ - ID
90
+ - Description
91
+ - Priority
92
+ - Notes (if any)
93
+
94
+ **If todo not found:**
95
+ ```
96
+ Todo "{arg}" not found.
97
+
98
+ Use `/sf todos` to see available items.
99
+ ```
100
+ Exit.
101
+
102
+ ## Step 5: Spawn Spec Creator Agent
103
+
104
+ Launch the spec-creator subagent with todo context:
105
+
106
+ ```
107
+ Task(prompt="
108
+ <task_description>
109
+ {todo description}
110
+ </task_description>
111
+
112
+ <todo_context>
113
+ **From:** TODO-{XXX}
114
+ **Priority:** {priority}
115
+ **Notes:** {notes or 'None'}
116
+ </todo_context>
117
+
118
+ <project_context>
119
+ @.specflow/PROJECT.md
120
+ </project_context>
121
+
122
+ <current_state>
123
+ @.specflow/STATE.md
124
+ </current_state>
125
+
126
+ Create a specification following the spec-creator agent instructions.
127
+ Use the priority from the todo as the spec's initial priority.
128
+ ", subagent_type="sf-spec-creator", description="Create specification from todo")
129
+ ```
130
+
131
+ ## Step 6: Remove Todo from List
132
+
133
+ After spec is successfully created, remove the todo entry from TODO.md.
134
+
135
+ Update `*Last updated:` timestamp.
136
+
137
+ **Important:** Only remove after confirmed spec creation.
138
+
139
+ ## Step 7: Display Result
140
+
141
+ ```
142
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
143
+ TODO CONVERTED TO SPECIFICATION
144
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
145
+
146
+ **From:** TODO-{XXX} — "{description}"
147
+ **To:** SPEC-{YYY} — "{title}"
148
+
149
+ **Type:** {feature|refactor|bugfix}
150
+ **Complexity:** {small|medium|large}
151
+ **Priority:** {priority} (inherited from todo)
152
+
153
+ ### Assumptions Made
154
+
155
+ - {assumption 1}
156
+ - {assumption 2}
157
+
158
+ ---
159
+
160
+ **Todo removed from backlog.**
161
+
162
+ ## Next Step
163
+
164
+ `/sf audit` — audit specification before implementation
165
+
166
+ {If complexity is large:}
167
+
168
+ ### Warning
169
+
170
+ Specification is large (>150k tokens estimated).
171
+ Consider `/sf split SPEC-{YYY}` to decompose.
172
+ ```
173
+
174
+ </workflow>
175
+
176
+ <fallback>
177
+
178
+ **If agent spawning fails**, execute inline:
179
+
180
+ ## Inline Conversion
181
+
182
+ ### Get Todo Details
183
+
184
+ Read from TODO.md.
185
+
186
+ ### Create Spec (same as /sf new)
187
+
188
+ Use `/sf new "{todo description}"` logic:
189
+ 1. Generate SPEC-XXX ID
190
+ 2. Create spec with todo context
191
+ 3. Set priority from todo
192
+ 4. Update STATE.md
193
+
194
+ ### Remove Todo
195
+
196
+ Delete todo block from TODO.md.
197
+
198
+ </fallback>
199
+
200
+ <success_criteria>
201
+ - [ ] Initialization verified
202
+ - [ ] TODO.md exists and has items
203
+ - [ ] Target todo identified (by ID or number)
204
+ - [ ] Todo details extracted
205
+ - [ ] Spec-creator agent spawned with context
206
+ - [ ] SPEC-XXX.md created
207
+ - [ ] Priority inherited from todo
208
+ - [ ] Todo removed from TODO.md
209
+ - [ ] Clear result with next step
210
+ </success_criteria>
@@ -0,0 +1,198 @@
1
+ ---
2
+ name: sf:priority
3
+ description: Interactive prioritization of specifications and to-dos
4
+ allowed-tools:
5
+ - Read
6
+ - Write
7
+ - Bash
8
+ - Glob
9
+ - AskUserQuestion
10
+ ---
11
+
12
+ <purpose>
13
+ Interactively prioritize specifications and to-do items. Allows reordering, setting priority levels, and optionally suggests technically optimal order based on dependencies.
14
+ </purpose>
15
+
16
+ <context>
17
+ @.specflow/STATE.md
18
+ @.specflow/todos/TODO.md
19
+ </context>
20
+
21
+ <workflow>
22
+
23
+ ## Step 1: Verify Initialization
24
+
25
+ ```bash
26
+ [ -d .specflow ] && echo "OK" || echo "NOT_INITIALIZED"
27
+ ```
28
+
29
+ **If NOT_INITIALIZED:**
30
+ ```
31
+ SpecFlow not initialized.
32
+
33
+ Run `/sf init` to start.
34
+ ```
35
+ Exit.
36
+
37
+ ## Step 2: Load All Items
38
+
39
+ ### Load Specifications
40
+
41
+ ```bash
42
+ ls -1 .specflow/specs/SPEC-*.md 2>/dev/null
43
+ ```
44
+
45
+ For each spec, extract:
46
+ - ID
47
+ - Title
48
+ - Priority
49
+ - Status
50
+
51
+ ### Load Todos
52
+
53
+ Read `.specflow/todos/TODO.md` and extract:
54
+ - ID
55
+ - Description
56
+ - Priority
57
+
58
+ ## Step 3: Display Current Prioritization
59
+
60
+ ```
61
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
62
+ PRIORITIZATION
63
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
64
+
65
+ ## Specifications
66
+
67
+ | # | ID | Title | Priority | Status |
68
+ |---|----------|--------------------|----------|----------|
69
+ | 1 | SPEC-003 | Auth middleware | high | running |
70
+ | 2 | SPEC-004 | User profile | medium | audited |
71
+ | 3 | SPEC-005 | Settings page | low | draft |
72
+
73
+ ## To-Dos
74
+
75
+ | # | ID | Description | Priority |
76
+ |---|----------|--------------------|----------|
77
+ | 4 | TODO-001 | Add caching | high |
78
+ | 5 | TODO-002 | Refactor auth | medium |
79
+ | 6 | TODO-003 | Update docs | — |
80
+
81
+ ---
82
+
83
+ **Options:**
84
+ ```
85
+
86
+ ## Step 4: Prompt for Action
87
+
88
+ Use AskUserQuestion with options:
89
+
90
+ 1. **Set priority** — Change priority for specific item
91
+ - Format: `SPEC-004=high` or `TODO-001=low`
92
+
93
+ 2. **Reorder specs** — Enter new order for specifications
94
+ - Format: `2,1,3` (by current # position)
95
+
96
+ 3. **Technical order** — Auto-suggest based on dependencies
97
+ - Analyzes specs for dependency hints
98
+
99
+ 4. **Done** — Exit prioritization
100
+
101
+ ```
102
+ **Commands:**
103
+ - Set priority: `SPEC-004=high` or `TODO-001=low`
104
+ - Reorder specs: `2,1,3` (by # position)
105
+ - Technical order: `tech`
106
+ - Cancel: `q` or `done`
107
+
108
+ Your choice:
109
+ ```
110
+
111
+ ## Step 5: Handle Actions
112
+
113
+ ### Set Priority
114
+
115
+ If input matches pattern `{ID}={priority}`:
116
+
117
+ 1. Validate priority (high | medium | low)
118
+ 2. Update frontmatter in spec file OR priority line in TODO.md
119
+ 3. Display confirmation
120
+ 4. Return to Step 3
121
+
122
+ ### Reorder Specifications
123
+
124
+ If input matches pattern `N,N,N`:
125
+
126
+ 1. Validate all numbers exist
127
+ 2. Recalculate priorities based on position:
128
+ - Position 1-2: high
129
+ - Position 3-4: medium
130
+ - Position 5+: low
131
+ 3. Update each spec's frontmatter
132
+ 4. Update STATE.md Queue table
133
+ 5. Display confirmation
134
+ 6. Return to Step 3
135
+
136
+ ### Technical Order
137
+
138
+ If input is `tech`:
139
+
140
+ 1. Analyze specs for dependency hints:
141
+ - Look for "depends on", "requires", "after" in Context
142
+ - Look for file references that overlap
143
+ 2. Suggest order based on:
144
+ - Dependencies (prerequisites first)
145
+ - Complexity (smaller first if no deps)
146
+ - Type (bugfix > refactor > feature)
147
+
148
+ ```
149
+ **Suggested Technical Order:**
150
+
151
+ | # | ID | Title | Reason |
152
+ |---|----------|--------------------|---------------------|
153
+ | 1 | SPEC-005 | Settings page | Smallest, no deps |
154
+ | 2 | SPEC-003 | Auth middleware | Required by SPEC-004|
155
+ | 3 | SPEC-004 | User profile | Depends on auth |
156
+
157
+ Apply this order? [Y/n]
158
+ ```
159
+
160
+ If confirmed, apply reordering.
161
+
162
+ ### Done/Cancel
163
+
164
+ If input is `q`, `done`, or `cancel`:
165
+ Exit prioritization.
166
+
167
+ ## Step 6: Display Final State
168
+
169
+ After changes:
170
+
171
+ ```
172
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
173
+ PRIORITIZATION UPDATED
174
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
175
+
176
+ **Changes made:**
177
+ - SPEC-004: medium → high
178
+ - SPEC-005: low → medium
179
+
180
+ ---
181
+
182
+ Use `/sf next` to work on highest priority task.
183
+ ```
184
+
185
+ </workflow>
186
+
187
+ <success_criteria>
188
+ - [ ] Initialization verified
189
+ - [ ] All specs loaded with current priorities
190
+ - [ ] All todos loaded with current priorities
191
+ - [ ] Combined numbered list displayed
192
+ - [ ] Set priority command works
193
+ - [ ] Reorder command works
194
+ - [ ] Technical order suggestion available
195
+ - [ ] Changes persisted to files
196
+ - [ ] STATE.md Queue updated after spec reorder
197
+ - [ ] Clear feedback on changes
198
+ </success_criteria>