specflow-cc 1.17.1 → 1.18.1
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/agents/spec-creator.md +2 -0
- package/agents/spec-reviser.md +29 -12
- package/bin/install.js +14 -0
- package/bin/lib/todo.cjs +238 -0
- package/bin/sf-tools.cjs +21 -0
- package/commands/sf/done.md +15 -6
- package/commands/sf/health.md +11 -3
- package/commands/sf/init.md +2 -2
- package/commands/sf/metrics.md +15 -6
- package/commands/sf/migrate-todos.md +252 -0
- package/commands/sf/plan.md +35 -24
- package/commands/sf/priority.md +13 -8
- package/commands/sf/revise.md +27 -7
- package/commands/sf/status.md +2 -2
- package/commands/sf/todo.md +30 -36
- package/commands/sf/todos.md +68 -56
- package/commands/sf/triage.md +30 -30
- package/package.json +1 -1
- package/templates/todo-file.md +18 -0
- package/templates/todo-index.md +13 -0
- package/templates/todo.md +0 -15
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sf:migrate-todos
|
|
3
|
+
description: One-time migration from monolithic TODO.md to per-file format
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- Read
|
|
6
|
+
- Write
|
|
7
|
+
- Bash
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<purpose>
|
|
11
|
+
Migrate an existing monolithic `.specflow/todos/TODO.md` to the new per-file format where each TODO becomes an individual `.specflow/todos/TODO-XXX.md` file with YAML frontmatter.
|
|
12
|
+
|
|
13
|
+
This is a one-time migration command. After migration:
|
|
14
|
+
- `TODO.md` is renamed to `TODO.md.bak` (NOT deleted — safety net)
|
|
15
|
+
- Each TODO becomes its own `TODO-XXX.md` file
|
|
16
|
+
- `INDEX.md` is generated from the new files
|
|
17
|
+
- All other commands will use the new per-file format automatically
|
|
18
|
+
|
|
19
|
+
Use `--dry-run` to preview the migration without writing any files.
|
|
20
|
+
</purpose>
|
|
21
|
+
|
|
22
|
+
<arguments>
|
|
23
|
+
- `[--dry-run]` — Preview migration without writing files. Shows what would be created.
|
|
24
|
+
</arguments>
|
|
25
|
+
|
|
26
|
+
<workflow>
|
|
27
|
+
|
|
28
|
+
## Step 1: Verify Initialization
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
[ -d .specflow ] && echo "OK" || echo "NOT_INITIALIZED"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**If NOT_INITIALIZED:**
|
|
35
|
+
```
|
|
36
|
+
SpecFlow not initialized.
|
|
37
|
+
|
|
38
|
+
Run `/sf:init` to start.
|
|
39
|
+
```
|
|
40
|
+
Exit.
|
|
41
|
+
|
|
42
|
+
## Step 2: Check for Legacy TODO.md
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
[ -f .specflow/todos/TODO.md ] && echo "EXISTS" || echo "NO_TODO_MD"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**If NO_TODO_MD:**
|
|
49
|
+
```
|
|
50
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
51
|
+
MIGRATE TODOS
|
|
52
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
53
|
+
|
|
54
|
+
No legacy TODO.md found at .specflow/todos/TODO.md.
|
|
55
|
+
|
|
56
|
+
Nothing to migrate. If you already have per-file TODOs, run `/sf:todos` to view them.
|
|
57
|
+
```
|
|
58
|
+
Exit.
|
|
59
|
+
|
|
60
|
+
## Step 3: Check for Existing Per-File TODOs
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
ls .specflow/todos/TODO-*.md 2>/dev/null | head -1
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**If per-file TODOs already exist:**
|
|
67
|
+
```
|
|
68
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
69
|
+
MIGRATE TODOS — WARNING
|
|
70
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
71
|
+
|
|
72
|
+
Found existing per-file TODO files alongside TODO.md.
|
|
73
|
+
Migration may create duplicate IDs.
|
|
74
|
+
|
|
75
|
+
Review existing files before continuing:
|
|
76
|
+
ls .specflow/todos/TODO-*.md
|
|
77
|
+
|
|
78
|
+
Proceed anyway? (Use --dry-run first to check for conflicts)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Continue (do not abort — user may want to merge).
|
|
82
|
+
|
|
83
|
+
## Step 4: Parse TODO.md
|
|
84
|
+
|
|
85
|
+
Read `.specflow/todos/TODO.md` and extract all TODO blocks.
|
|
86
|
+
|
|
87
|
+
Each block follows the pattern:
|
|
88
|
+
```
|
|
89
|
+
## TODO-XXX — YYYY-MM-DD
|
|
90
|
+
**Description:** Short description
|
|
91
|
+
**Priority:** high | medium | low | —
|
|
92
|
+
**Notes:** Optional notes
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
For each block, extract:
|
|
98
|
+
- `id` — TODO-XXX
|
|
99
|
+
- `created` — YYYY-MM-DD (from header)
|
|
100
|
+
- `description` — from `**Description:**` line
|
|
101
|
+
- `priority` — from `**Priority:**` line (normalize: strip whitespace, lowercase)
|
|
102
|
+
- `notes` — from `**Notes:**` line (may be "—" or empty)
|
|
103
|
+
|
|
104
|
+
**If no blocks found:**
|
|
105
|
+
```
|
|
106
|
+
TODO.md exists but contains no TODO blocks.
|
|
107
|
+
|
|
108
|
+
Nothing to migrate. Renaming TODO.md to TODO.md.bak for safety.
|
|
109
|
+
```
|
|
110
|
+
Go to Step 7 (rename only).
|
|
111
|
+
|
|
112
|
+
## Step 5: Preview Migration
|
|
113
|
+
|
|
114
|
+
Display what will be created:
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
118
|
+
MIGRATE TODOS{If --dry-run: " — DRY RUN (no files written)"}
|
|
119
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
120
|
+
|
|
121
|
+
Found {N} TODO items in TODO.md:
|
|
122
|
+
|
|
123
|
+
| ID | Created | Priority | Description (truncated) |
|
|
124
|
+
|----------|------------|----------|-------------------------|
|
|
125
|
+
| TODO-001 | 2024-01-10 | high | Add caching for API... |
|
|
126
|
+
| TODO-003 | 2024-01-12 | medium | Refactor AuthService... |
|
|
127
|
+
| TODO-002 | 2024-01-11 | low | Update documentation... |
|
|
128
|
+
|
|
129
|
+
Will create:
|
|
130
|
+
.specflow/todos/TODO-001.md
|
|
131
|
+
.specflow/todos/TODO-002.md
|
|
132
|
+
.specflow/todos/TODO-003.md
|
|
133
|
+
.specflow/todos/INDEX.md
|
|
134
|
+
|
|
135
|
+
Will rename:
|
|
136
|
+
TODO.md → TODO.md.bak
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**If `--dry-run` flag:**
|
|
140
|
+
```
|
|
141
|
+
DRY RUN complete. No files were written.
|
|
142
|
+
|
|
143
|
+
To run the actual migration: /sf:migrate-todos
|
|
144
|
+
```
|
|
145
|
+
Exit.
|
|
146
|
+
|
|
147
|
+
## Step 6: Create Per-File TODOs
|
|
148
|
+
|
|
149
|
+
For each parsed TODO block, create `.specflow/todos/TODO-{XXX}.md`:
|
|
150
|
+
|
|
151
|
+
Derive `title` from description: first sentence (up to first `.`, `?`, or `!`), truncated to ~80 characters.
|
|
152
|
+
|
|
153
|
+
```markdown
|
|
154
|
+
---
|
|
155
|
+
id: TODO-{XXX}
|
|
156
|
+
title: "{derived title}"
|
|
157
|
+
priority: {priority or —}
|
|
158
|
+
complexity: —
|
|
159
|
+
status: open
|
|
160
|
+
effort: —
|
|
161
|
+
depends_on: —
|
|
162
|
+
created: {YYYY-MM-DD}
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Description
|
|
166
|
+
|
|
167
|
+
{full description}
|
|
168
|
+
|
|
169
|
+
## Notes
|
|
170
|
+
|
|
171
|
+
{notes or "—"}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Step 7: Generate INDEX.md
|
|
175
|
+
|
|
176
|
+
Write `.specflow/todos/INDEX.md` with all migrated TODOs, sorted by priority then date:
|
|
177
|
+
|
|
178
|
+
```markdown
|
|
179
|
+
# To-Do Index
|
|
180
|
+
|
|
181
|
+
> Auto-generated from individual TODO files. Do not edit manually.
|
|
182
|
+
> Regenerate with `/sf:todos`.
|
|
183
|
+
|
|
184
|
+
| # | ID | Title | Priority | Status | Created |
|
|
185
|
+
|---|-----|-------|----------|--------|---------|
|
|
186
|
+
{one row per TODO, sorted by priority then created date}
|
|
187
|
+
|
|
188
|
+
**Total:** {N} items ({high} high, {medium} medium, {low} low, {unset} unset)
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
*Last regenerated: {YYYY-MM-DD HH:MM}*
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Step 8: Rename Legacy TODO.md
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
mv .specflow/todos/TODO.md .specflow/todos/TODO.md.bak
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
**CRITICAL:** Do NOT delete TODO.md — rename to `.bak` for safety. The original data is preserved in case of migration issues.
|
|
201
|
+
|
|
202
|
+
Verify:
|
|
203
|
+
```bash
|
|
204
|
+
[ -f .specflow/todos/TODO.md.bak ] && echo "RENAMED" || echo "RENAME_FAILED"
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**If RENAME_FAILED:** Report error but continue (per-file TODOs are already created).
|
|
208
|
+
|
|
209
|
+
## Step 9: Display Migration Summary
|
|
210
|
+
|
|
211
|
+
**IMPORTANT:** Output the following directly as formatted text, NOT wrapped in a markdown code block:
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
215
|
+
MIGRATION COMPLETE
|
|
216
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
217
|
+
|
|
218
|
+
Migrated {N} TODOs from TODO.md to per-file format.
|
|
219
|
+
|
|
220
|
+
**Created:**
|
|
221
|
+
{list of TODO-XXX.md files created}
|
|
222
|
+
.specflow/todos/INDEX.md
|
|
223
|
+
|
|
224
|
+
**Renamed:**
|
|
225
|
+
TODO.md → TODO.md.bak (original preserved for safety)
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
**Actions:**
|
|
230
|
+
- `/sf:todos` — view all to-do items
|
|
231
|
+
- `/sf:priority` — set priorities
|
|
232
|
+
- `/sf:plan TODO-XXX` — convert to specification
|
|
233
|
+
|
|
234
|
+
**Cleanup:** Once you've verified the migration, you may delete TODO.md.bak:
|
|
235
|
+
rm .specflow/todos/TODO.md.bak
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
</workflow>
|
|
239
|
+
|
|
240
|
+
<success_criteria>
|
|
241
|
+
- [ ] Initialization verified
|
|
242
|
+
- [ ] Legacy TODO.md existence checked
|
|
243
|
+
- [ ] All TODO blocks parsed from TODO.md
|
|
244
|
+
- [ ] `--dry-run` previews without writing files
|
|
245
|
+
- [ ] Individual TODO-XXX.md files created for each block
|
|
246
|
+
- [ ] Each file has valid YAML frontmatter (id, title, priority, status, created)
|
|
247
|
+
- [ ] Title derived from description (first sentence, ~80 chars)
|
|
248
|
+
- [ ] INDEX.md generated from migrated files
|
|
249
|
+
- [ ] TODO.md renamed to TODO.md.bak (NOT deleted)
|
|
250
|
+
- [ ] Clear migration summary shown
|
|
251
|
+
- [ ] Cleanup instructions provided
|
|
252
|
+
</success_criteria>
|
package/commands/sf/plan.md
CHANGED
|
@@ -17,7 +17,7 @@ Convert a to-do item from the backlog into a full specification. Reuses the spec
|
|
|
17
17
|
</purpose>
|
|
18
18
|
|
|
19
19
|
<context>
|
|
20
|
-
@.specflow/todos/
|
|
20
|
+
@.specflow/todos/
|
|
21
21
|
@.specflow/PROJECT.md
|
|
22
22
|
@.specflow/STATE.md
|
|
23
23
|
@~/.claude/specflow-cc/agents/spec-creator.md
|
|
@@ -46,10 +46,10 @@ Exit.
|
|
|
46
46
|
## Step 2: Check for Todos
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
|
-
|
|
49
|
+
node ~/.claude/specflow-cc/bin/sf-tools.cjs todo list --raw
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
**If
|
|
52
|
+
**If empty output (no todos):**
|
|
53
53
|
```
|
|
54
54
|
No to-do items found.
|
|
55
55
|
|
|
@@ -59,14 +59,16 @@ Exit.
|
|
|
59
59
|
|
|
60
60
|
## Step 3: Determine Target Todo
|
|
61
61
|
|
|
62
|
+
Format detection is handled automatically by the CLI tool.
|
|
63
|
+
|
|
62
64
|
**If argument is a number (e.g., "1", "2"):**
|
|
63
|
-
|
|
65
|
+
Run `node ~/.claude/specflow-cc/bin/sf-tools.cjs todo list` to get sorted array, pick the Nth item (1-indexed).
|
|
64
66
|
|
|
65
67
|
**If argument is TODO-XXX format:**
|
|
66
|
-
|
|
68
|
+
The target ID is known directly.
|
|
67
69
|
|
|
68
70
|
**If no argument:**
|
|
69
|
-
|
|
71
|
+
Run `node ~/.claude/specflow-cc/bin/sf-tools.cjs todo list` and display todos, then prompt:
|
|
70
72
|
|
|
71
73
|
```
|
|
72
74
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
@@ -86,13 +88,14 @@ Use AskUserQuestion with options as todo items.
|
|
|
86
88
|
|
|
87
89
|
## Step 4: Extract Todo Details
|
|
88
90
|
|
|
89
|
-
Read
|
|
90
|
-
- ID
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
91
|
+
Read `.specflow/todos/TODO-{XXX}.md` and parse frontmatter:
|
|
92
|
+
- ID (from frontmatter `id:`)
|
|
93
|
+
- Title (from frontmatter `title:`)
|
|
94
|
+
- Description (from `## Description` body section)
|
|
95
|
+
- Priority (from frontmatter `priority:`)
|
|
96
|
+
- Notes (from `## Notes` body section, if any)
|
|
94
97
|
|
|
95
|
-
**If todo not found:**
|
|
98
|
+
**If todo file not found:**
|
|
96
99
|
```
|
|
97
100
|
Todo "{arg}" not found.
|
|
98
101
|
|
|
@@ -148,18 +151,25 @@ Use the priority from the todo as the spec's initial priority.
|
|
|
148
151
|
", subagent_type="sf-spec-creator", model="{profile_model}", description="Create specification from todo")
|
|
149
152
|
```
|
|
150
153
|
|
|
151
|
-
## Step 7: Remove Todo
|
|
154
|
+
## Step 7: Remove Todo File — CRITICAL
|
|
152
155
|
|
|
153
156
|
**This step is MANDATORY. Do NOT skip it after the agent returns.**
|
|
154
157
|
|
|
155
|
-
1.
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
158
|
+
1. Delete the file `.specflow/todos/TODO-{XXX}.md`:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
rm .specflow/todos/TODO-{XXX}.md
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
2. **Verify** the file no longer exists:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
[ ! -f .specflow/todos/TODO-{XXX}.md ] && echo "DELETED" || echo "STILL_EXISTS"
|
|
168
|
+
```
|
|
159
169
|
|
|
160
|
-
**
|
|
170
|
+
**If STILL_EXISTS:** try deletion again and verify.
|
|
161
171
|
|
|
162
|
-
**Important:** Only remove after confirmed spec creation.
|
|
172
|
+
**Important:** Only remove after confirmed spec creation. No "Last updated" lines to update.
|
|
163
173
|
|
|
164
174
|
## Step 8: Display Result
|
|
165
175
|
|
|
@@ -210,7 +220,7 @@ Consider `/sf:split SPEC-{YYY}` to decompose.
|
|
|
210
220
|
|
|
211
221
|
### Get Todo Details
|
|
212
222
|
|
|
213
|
-
Read
|
|
223
|
+
Read `.specflow/todos/TODO-{XXX}.md` and parse frontmatter and body.
|
|
214
224
|
|
|
215
225
|
### Create Spec (same as /sf:new)
|
|
216
226
|
|
|
@@ -222,18 +232,19 @@ Use `/sf:new "{todo description}"` logic:
|
|
|
222
232
|
|
|
223
233
|
### Remove Todo
|
|
224
234
|
|
|
225
|
-
Delete
|
|
235
|
+
Delete the file `.specflow/todos/TODO-{XXX}.md`.
|
|
226
236
|
|
|
227
237
|
</fallback>
|
|
228
238
|
|
|
229
239
|
<success_criteria>
|
|
230
240
|
- [ ] Initialization verified
|
|
231
|
-
- [ ]
|
|
241
|
+
- [ ] TODOs checked via CLI tool (format-agnostic)
|
|
232
242
|
- [ ] Target todo identified (by ID or number)
|
|
233
|
-
- [ ] Todo details extracted
|
|
243
|
+
- [ ] Todo file read and details extracted (frontmatter + body)
|
|
234
244
|
- [ ] Spec-creator agent spawned with context
|
|
235
245
|
- [ ] SPEC-XXX.md created
|
|
236
246
|
- [ ] Priority inherited from todo
|
|
237
|
-
- [ ]
|
|
247
|
+
- [ ] TODO-XXX.md file deleted (not edited — whole file removed)
|
|
248
|
+
- [ ] Deletion verified (file no longer exists)
|
|
238
249
|
- [ ] Clear result with next step
|
|
239
250
|
</success_criteria>
|
package/commands/sf/priority.md
CHANGED
|
@@ -16,7 +16,7 @@ Interactively prioritize specifications and to-do items. Allows reordering, sett
|
|
|
16
16
|
|
|
17
17
|
<context>
|
|
18
18
|
@.specflow/STATE.md
|
|
19
|
-
@.specflow/todos/
|
|
19
|
+
@.specflow/todos/
|
|
20
20
|
</context>
|
|
21
21
|
|
|
22
22
|
<workflow>
|
|
@@ -51,9 +51,13 @@ For each spec, extract:
|
|
|
51
51
|
|
|
52
52
|
### Load Todos
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
```bash
|
|
55
|
+
node ~/.claude/specflow-cc/bin/sf-tools.cjs todo list
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Extract from the JSON array:
|
|
55
59
|
- ID
|
|
56
|
-
-
|
|
60
|
+
- Title
|
|
57
61
|
- Priority
|
|
58
62
|
|
|
59
63
|
## Step 3: Display Current Prioritization
|
|
@@ -118,9 +122,10 @@ Your choice:
|
|
|
118
122
|
If input matches pattern `{ID}={priority}`:
|
|
119
123
|
|
|
120
124
|
1. Validate priority (high | medium | low)
|
|
121
|
-
2.
|
|
122
|
-
3.
|
|
123
|
-
4.
|
|
125
|
+
2. **If ID is a spec (SPEC-XXX):** Update `priority:` in frontmatter of `.specflow/specs/SPEC-XXX.md` using the Edit tool
|
|
126
|
+
3. **If ID is a TODO (TODO-XXX):** Read `.specflow/todos/TODO-XXX.md`, update `priority:` line in frontmatter using the Edit tool
|
|
127
|
+
4. Display confirmation
|
|
128
|
+
5. Return to Step 3
|
|
124
129
|
|
|
125
130
|
### Reorder Specifications
|
|
126
131
|
|
|
@@ -192,12 +197,12 @@ Use `/sf:next` to work on highest priority task.
|
|
|
192
197
|
<success_criteria>
|
|
193
198
|
- [ ] Initialization verified
|
|
194
199
|
- [ ] All specs loaded with current priorities
|
|
195
|
-
- [ ] All todos loaded
|
|
200
|
+
- [ ] All todos loaded via CLI tool (format-agnostic)
|
|
196
201
|
- [ ] Combined numbered list displayed
|
|
197
202
|
- [ ] Set priority command works
|
|
198
203
|
- [ ] Reorder command works
|
|
199
204
|
- [ ] Technical order suggestion available
|
|
200
|
-
- [ ]
|
|
205
|
+
- [ ] TODO priority updated in individual file frontmatter (not TODO.md)
|
|
201
206
|
- [ ] STATE.md Queue updated after spec reorder
|
|
202
207
|
- [ ] Clear feedback on changes
|
|
203
208
|
</success_criteria>
|
package/commands/sf/revise.md
CHANGED
|
@@ -474,14 +474,34 @@ NEXT_VERSION=$((RESPONSE_COUNT + 1))
|
|
|
474
474
|
|
|
475
475
|
After recording the Response, if any items were marked "Deferred":
|
|
476
476
|
|
|
477
|
-
1.
|
|
478
|
-
|
|
479
|
-
-
|
|
480
|
-
|
|
481
|
-
|
|
477
|
+
1. For each deferred item, generate next TODO ID:
|
|
478
|
+
```bash
|
|
479
|
+
node ~/.claude/specflow-cc/bin/sf-tools.cjs todo next-id --raw
|
|
480
|
+
```
|
|
481
|
+
2. Create `.specflow/todos/TODO-{XXX}.md` for each deferred item:
|
|
482
|
+
```markdown
|
|
483
|
+
---
|
|
484
|
+
id: TODO-{XXX}
|
|
485
|
+
title: "{item description} (deferred from {SPEC-XXX} audit v{N})"
|
|
486
|
+
priority: —
|
|
487
|
+
complexity: —
|
|
488
|
+
status: open
|
|
489
|
+
effort: —
|
|
490
|
+
depends_on: —
|
|
491
|
+
created: {YYYY-MM-DD}
|
|
492
|
+
---
|
|
493
|
+
|
|
494
|
+
## Description
|
|
495
|
+
|
|
496
|
+
{item description} (deferred from {SPEC-XXX} audit v{N})
|
|
497
|
+
|
|
498
|
+
## Notes
|
|
499
|
+
|
|
500
|
+
Origin: {SPEC-XXX} Response v{N}. {reason for deferral}
|
|
501
|
+
```
|
|
482
502
|
3. Append "**TODOs Created:**" subsection to the Response in Audit History listing created TODO IDs
|
|
483
503
|
|
|
484
|
-
**This step is mandatory.** Every "Deferred" decision MUST produce a corresponding TODO.
|
|
504
|
+
**This step is mandatory.** Every "Deferred" decision MUST produce a corresponding TODO-XXX.md file.
|
|
485
505
|
|
|
486
506
|
### Update Status
|
|
487
507
|
|
|
@@ -499,7 +519,7 @@ In STATE.md:
|
|
|
499
519
|
- [ ] Revision scope determined (all/specific/custom)
|
|
500
520
|
- [ ] Changes applied correctly
|
|
501
521
|
- [ ] Response recorded in Audit History
|
|
502
|
-
- [ ] Deferred items (if any) created as
|
|
522
|
+
- [ ] Deferred items (if any) created as individual TODO-XXX.md files in `.specflow/todos/`
|
|
503
523
|
- [ ] Spec frontmatter status updated
|
|
504
524
|
- [ ] STATE.md updated
|
|
505
525
|
- [ ] Clear summary of changes shown
|
package/commands/sf/status.md
CHANGED
|
@@ -57,8 +57,8 @@ TOTAL=$(ls .specflow/specs/SPEC-*.md 2>/dev/null | wc -l)
|
|
|
57
57
|
# Completed specs
|
|
58
58
|
DONE=$(ls .specflow/archive/SPEC-*.md 2>/dev/null | wc -l)
|
|
59
59
|
|
|
60
|
-
# Pending todos
|
|
61
|
-
TODOS=$(ls .specflow/todos
|
|
60
|
+
# Pending todos (count TODO-*.md files, exclude INDEX.md)
|
|
61
|
+
TODOS=$(ls .specflow/todos/TODO-*.md 2>/dev/null | wc -l)
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
## Step 4.5: Validate State Consistency
|
package/commands/sf/todo.md
CHANGED
|
@@ -4,17 +4,18 @@ description: Add a new to-do item for future work
|
|
|
4
4
|
allowed-tools:
|
|
5
5
|
- Read
|
|
6
6
|
- Write
|
|
7
|
-
- Edit
|
|
8
7
|
- Bash
|
|
9
8
|
- AskUserQuestion
|
|
10
9
|
---
|
|
11
10
|
|
|
12
11
|
<purpose>
|
|
13
12
|
Add a new to-do item to the backlog. To-dos are ideas or tasks that don't need immediate specification but should be captured for later. They can later be converted to specifications with `/sf:plan`.
|
|
13
|
+
|
|
14
|
+
Each TODO is stored as an individual file `.specflow/todos/TODO-XXX.md` with YAML frontmatter.
|
|
14
15
|
</purpose>
|
|
15
16
|
|
|
16
17
|
<context>
|
|
17
|
-
@.specflow/todos/
|
|
18
|
+
@.specflow/todos/
|
|
18
19
|
</context>
|
|
19
20
|
|
|
20
21
|
<arguments>
|
|
@@ -56,53 +57,46 @@ Use AskUserQuestion:
|
|
|
56
57
|
|
|
57
58
|
## Step 4: Generate TODO ID
|
|
58
59
|
|
|
59
|
-
|
|
60
|
+
Run the CLI tool to get the next available ID:
|
|
60
61
|
|
|
61
62
|
```bash
|
|
62
|
-
|
|
63
|
+
node ~/.claude/specflow-cc/bin/sf-tools.cjs todo next-id --raw
|
|
63
64
|
```
|
|
64
65
|
|
|
65
|
-
|
|
66
|
-
Next ID = last + 1, zero-padded to 3 digits.
|
|
67
|
-
|
|
68
|
-
## Step 5: Create or Update TODO.md
|
|
66
|
+
This handles both per-file format (TODO-XXX.md) and legacy TODO.md automatically.
|
|
69
67
|
|
|
70
|
-
|
|
71
|
-
Create from template:
|
|
68
|
+
## Step 5: Derive Title
|
|
72
69
|
|
|
73
|
-
|
|
74
|
-
# To-Do List
|
|
70
|
+
Extract the first sentence of the description (up to the first period, `?`, or `!`, or truncate at ~80 characters). This becomes the `title` field in frontmatter.
|
|
75
71
|
|
|
76
|
-
|
|
72
|
+
## Step 6: Create TODO File
|
|
77
73
|
|
|
78
|
-
|
|
79
|
-
**Description:** {description}
|
|
80
|
-
**Priority:** —
|
|
81
|
-
**Notes:** —
|
|
74
|
+
Create `.specflow/todos/TODO-{XXX}.md` using the Write tool:
|
|
82
75
|
|
|
76
|
+
```markdown
|
|
77
|
+
---
|
|
78
|
+
id: TODO-{XXX}
|
|
79
|
+
title: "{derived title}"
|
|
80
|
+
priority: —
|
|
81
|
+
complexity: —
|
|
82
|
+
status: open
|
|
83
|
+
effort: —
|
|
84
|
+
depends_on: —
|
|
85
|
+
created: {YYYY-MM-DD}
|
|
83
86
|
---
|
|
84
|
-
*Last updated: {YYYY-MM-DD}*
|
|
85
|
-
```
|
|
86
87
|
|
|
87
|
-
|
|
88
|
-
Use the **Edit** tool (NOT Write) to make two targeted edits:
|
|
88
|
+
## Description
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
{description}
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
## TODO-{XXX} — {YYYY-MM-DD}
|
|
94
|
-
**Description:** {description}
|
|
95
|
-
**Priority:** —
|
|
96
|
-
**Notes:** —
|
|
92
|
+
## Notes
|
|
97
93
|
|
|
98
|
-
|
|
94
|
+
—
|
|
99
95
|
```
|
|
100
96
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
**CRITICAL:** Never rewrite the entire file. Use Edit to insert the new block and update the timestamp — this preserves all existing todos.
|
|
97
|
+
Do NOT create or modify TODO.md. Do NOT update any "Last updated" lines.
|
|
104
98
|
|
|
105
|
-
## Step
|
|
99
|
+
## Step 7: Display Confirmation
|
|
106
100
|
|
|
107
101
|
**IMPORTANT:** Output the following directly as formatted text, NOT wrapped in a markdown code block:
|
|
108
102
|
|
|
@@ -129,9 +123,9 @@ Use the **Edit** tool (NOT Write) to make two targeted edits:
|
|
|
129
123
|
- [ ] Initialization verified
|
|
130
124
|
- [ ] Todos directory exists
|
|
131
125
|
- [ ] Description obtained (from arg or prompt)
|
|
132
|
-
- [ ] Unique TODO-XXX ID generated
|
|
133
|
-
- [ ]
|
|
134
|
-
- [ ]
|
|
135
|
-
- [ ]
|
|
126
|
+
- [ ] Unique TODO-XXX ID generated via CLI tool
|
|
127
|
+
- [ ] Title derived from first sentence of description (~80 chars max)
|
|
128
|
+
- [ ] TODO-XXX.md created with valid YAML frontmatter
|
|
129
|
+
- [ ] All required frontmatter fields present (id, title, priority, complexity, status, effort, depends_on, created)
|
|
136
130
|
- [ ] Clear confirmation and next actions shown
|
|
137
131
|
</success_criteria>
|