specflow-cc 1.17.1 → 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>
@@ -15,7 +15,7 @@ Review findings from the last codebase scan and selectively convert them to TODO
15
15
 
16
16
  <context>
17
17
  @.specflow/SCAN.md
18
- @.specflow/todos/TODO.md
18
+ @.specflow/todos/
19
19
  </context>
20
20
 
21
21
  <arguments>
@@ -146,48 +146,47 @@ For each selected finding:
146
146
  ### 6.1 Generate TODO ID
147
147
 
148
148
  ```bash
149
- 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
150
150
  ```
151
151
 
152
- ### 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).
153
153
 
154
- ```markdown
155
- ## TODO-{XXX} — {YYYY-MM-DD}
156
- **Description:** {category}: {title}
157
- **Priority:** {high|medium|low}
158
- **Notes:**
159
- - Source: SCAN.md ({scan date})
160
- - Files: {files}
161
- - Problem: {problem}
162
- - Suggested fix: {fix}
163
-
164
- ---
165
- ```
166
-
167
- ### 6.3 Append to TODO.md
154
+ ### 6.2 Create TODO File
168
155
 
169
156
  Ensure `.specflow/todos/` directory exists:
170
157
  ```bash
171
158
  mkdir -p .specflow/todos
172
159
  ```
173
160
 
174
- If TODO.md doesn't exist, create with header:
175
- ```markdown
176
- # To-Do List
161
+ Create `.specflow/todos/TODO-{XXX}.md` using the Write tool:
177
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}
178
173
  ---
179
174
 
180
- {new todo entries}
175
+ ## Description
181
176
 
182
- ---
183
- *Last updated: {YYYY-MM-DD}*
184
- ```
177
+ {category}: {title}
178
+
179
+ {problem description}
180
+
181
+ ## Notes
185
182
 
186
- If TODO.md exists, use the **Edit** tool (NOT Write) to make two targeted edits:
187
- 1. Insert new entries after the first `---` following `# To-Do List`
188
- 2. Update the `*Last updated:` timestamp
183
+ - Source: SCAN.md ({scan date})
184
+ - Files: {files affected}
185
+ - Problem: {problem}
186
+ - Suggested fix: {fix}
187
+ ```
189
188
 
190
- **CRITICAL:** Never rewrite the entire file with Write. Use Edit to insert new blocks and update the timestamp this preserves all existing todos.
189
+ Do NOT append to TODO.md. Do NOT update any "Last updated" lines. Each finding gets its own separate TODO-XXX.md file.
191
190
 
192
191
  ## Step 7: Display Results
193
192
 
@@ -252,8 +251,9 @@ Run /sf:triage again to review findings.
252
251
  - [ ] Findings extracted with priority levels
253
252
  - [ ] User shown summary of findings
254
253
  - [ ] Interactive selection completed (or --all used)
255
- - [ ] 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)
256
256
  - [ ] Priority preserved from scan
257
- - [ ] Source reference included in notes
257
+ - [ ] Source reference included in notes (scan date, files, problem)
258
258
  - [ ] Clear summary of created TODOs
259
259
  </success_criteria>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specflow-cc",
3
- "version": "1.17.1",
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]*