specflow-cc 1.17.0 → 1.18.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/agents/spec-creator.md +2 -0
- package/agents/spec-reviser.md +28 -11
- package/bin/lib/todo.cjs +238 -0
- package/bin/sf-tools.cjs +21 -0
- package/commands/sf/done.md +17 -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 +37 -24
- package/commands/sf/priority.md +14 -8
- package/commands/sf/revise.md +27 -7
- package/commands/sf/status.md +2 -2
- package/commands/sf/todo.md +31 -32
- package/commands/sf/todos.md +68 -56
- package/commands/sf/triage.md +31 -26
- 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
|
@@ -4,6 +4,7 @@ description: Convert a to-do item into a full specification
|
|
|
4
4
|
allowed-tools:
|
|
5
5
|
- Read
|
|
6
6
|
- Write
|
|
7
|
+
- Edit
|
|
7
8
|
- Bash
|
|
8
9
|
- Glob
|
|
9
10
|
- Grep
|
|
@@ -16,7 +17,7 @@ Convert a to-do item from the backlog into a full specification. Reuses the spec
|
|
|
16
17
|
</purpose>
|
|
17
18
|
|
|
18
19
|
<context>
|
|
19
|
-
@.specflow/todos/
|
|
20
|
+
@.specflow/todos/
|
|
20
21
|
@.specflow/PROJECT.md
|
|
21
22
|
@.specflow/STATE.md
|
|
22
23
|
@~/.claude/specflow-cc/agents/spec-creator.md
|
|
@@ -45,10 +46,10 @@ Exit.
|
|
|
45
46
|
## Step 2: Check for Todos
|
|
46
47
|
|
|
47
48
|
```bash
|
|
48
|
-
|
|
49
|
+
node bin/sf-tools.cjs todo list --raw
|
|
49
50
|
```
|
|
50
51
|
|
|
51
|
-
**If
|
|
52
|
+
**If empty output (no todos):**
|
|
52
53
|
```
|
|
53
54
|
No to-do items found.
|
|
54
55
|
|
|
@@ -58,14 +59,16 @@ Exit.
|
|
|
58
59
|
|
|
59
60
|
## Step 3: Determine Target Todo
|
|
60
61
|
|
|
62
|
+
Format detection is handled automatically by the CLI tool.
|
|
63
|
+
|
|
61
64
|
**If argument is a number (e.g., "1", "2"):**
|
|
62
|
-
|
|
65
|
+
Run `node bin/sf-tools.cjs todo list` to get sorted array, pick the Nth item (1-indexed).
|
|
63
66
|
|
|
64
67
|
**If argument is TODO-XXX format:**
|
|
65
|
-
|
|
68
|
+
The target ID is known directly.
|
|
66
69
|
|
|
67
70
|
**If no argument:**
|
|
68
|
-
|
|
71
|
+
Run `node bin/sf-tools.cjs todo list` and display todos, then prompt:
|
|
69
72
|
|
|
70
73
|
```
|
|
71
74
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
@@ -85,13 +88,14 @@ Use AskUserQuestion with options as todo items.
|
|
|
85
88
|
|
|
86
89
|
## Step 4: Extract Todo Details
|
|
87
90
|
|
|
88
|
-
Read
|
|
89
|
-
- ID
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
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)
|
|
93
97
|
|
|
94
|
-
**If todo not found:**
|
|
98
|
+
**If todo file not found:**
|
|
95
99
|
```
|
|
96
100
|
Todo "{arg}" not found.
|
|
97
101
|
|
|
@@ -147,17 +151,25 @@ Use the priority from the todo as the spec's initial priority.
|
|
|
147
151
|
", subagent_type="sf-spec-creator", model="{profile_model}", description="Create specification from todo")
|
|
148
152
|
```
|
|
149
153
|
|
|
150
|
-
## Step 7: Remove Todo
|
|
154
|
+
## Step 7: Remove Todo File — CRITICAL
|
|
151
155
|
|
|
152
156
|
**This step is MANDATORY. Do NOT skip it after the agent returns.**
|
|
153
157
|
|
|
154
|
-
1.
|
|
155
|
-
|
|
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
|
+
```
|
|
169
|
+
|
|
170
|
+
**If STILL_EXISTS:** try deletion again and verify.
|
|
159
171
|
|
|
160
|
-
**Important:** Only remove after confirmed spec creation.
|
|
172
|
+
**Important:** Only remove after confirmed spec creation. No "Last updated" lines to update.
|
|
161
173
|
|
|
162
174
|
## Step 8: Display Result
|
|
163
175
|
|
|
@@ -208,7 +220,7 @@ Consider `/sf:split SPEC-{YYY}` to decompose.
|
|
|
208
220
|
|
|
209
221
|
### Get Todo Details
|
|
210
222
|
|
|
211
|
-
Read
|
|
223
|
+
Read `.specflow/todos/TODO-{XXX}.md` and parse frontmatter and body.
|
|
212
224
|
|
|
213
225
|
### Create Spec (same as /sf:new)
|
|
214
226
|
|
|
@@ -220,18 +232,19 @@ Use `/sf:new "{todo description}"` logic:
|
|
|
220
232
|
|
|
221
233
|
### Remove Todo
|
|
222
234
|
|
|
223
|
-
Delete
|
|
235
|
+
Delete the file `.specflow/todos/TODO-{XXX}.md`.
|
|
224
236
|
|
|
225
237
|
</fallback>
|
|
226
238
|
|
|
227
239
|
<success_criteria>
|
|
228
240
|
- [ ] Initialization verified
|
|
229
|
-
- [ ]
|
|
241
|
+
- [ ] TODOs checked via CLI tool (format-agnostic)
|
|
230
242
|
- [ ] Target todo identified (by ID or number)
|
|
231
|
-
- [ ] Todo details extracted
|
|
243
|
+
- [ ] Todo file read and details extracted (frontmatter + body)
|
|
232
244
|
- [ ] Spec-creator agent spawned with context
|
|
233
245
|
- [ ] SPEC-XXX.md created
|
|
234
246
|
- [ ] Priority inherited from todo
|
|
235
|
-
- [ ]
|
|
247
|
+
- [ ] TODO-XXX.md file deleted (not edited — whole file removed)
|
|
248
|
+
- [ ] Deletion verified (file no longer exists)
|
|
236
249
|
- [ ] Clear result with next step
|
|
237
250
|
</success_criteria>
|
package/commands/sf/priority.md
CHANGED
|
@@ -4,6 +4,7 @@ description: Interactive prioritization of specifications and to-dos
|
|
|
4
4
|
allowed-tools:
|
|
5
5
|
- Read
|
|
6
6
|
- Write
|
|
7
|
+
- Edit
|
|
7
8
|
- Bash
|
|
8
9
|
- Glob
|
|
9
10
|
- AskUserQuestion
|
|
@@ -15,7 +16,7 @@ Interactively prioritize specifications and to-do items. Allows reordering, sett
|
|
|
15
16
|
|
|
16
17
|
<context>
|
|
17
18
|
@.specflow/STATE.md
|
|
18
|
-
@.specflow/todos/
|
|
19
|
+
@.specflow/todos/
|
|
19
20
|
</context>
|
|
20
21
|
|
|
21
22
|
<workflow>
|
|
@@ -50,9 +51,13 @@ For each spec, extract:
|
|
|
50
51
|
|
|
51
52
|
### Load Todos
|
|
52
53
|
|
|
53
|
-
|
|
54
|
+
```bash
|
|
55
|
+
node bin/sf-tools.cjs todo list
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Extract from the JSON array:
|
|
54
59
|
- ID
|
|
55
|
-
-
|
|
60
|
+
- Title
|
|
56
61
|
- Priority
|
|
57
62
|
|
|
58
63
|
## Step 3: Display Current Prioritization
|
|
@@ -117,9 +122,10 @@ Your choice:
|
|
|
117
122
|
If input matches pattern `{ID}={priority}`:
|
|
118
123
|
|
|
119
124
|
1. Validate priority (high | medium | low)
|
|
120
|
-
2.
|
|
121
|
-
3.
|
|
122
|
-
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
|
|
123
129
|
|
|
124
130
|
### Reorder Specifications
|
|
125
131
|
|
|
@@ -191,12 +197,12 @@ Use `/sf:next` to work on highest priority task.
|
|
|
191
197
|
<success_criteria>
|
|
192
198
|
- [ ] Initialization verified
|
|
193
199
|
- [ ] All specs loaded with current priorities
|
|
194
|
-
- [ ] All todos loaded
|
|
200
|
+
- [ ] All todos loaded via CLI tool (format-agnostic)
|
|
195
201
|
- [ ] Combined numbered list displayed
|
|
196
202
|
- [ ] Set priority command works
|
|
197
203
|
- [ ] Reorder command works
|
|
198
204
|
- [ ] Technical order suggestion available
|
|
199
|
-
- [ ]
|
|
205
|
+
- [ ] TODO priority updated in individual file frontmatter (not TODO.md)
|
|
200
206
|
- [ ] STATE.md Queue updated after spec reorder
|
|
201
207
|
- [ ] Clear feedback on changes
|
|
202
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 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
|
@@ -10,10 +10,12 @@ allowed-tools:
|
|
|
10
10
|
|
|
11
11
|
<purpose>
|
|
12
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.
|
|
13
15
|
</purpose>
|
|
14
16
|
|
|
15
17
|
<context>
|
|
16
|
-
@.specflow/todos/
|
|
18
|
+
@.specflow/todos/
|
|
17
19
|
</context>
|
|
18
20
|
|
|
19
21
|
<arguments>
|
|
@@ -55,49 +57,46 @@ Use AskUserQuestion:
|
|
|
55
57
|
|
|
56
58
|
## Step 4: Generate TODO ID
|
|
57
59
|
|
|
58
|
-
|
|
60
|
+
Run the CLI tool to get the next available ID:
|
|
59
61
|
|
|
60
62
|
```bash
|
|
61
|
-
|
|
63
|
+
node bin/sf-tools.cjs todo next-id --raw
|
|
62
64
|
```
|
|
63
65
|
|
|
64
|
-
|
|
65
|
-
Next ID = last + 1, zero-padded to 3 digits.
|
|
66
|
-
|
|
67
|
-
## Step 5: Create or Update TODO.md
|
|
66
|
+
This handles both per-file format (TODO-XXX.md) and legacy TODO.md automatically.
|
|
68
67
|
|
|
69
|
-
|
|
70
|
-
Create from template:
|
|
68
|
+
## Step 5: Derive Title
|
|
71
69
|
|
|
72
|
-
|
|
73
|
-
# 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.
|
|
74
71
|
|
|
75
|
-
|
|
72
|
+
## Step 6: Create TODO File
|
|
76
73
|
|
|
77
|
-
|
|
78
|
-
**Description:** {description}
|
|
79
|
-
**Priority:** —
|
|
80
|
-
**Notes:** —
|
|
74
|
+
Create `.specflow/todos/TODO-{XXX}.md` using the Write tool:
|
|
81
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}
|
|
82
86
|
---
|
|
83
|
-
*Last updated: {YYYY-MM-DD}*
|
|
84
|
-
```
|
|
85
87
|
|
|
86
|
-
|
|
87
|
-
Insert new todo after `# To-Do List` line:
|
|
88
|
+
## Description
|
|
88
89
|
|
|
89
|
-
|
|
90
|
-
## TODO-{XXX} — {YYYY-MM-DD}
|
|
91
|
-
**Description:** {description}
|
|
92
|
-
**Priority:** —
|
|
93
|
-
**Notes:** —
|
|
90
|
+
{description}
|
|
94
91
|
|
|
95
|
-
|
|
92
|
+
## Notes
|
|
93
|
+
|
|
94
|
+
—
|
|
96
95
|
```
|
|
97
96
|
|
|
98
|
-
|
|
97
|
+
Do NOT create or modify TODO.md. Do NOT update any "Last updated" lines.
|
|
99
98
|
|
|
100
|
-
## Step
|
|
99
|
+
## Step 7: Display Confirmation
|
|
101
100
|
|
|
102
101
|
**IMPORTANT:** Output the following directly as formatted text, NOT wrapped in a markdown code block:
|
|
103
102
|
|
|
@@ -124,9 +123,9 @@ Also update `*Last updated:` line at the bottom.
|
|
|
124
123
|
- [ ] Initialization verified
|
|
125
124
|
- [ ] Todos directory exists
|
|
126
125
|
- [ ] Description obtained (from arg or prompt)
|
|
127
|
-
- [ ] Unique TODO-XXX ID generated
|
|
128
|
-
- [ ]
|
|
129
|
-
- [ ]
|
|
130
|
-
- [ ]
|
|
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)
|
|
131
130
|
- [ ] Clear confirmation and next actions shown
|
|
132
131
|
</success_criteria>
|