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.
@@ -3,17 +3,22 @@ name: sf:todos
3
3
  description: List all to-do items sorted by priority
4
4
  allowed-tools:
5
5
  - Read
6
+ - Write
6
7
  - Bash
7
8
  ---
8
9
 
9
10
  <purpose>
10
- Display all to-do items from the backlog, sorted by priority. Shows ID, description, priority, and creation date. Provides quick access to convert items to specifications.
11
+ Display all to-do items from the backlog, sorted by priority. Reads individual TODO-XXX.md files (or legacy TODO.md for backward compatibility). Writes an auto-generated INDEX.md after display. Provides quick access to convert items to specifications.
11
12
  </purpose>
12
13
 
13
14
  <context>
14
- @.specflow/todos/TODO.md
15
+ @.specflow/todos/
15
16
  </context>
16
17
 
18
+ <arguments>
19
+ - `[--all]` — Include TODOs with `status: eliminated` in the output (shown as visually distinct).
20
+ </arguments>
21
+
17
22
  <workflow>
18
23
 
19
24
  ## Step 1: Verify Initialization
@@ -30,13 +35,30 @@ Run `/sf:init` to start.
30
35
  ```
31
36
  Exit.
32
37
 
33
- ## Step 2: Check for TODO.md
38
+ ## Step 2: List TODOs via CLI Tool
39
+
40
+ Call the CLI tool, which handles format detection automatically:
34
41
 
42
+ **If `--all` flag was passed:**
35
43
  ```bash
36
- [ -f .specflow/todos/TODO.md ] && echo "EXISTS" || echo "NO_TODOS"
44
+ node bin/sf-tools.cjs todo list --all
37
45
  ```
38
46
 
39
- **If NO_TODOS:**
47
+ **Otherwise:**
48
+ ```bash
49
+ node bin/sf-tools.cjs todo list
50
+ ```
51
+
52
+ The tool returns a JSON array of `{ id, title, priority, status, complexity, created }` objects, sorted by priority (high > medium > low > unset), then by created date (oldest first).
53
+
54
+ Format detection is handled by `cmdTodoList` in `bin/lib/todo.cjs`:
55
+ 1. If `TODO-*.md` files exist in `.specflow/todos/` — uses per-file format
56
+ 2. If no per-file TODOs but `TODO.md` exists — uses legacy format
57
+ 3. If neither — returns empty list
58
+
59
+ ## Step 3: Handle Empty Result
60
+
61
+ **If the list is empty:**
40
62
  ```
41
63
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
42
64
  TO-DO LIST
@@ -47,41 +69,16 @@ No to-do items found.
47
69
  Add your first idea:
48
70
  `/sf:todo "your idea here"`
49
71
  ```
50
- Exit.
51
-
52
- ## Step 3: Parse TODO.md
72
+ Exit (skip INDEX.md regeneration).
53
73
 
54
- Read `.specflow/todos/TODO.md` and extract each todo block:
55
- - ID (TODO-XXX)
56
- - Date (from header)
57
- - Description
58
- - Priority (high | medium | low | —)
59
- - Notes (optional)
60
-
61
- Look for pattern:
62
- ```
63
- ## TODO-XXX — YYYY-MM-DD
64
- **Description:** ...
65
- **Priority:** ...
66
- **Notes:** ...
67
- ```
74
+ ## Step 4: Count Statistics
68
75
 
69
- ## Step 4: Sort by Priority
76
+ From the list:
77
+ - Total count
78
+ - Count by priority (high, medium, low, unset/—)
79
+ - If `--all`: note how many are `status: eliminated`
70
80
 
71
- Sort todos:
72
- 1. high
73
- 2. medium
74
- 3. low
75
- 4. — (unset)
76
-
77
- Within same priority, sort by date (oldest first).
78
-
79
- ## Step 5: Count Statistics
80
-
81
- - Total todos
82
- - By priority (high, medium, low, unset)
83
-
84
- ## Step 6: Display List
81
+ ## Step 5: Display List
85
82
 
86
83
  **IMPORTANT:** Output the following directly as formatted text, NOT wrapped in a markdown code block:
87
84
 
@@ -90,14 +87,16 @@ Within same priority, sort by date (oldest first).
90
87
  TO-DO LIST
91
88
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
92
89
 
93
- | # | ID | Description | Priority | Created |
94
- |----|----------|--------------------------|----------|------------|
95
- | 1 | TODO-001 | Add caching for API | high | 2024-01-10 |
96
- | 2 | TODO-003 | Refactor AuthService | medium | 2024-01-12 |
97
- | 3 | TODO-002 | Update documentation | low | 2024-01-11 |
98
- | 4 | TODO-004 | Research WebSocket | — | 2024-01-13 |
90
+ | # | ID | Title | Priority | Status | Created |
91
+ |----|----------|--------------------------|----------|---------|------------|
92
+ | 1 | TODO-001 | Add caching for API | high | open | 2024-01-10 |
93
+ | 2 | TODO-003 | Refactor AuthService | medium | open | 2024-01-12 |
94
+ | 3 | TODO-002 | Update documentation | low | open | 2024-01-11 |
95
+ | 4 | TODO-004 | Research WebSocket | — | open | 2024-01-13 |
96
+ {If --all: show eliminated items with [eliminated] marker in Status column}
99
97
 
100
98
  **Total:** {N} items ({high} high, {medium} medium, {low} low, {unset} unset)
99
+ {If --all and eliminated exist: (+ {M} eliminated shown)}
101
100
 
102
101
  ---
103
102
 
@@ -108,28 +107,41 @@ Within same priority, sort by date (oldest first).
108
107
  - `/sf:todo "new idea"` — add new item
109
108
  ```
110
109
 
111
- ## Step 7: Show Notes (if any have notes)
110
+ ## Step 6: Regenerate INDEX.md
112
111
 
113
- If any todo has non-empty notes:
112
+ After displaying the list, write `.specflow/todos/INDEX.md` using the Write tool.
114
113
 
115
- ```
116
- ---
114
+ Use the format from `templates/todo-index.md`:
117
115
 
118
- **Notes:**
116
+ ```markdown
117
+ # To-Do Index
119
118
 
120
- **TODO-001:** Consider Redis or in-memory
121
- **TODO-003:** Split into smaller services first
119
+ > Auto-generated from individual TODO files. Do not edit manually.
120
+ > Regenerate with `/sf:todos`.
121
+
122
+ | # | ID | Title | Priority | Status | Created |
123
+ |---|-----|-------|----------|--------|---------|
124
+ {rows from sorted list — one row per TODO}
125
+
126
+ **Total:** {N} items ({high} high, {medium} medium, {low} low, {unset} unset)
127
+
128
+ ---
129
+ *Last regenerated: {YYYY-MM-DD HH:MM}*
122
130
  ```
123
131
 
132
+ **Important:** INDEX.md is a display cache only. Never edit it manually — it is regenerated here each time `/sf:todos` runs.
133
+
124
134
  </workflow>
125
135
 
126
136
  <success_criteria>
127
137
  - [ ] Initialization verified
128
- - [ ] TODO.md parsed if exists
129
- - [ ] All todos extracted with ID, description, priority, date
130
- - [ ] Sorted by priority then date
131
- - [ ] Numbered list displayed (# column for easy reference)
132
- - [ ] Statistics shown
138
+ - [ ] TODOs listed via `node bin/sf-tools.cjs todo list` (format-agnostic)
139
+ - [ ] Empty state handled with helpful message
140
+ - [ ] Sorted by priority then date (oldest first within same priority)
141
+ - [ ] Numbered list displayed with Status column
142
+ - [ ] `--all` flag shows eliminated items visually distinct
143
+ - [ ] Statistics shown (total, by priority)
133
144
  - [ ] Clear actions provided
134
- - [ ] Notes shown if present
145
+ - [ ] INDEX.md written to `.specflow/todos/INDEX.md` after display
146
+ - [ ] INDEX.md contains "Do not edit manually" notice
135
147
  </success_criteria>
@@ -4,6 +4,7 @@ description: Convert scan findings into actionable TODO items
4
4
  allowed-tools:
5
5
  - Read
6
6
  - Write
7
+ - Edit
7
8
  - Bash
8
9
  - AskUserQuestion
9
10
  ---
@@ -14,7 +15,7 @@ Review findings from the last codebase scan and selectively convert them to TODO
14
15
 
15
16
  <context>
16
17
  @.specflow/SCAN.md
17
- @.specflow/todos/TODO.md
18
+ @.specflow/todos/
18
19
  </context>
19
20
 
20
21
  <arguments>
@@ -145,44 +146,47 @@ For each selected finding:
145
146
  ### 6.1 Generate TODO ID
146
147
 
147
148
  ```bash
148
- grep -oP 'TODO-\K\d+' .specflow/todos/TODO.md 2>/dev/null | sort -n | tail -1
149
+ node bin/sf-tools.cjs todo next-id --raw
149
150
  ```
150
151
 
151
- ### 6.2 Format TODO Entry
152
+ This handles both per-file format and legacy TODO.md automatically (uses Node.js fs/regex — not grep -oP).
152
153
 
153
- ```markdown
154
- ## TODO-{XXX} — {YYYY-MM-DD}
155
- **Description:** {category}: {title}
156
- **Priority:** {high|medium|low}
157
- **Notes:**
158
- - Source: SCAN.md ({scan date})
159
- - Files: {files}
160
- - Problem: {problem}
161
- - Suggested fix: {fix}
162
-
163
- ---
164
- ```
165
-
166
- ### 6.3 Append to TODO.md
154
+ ### 6.2 Create TODO File
167
155
 
168
156
  Ensure `.specflow/todos/` directory exists:
169
157
  ```bash
170
158
  mkdir -p .specflow/todos
171
159
  ```
172
160
 
173
- If TODO.md doesn't exist, create with header:
174
- ```markdown
175
- # To-Do List
161
+ Create `.specflow/todos/TODO-{XXX}.md` using the Write tool:
176
162
 
163
+ ```markdown
164
+ ---
165
+ id: TODO-{XXX}
166
+ title: "{category}: {title}"
167
+ priority: {high|medium|low}
168
+ complexity: —
169
+ status: open
170
+ effort: —
171
+ depends_on: —
172
+ created: {YYYY-MM-DD}
177
173
  ---
178
174
 
179
- {new todo entries}
175
+ ## Description
180
176
 
181
- ---
182
- *Last updated: {YYYY-MM-DD}*
177
+ {category}: {title}
178
+
179
+ {problem description}
180
+
181
+ ## Notes
182
+
183
+ - Source: SCAN.md ({scan date})
184
+ - Files: {files affected}
185
+ - Problem: {problem}
186
+ - Suggested fix: {fix}
183
187
  ```
184
188
 
185
- If TODO.md exists, insert new entries after `# To-Do List` line and update timestamp.
189
+ Do NOT append to TODO.md. Do NOT update any "Last updated" lines. Each finding gets its own separate TODO-XXX.md file.
186
190
 
187
191
  ## Step 7: Display Results
188
192
 
@@ -247,8 +251,9 @@ Run /sf:triage again to review findings.
247
251
  - [ ] Findings extracted with priority levels
248
252
  - [ ] User shown summary of findings
249
253
  - [ ] Interactive selection completed (or --all used)
250
- - [ ] TODO items created with full context
254
+ - [ ] Individual TODO-XXX.md files created (one per finding)
255
+ - [ ] Each file has valid YAML frontmatter (id, title, priority, status, created)
251
256
  - [ ] Priority preserved from scan
252
- - [ ] Source reference included in notes
257
+ - [ ] Source reference included in notes (scan date, files, problem)
253
258
  - [ ] Clear summary of created TODOs
254
259
  </success_criteria>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specflow-cc",
3
- "version": "1.17.0",
3
+ "version": "1.18.0",
4
4
  "description": "Spec-driven development system for Claude Code — quality-first workflow with explicit audit cycles",
5
5
  "bin": {
6
6
  "specflow-cc": "bin/install.js"
@@ -0,0 +1,18 @@
1
+ ---
2
+ id: TODO-XXX
3
+ title: "Short title"
4
+ priority: —
5
+ complexity: —
6
+ status: open
7
+ effort: —
8
+ depends_on: —
9
+ created: YYYY-MM-DD
10
+ ---
11
+
12
+ ## Description
13
+
14
+ {description}
15
+
16
+ ## Notes
17
+
18
+ {notes or "—"}
@@ -0,0 +1,13 @@
1
+ # To-Do Index
2
+
3
+ > Auto-generated from individual TODO files. Do not edit manually.
4
+ > Regenerate with `/sf:todos`.
5
+
6
+ | # | ID | Title | Priority | Status | Created |
7
+ |---|-----|-------|----------|--------|---------|
8
+ {rows sorted by priority then date}
9
+
10
+ **Total:** {N} items ({high} high, {medium} medium, {low} low, {unset} unset)
11
+
12
+ ---
13
+ *Last regenerated: {YYYY-MM-DD HH:MM}*
package/templates/todo.md DELETED
@@ -1,15 +0,0 @@
1
- # To-Do List
2
-
3
- <!--
4
- Format for each todo:
5
-
6
- ## TODO-XXX — YYYY-MM-DD
7
- **Description:** Short description
8
- **Priority:** high | medium | low | —
9
- **Notes:** Optional notes
10
-
11
- ---
12
- -->
13
-
14
- ---
15
- *Last updated: [date]*