specdacular 0.2.5 → 0.5.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.
Files changed (34) hide show
  1. package/README.md +186 -68
  2. package/commands/specd/blueprint.md +64 -0
  3. package/commands/specd/{discuss-feature.md → feature/discuss.md} +1 -1
  4. package/commands/specd/{new-feature.md → feature/new.md} +3 -3
  5. package/commands/specd/{plan-feature.md → feature/plan.md} +15 -18
  6. package/commands/specd/{research-feature.md → feature/research.md} +5 -5
  7. package/commands/specd/help.md +51 -29
  8. package/commands/specd/{execute-plan.md → phase/execute.md} +4 -4
  9. package/commands/specd/phase/insert.md +62 -0
  10. package/commands/specd/phase/plan.md +73 -0
  11. package/commands/specd/{discuss-phase.md → phase/prepare.md} +21 -9
  12. package/commands/specd/phase/renumber.md +66 -0
  13. package/commands/specd/{research-phase.md → phase/research.md} +3 -1
  14. package/commands/specd/status.md +20 -0
  15. package/package.json +1 -1
  16. package/specdacular/agents/feature-researcher.md +4 -2
  17. package/specdacular/templates/blueprint/index.html +110 -0
  18. package/specdacular/templates/blueprint/scripts.js +71 -0
  19. package/specdacular/templates/blueprint/styles.css +429 -0
  20. package/specdacular/templates/features/STATE.md +6 -4
  21. package/specdacular/workflows/blueprint-diagrams.md +273 -0
  22. package/specdacular/workflows/blueprint-wireframes.md +312 -0
  23. package/specdacular/workflows/blueprint.md +372 -0
  24. package/specdacular/workflows/discuss-feature.md +4 -4
  25. package/specdacular/workflows/execute-plan.md +4 -4
  26. package/specdacular/workflows/insert-phase.md +222 -0
  27. package/specdacular/workflows/new-feature.md +5 -5
  28. package/specdacular/workflows/plan-feature.md +60 -233
  29. package/specdacular/workflows/plan-phase.md +363 -0
  30. package/specdacular/workflows/prepare-phase.md +759 -0
  31. package/specdacular/workflows/renumber-phases.md +273 -0
  32. package/specdacular/workflows/research-phase.md +5 -3
  33. package/specdacular/workflows/status.md +85 -0
  34. package/specdacular/workflows/discuss-phase.md +0 -389
@@ -0,0 +1,273 @@
1
+ <purpose>
2
+ Renumber all phases to a clean integer sequence after decimal phases have been inserted.
3
+
4
+ **Key principles:**
5
+ - Always preview and confirm before renaming anything
6
+ - Rename directories highest-to-lowest to avoid collisions
7
+ - Update ALL references: directories, plan frontmatter, ROADMAP.md, STATE.md
8
+ - Remove `(INSERTED)` markers after renumbering
9
+
10
+ **Output:** Renamed phase directories, updated ROADMAP.md, STATE.md, config.json, plan frontmatter
11
+ </purpose>
12
+
13
+ <process>
14
+
15
+ <step name="validate">
16
+ Validate the feature exists and has the required structure.
17
+
18
+ 1. Check feature directory exists:
19
+ ```bash
20
+ [ -d ".specd/features/$feature" ] || { echo "Feature not found"; exit 1; }
21
+ ```
22
+
23
+ 2. Check plans directory exists:
24
+ ```bash
25
+ [ -d ".specd/features/$feature/plans" ] || { echo "No plans directory"; exit 1; }
26
+ ```
27
+
28
+ 3. Check ROADMAP.md exists:
29
+ ```bash
30
+ [ -f ".specd/features/$feature/ROADMAP.md" ] || { echo "No ROADMAP.md"; exit 1; }
31
+ ```
32
+
33
+ **If feature not found:**
34
+ ```
35
+ Feature '{name}' not found.
36
+
37
+ Available features:
38
+ {list .specd/features/*/}
39
+ ```
40
+ </step>
41
+
42
+ <step name="collect_phases">
43
+ List all phase directories and build the renumbering mapping.
44
+
45
+ 1. List all `phase-*` directories under `plans/`:
46
+ ```bash
47
+ ls -d .specd/features/$feature/plans/phase-* 2>/dev/null | sort -V
48
+ ```
49
+
50
+ 2. Sort numerically — integers first, then decimals in order:
51
+ - phase-01, phase-02, phase-03, phase-03.1, phase-03.2, phase-04, phase-05
52
+ - Use version sort (`sort -V`) to get correct ordering
53
+
54
+ 3. Build mapping: assign sequential integers starting from 01:
55
+ ```
56
+ phase-01 → phase-01 (unchanged)
57
+ phase-02 → phase-02 (unchanged)
58
+ phase-03 → phase-03 (unchanged)
59
+ phase-03.1 → phase-04 (renumbered)
60
+ phase-03.2 → phase-05 (renumbered)
61
+ phase-04 → phase-06 (renumbered)
62
+ phase-05 → phase-07 (renumbered)
63
+ ```
64
+
65
+ 4. Identify which directories actually need renaming (skip unchanged ones)
66
+
67
+ **If no decimal phases found:**
68
+ ```
69
+ No decimal phases found — nothing to renumber.
70
+
71
+ All phases are already clean integers:
72
+ {list phases}
73
+ ```
74
+ Exit workflow.
75
+ </step>
76
+
77
+ <step name="preview">
78
+ Show the user the renumbering mapping and ask for confirmation.
79
+
80
+ ```
81
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
82
+ PHASE RENUMBERING PREVIEW
83
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
84
+
85
+ Feature: {feature}
86
+
87
+ | Current | New | Status |
88
+ |---------|-----|--------|
89
+ | phase-01/ | phase-01/ | unchanged |
90
+ | phase-02/ | phase-02/ | unchanged |
91
+ | phase-03/ | phase-03/ | unchanged |
92
+ | phase-03.1/ | phase-04/ | renumbered |
93
+ | phase-04/ | phase-05/ | renumbered |
94
+
95
+ Directories to rename: {count}
96
+ Files to update: ROADMAP.md, STATE.md, config.json, plan frontmatter
97
+ ```
98
+
99
+ Use AskUserQuestion:
100
+ - header: "Renumber"
101
+ - question: "Proceed with phase renumbering?"
102
+ - options:
103
+ - "Yes, renumber" — Continue to rename_directories
104
+ - "Cancel" — Exit workflow
105
+
106
+ **If user cancels:** Exit with "Renumbering cancelled. No changes made."
107
+ </step>
108
+
109
+ <step name="rename_directories">
110
+ Rename phase directories, processing from highest target number down to avoid collisions.
111
+
112
+ **Why highest-to-lowest?** If we rename phase-03.1 → phase-04 first, it would collide with the existing phase-04. By starting from the highest target number and working down, we avoid this:
113
+
114
+ 1. Build list of renames needed, sorted by target number descending
115
+ 2. For each rename (highest first):
116
+ ```bash
117
+ mv ".specd/features/$feature/plans/phase-{old}" ".specd/features/$feature/plans/phase-{new}"
118
+ ```
119
+
120
+ Example order:
121
+ ```bash
122
+ # Process highest target first to avoid collisions
123
+ mv plans/phase-04/ plans/phase-05/ # 04 → 05 (no collision, 05 doesn't exist)
124
+ mv plans/phase-03.1/ plans/phase-04/ # 03.1 → 04 (no collision, 04 just moved)
125
+ ```
126
+
127
+ 3. Skip directories that don't change (e.g., phase-01 → phase-01)
128
+
129
+ 4. Confirm each rename:
130
+ ```
131
+ Renamed: phase-{old}/ → phase-{new}/
132
+ ```
133
+ </step>
134
+
135
+ <step name="update_plan_frontmatter">
136
+ Update YAML frontmatter in every plan file under the renamed phases.
137
+
138
+ 1. Find all plan files (`*.md`) in renamed phase directories:
139
+ ```bash
140
+ find .specd/features/$feature/plans/ -name "*.md" -type f
141
+ ```
142
+
143
+ 2. For each plan file, read and update:
144
+ - `phase:` field in YAML frontmatter — update to new integer phase number
145
+ - `depends_on:` paths that reference renamed phases — update phase directory names
146
+ (e.g., `phase-03.1/01-PLAN.md` → `phase-04/01-PLAN.md`)
147
+
148
+ 3. Only modify files that actually contain references to renamed phases
149
+
150
+ **Example frontmatter update:**
151
+ ```yaml
152
+ # Before:
153
+ phase: "03.1"
154
+ depends_on:
155
+ - "phase-03/02-PLAN.md"
156
+
157
+ # After:
158
+ phase: "04"
159
+ depends_on:
160
+ - "phase-03/02-PLAN.md" # unchanged — phase-03 didn't move
161
+ ```
162
+
163
+ Also scan plan files in phases that weren't renamed, in case they reference a renamed phase in their `depends_on`.
164
+ </step>
165
+
166
+ <step name="update_roadmap">
167
+ Rewrite phase headers and references in ROADMAP.md.
168
+
169
+ 1. Read ROADMAP.md
170
+
171
+ 2. For each phase in the mapping that changed:
172
+ - Update phase headings: `## Phase {old}:` → `## Phase {new}:`
173
+ - Remove `(INSERTED)` markers from renumbered phases
174
+ - Update plan references within phase sections (e.g., "Plan 3.1.01" → "Plan 4.01")
175
+ - Update cross-references to other phases that were renumbered
176
+
177
+ 3. Preserve all other content exactly (descriptions, goals, plan details)
178
+
179
+ 4. Write updated ROADMAP.md
180
+
181
+ **Example:**
182
+ ```markdown
183
+ # Before:
184
+ ## Phase 03.1: Architecture Update (INSERTED)
185
+
186
+ # After:
187
+ ## Phase 04: Architecture Update
188
+ ```
189
+ </step>
190
+
191
+ <step name="update_state">
192
+ Rewrite all phase references in STATE.md.
193
+
194
+ 1. Read STATE.md
195
+
196
+ 2. Update ALL phase references throughout the file:
197
+ - **Stage Progress checkboxes:** `Phase {old}` → `Phase {new}`
198
+ - **Plan Status table:** Phase column values
199
+ - **Completed Plans table:** Plan paths containing phase directories
200
+ - **Current Plan section:** If referencing a renamed phase
201
+ - **Roadmap Evolution notes:** Update phase numbers in evolution history
202
+ - **Session Notes:** Any phase references
203
+
204
+ 3. For roadmap evolution, add a note about renumbering:
205
+ ```markdown
206
+ - Phases renumbered to clean integer sequence: {mapping summary}
207
+ ```
208
+
209
+ 4. Write updated STATE.md
210
+ </step>
211
+
212
+ <step name="update_config">
213
+ Update config.json with the new phase count.
214
+
215
+ 1. Read config.json
216
+ 2. Set `phases_count` to the total number of integer phases (the final count after renumbering)
217
+ 3. Write updated config.json
218
+ </step>
219
+
220
+ <step name="completion">
221
+ Present completion summary:
222
+
223
+ ```
224
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
225
+ PHASES RENUMBERED
226
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
227
+
228
+ Feature: {feature}
229
+
230
+ **Renames:**
231
+ {For each rename:}
232
+ - phase-{old}/ → phase-{new}/
233
+
234
+ **Updated files:**
235
+ - ROADMAP.md — Phase headers and references updated
236
+ - STATE.md — All phase references updated
237
+ - config.json — phases_count = {new count}
238
+ - {N} plan files — Frontmatter updated
239
+
240
+ **Removed markers:** (INSERTED) tags cleaned up
241
+
242
+ ───────────────────────────────────────────────────────
243
+
244
+ All phases now use clean integer numbering.
245
+ `/specd:phase:execute {feature}` to continue execution.
246
+ ```
247
+
248
+ End workflow.
249
+ </step>
250
+
251
+ </process>
252
+
253
+ <safety>
254
+ - Always preview and confirm before any renames
255
+ - Process renames highest-to-lowest to avoid directory collisions
256
+ - Skip directories that don't change
257
+ - Update ALL references across all files before finishing
258
+ - If any rename fails, stop and report — don't leave partial state
259
+ </safety>
260
+
261
+ <success_criteria>
262
+ Renumbering is complete when:
263
+
264
+ - [ ] Feature validated with plans and ROADMAP.md
265
+ - [ ] All phase directories collected and sorted correctly
266
+ - [ ] Renumbering mapping previewed and confirmed by user
267
+ - [ ] Directories renamed without collisions (highest-to-lowest)
268
+ - [ ] Plan file frontmatter updated (phase, depends_on references)
269
+ - [ ] ROADMAP.md headers updated, `(INSERTED)` markers removed
270
+ - [ ] STATE.md phase references updated everywhere
271
+ - [ ] config.json `phases_count` set to final integer count
272
+ - [ ] Summary shown to user
273
+ </success_criteria>
@@ -111,7 +111,7 @@ Load all context needed for phase research.
111
111
 
112
112
  **Read phase context:**
113
113
  - All plan files in `plans/phase-{NN}/`
114
- - `plans/phase-{NN}/CONTEXT.md` if exists (from discuss-phase)
114
+ - `plans/phase-{NN}/CONTEXT.md` if exists (from phase:prepare)
115
115
  - Previous phases' RESEARCH.md files for continuity
116
116
 
117
117
  **Read codebase context:**
@@ -560,9 +560,11 @@ Present summary and next options.
560
560
 
561
561
  ## What's Next
562
562
 
563
- **/specd:execute-plan {feature}** — Execute this phase (will load phase research)
563
+ **/specd:phase:execute {feature}** — Execute this phase (will load phase research)
564
564
 
565
- **/specd:discuss-phase {feature} {N}** — Discuss this phase further
565
+ **/specd:phase:prepare {feature} {N}** — Discuss this phase further
566
+
567
+ **/specd:phase:plan {feature} {N}** — Create detailed plans for this phase
566
568
 
567
569
  <sub>/clear first — fresh context window for execution</sub>
568
570
  ```
@@ -0,0 +1,85 @@
1
+ # Workflow: Feature Status Dashboard
2
+
3
+ ## Input
4
+
5
+ - `$ARGUMENTS` — may contain `--all` flag
6
+
7
+ ## Steps
8
+
9
+ ### 1. Parse arguments
10
+
11
+ Check if `$ARGUMENTS` contains `--all`. If so, completed features will be shown in a separate section.
12
+
13
+ ### 2. Check for features directory
14
+
15
+ Use Glob to check if `.specd/features/*/config.json` matches anything.
16
+
17
+ If no matches: output the following and stop:
18
+
19
+ ```
20
+ No features found. Start one with `/specd:feature:new [name]`.
21
+ ```
22
+
23
+ ### 3. Gather feature data
24
+
25
+ For each feature directory in `.specd/features/`:
26
+
27
+ 1. **Read `config.json`** — extract: `feature_name`, `created`, `stage`, `phases_count`, `plans_count`
28
+ 2. **Read `STATE.md`** — extract:
29
+ - **Authoritative stage**: Look for `**Stage:** <value>` in the Current Position section. This overrides `config.json` stage. A feature is complete when stage is `complete`.
30
+ - **Plan completion**: From the `Plan Status` table, count rows with Status = `Complete` vs total rows. Format as `completed/total` (e.g. `5/8`). If no Plan Status table or no rows, use `—`.
31
+ - **Next action**: Extract the first meaningful line from the `## Next Steps` section. Keep it short — take just the **Recommended:** line if present, otherwise the first line. Strip markdown formatting like `**Recommended:**` prefix. Truncate to ~50 chars if needed.
32
+
33
+ ### 4. Sort features
34
+
35
+ Sort active features by stage priority (highest first), then by created date (oldest first):
36
+
37
+ 1. `execution` (most advanced)
38
+ 2. `planning`
39
+ 3. `research`
40
+ 4. `discussion` (least advanced)
41
+
42
+ ### 5. Format output
43
+
44
+ **Count features:** Calculate total count and in-progress count (non-complete).
45
+
46
+ **Output header:**
47
+
48
+ ```
49
+ # Feature Status
50
+
51
+ _{total} features, {in_progress} in progress_
52
+ ```
53
+
54
+ **Active features table:**
55
+
56
+ ```
57
+ | Feature | Stage | Plans | Created | Next Action |
58
+ |---------|-------|-------|---------|-------------|
59
+ | {name} | {stage} | {plans} | {created} | {next_action} |
60
+ ```
61
+
62
+ - `Plans` shows the completed/total count from Plan Status table, or `—` if pre-planning
63
+ - `Next Action` is the extracted recommendation from STATE.md Next Steps
64
+
65
+ **If `--all` flag is NOT set and there are completed features:**
66
+
67
+ ```
68
+ Run `/specd:status --all` to include completed features.
69
+ ```
70
+
71
+ **If `--all` flag IS set and there are completed features, add:**
72
+
73
+ ```
74
+ ### Completed
75
+
76
+ | Feature | Plans | Completed |
77
+ |---------|-------|-----------|
78
+ | {name} | {completed}/{total} | {last_updated} |
79
+ ```
80
+
81
+ Where `Completed` date comes from the `**Last Updated:**` field in STATE.md.
82
+
83
+ ### 6. Output
84
+
85
+ Print the formatted dashboard directly. No file writes. No Task agents. No AskUserQuestion.