specdacular 0.7.1 → 0.8.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.
Files changed (63) hide show
  1. package/README.md +72 -74
  2. package/commands/specd/continue.md +59 -0
  3. package/commands/specd/new.md +65 -0
  4. package/commands/specd/status.md +1 -1
  5. package/commands/specd/toolbox.md +59 -0
  6. package/package.json +1 -1
  7. package/specdacular/HELP.md +19 -16
  8. package/specdacular/agents/feature-researcher.md +4 -4
  9. package/specdacular/references/load-context.md +83 -0
  10. package/specdacular/references/record-decision.md +61 -0
  11. package/specdacular/references/select-feature.md +20 -20
  12. package/specdacular/references/select-phase.md +3 -3
  13. package/specdacular/references/spawn-research-agents.md +180 -0
  14. package/specdacular/references/synthesize-research.md +127 -0
  15. package/specdacular/references/validate-task.md +64 -0
  16. package/specdacular/templates/{features → tasks}/CHANGELOG.md +2 -8
  17. package/specdacular/templates/{features → tasks}/CONTEXT.md +6 -17
  18. package/specdacular/templates/tasks/DECISIONS.md +46 -0
  19. package/specdacular/templates/{features → tasks}/FEATURE.md +3 -3
  20. package/specdacular/templates/tasks/PLAN.md +91 -0
  21. package/specdacular/templates/tasks/RESEARCH.md +121 -0
  22. package/specdacular/templates/{features → tasks}/ROADMAP.md +6 -43
  23. package/specdacular/templates/tasks/STATE.md +93 -0
  24. package/specdacular/templates/tasks/config.json +15 -0
  25. package/specdacular/workflows/continue.md +275 -0
  26. package/specdacular/workflows/discuss.md +184 -0
  27. package/specdacular/workflows/execute.md +174 -0
  28. package/specdacular/workflows/new.md +299 -0
  29. package/specdacular/workflows/orchestrator/new.md +265 -0
  30. package/specdacular/workflows/orchestrator/plan.md +169 -0
  31. package/specdacular/workflows/plan.md +201 -0
  32. package/specdacular/workflows/research.md +166 -0
  33. package/specdacular/workflows/review.md +289 -0
  34. package/specdacular/workflows/status.md +17 -17
  35. package/commands/specd/blueprint.md +0 -64
  36. package/commands/specd/feature/continue.md +0 -84
  37. package/commands/specd/feature/new.md +0 -67
  38. package/commands/specd/feature/toolbox.md +0 -49
  39. package/specdacular/templates/blueprint/index.html +0 -110
  40. package/specdacular/templates/blueprint/scripts.js +0 -71
  41. package/specdacular/templates/blueprint/styles.css +0 -429
  42. package/specdacular/templates/features/DECISIONS.md +0 -109
  43. package/specdacular/templates/features/DEPENDENCIES.md +0 -47
  44. package/specdacular/templates/features/PLAN.md +0 -180
  45. package/specdacular/templates/features/RESEARCH.md +0 -183
  46. package/specdacular/templates/features/STATE.md +0 -110
  47. package/specdacular/templates/features/config.json +0 -20
  48. package/specdacular/workflows/blueprint-diagrams.md +0 -273
  49. package/specdacular/workflows/blueprint-wireframes.md +0 -312
  50. package/specdacular/workflows/blueprint.md +0 -372
  51. package/specdacular/workflows/continue-feature.md +0 -621
  52. package/specdacular/workflows/discuss-feature.md +0 -382
  53. package/specdacular/workflows/execute-plan.md +0 -636
  54. package/specdacular/workflows/insert-phase.md +0 -246
  55. package/specdacular/workflows/new-feature.md +0 -760
  56. package/specdacular/workflows/plan-feature.md +0 -691
  57. package/specdacular/workflows/plan-phase.md +0 -355
  58. package/specdacular/workflows/prepare-phase.md +0 -745
  59. package/specdacular/workflows/renumber-phases.md +0 -273
  60. package/specdacular/workflows/research-feature.md +0 -252
  61. package/specdacular/workflows/research-phase.md +0 -576
  62. package/specdacular/workflows/review-feature.md +0 -316
  63. package/specdacular/workflows/review-phase.md +0 -545
@@ -1,372 +0,0 @@
1
- <purpose>
2
- Generate a visual HTML blueprint for exploring Specdacular feature artifacts.
3
-
4
- Reads FEATURE.md, CONTEXT.md, DECISIONS.md, and plans/ to create a browsable
5
- static HTML file with sidebar navigation and accordion decision viewer.
6
-
7
- **Output:** `.specd/features/{name}/blueprint/index.html`
8
- </purpose>
9
-
10
- <philosophy>
11
-
12
- ## Self-Contained Output
13
-
14
- The generated HTML must work when opened directly in a browser (file:// protocol).
15
- All CSS and JS is inlined. Only external dependency is Mermaid.js CDN.
16
-
17
- ## Parse Defensively
18
-
19
- Markdown files may have missing fields, multi-line values, or edge cases.
20
- Always provide defaults and handle gracefully.
21
-
22
- ## HTML-Escape Everything
23
-
24
- All content from markdown files must be HTML-escaped before embedding
25
- to prevent XSS and layout breakage.
26
-
27
- </philosophy>
28
-
29
- <process>
30
-
31
- <step name="parse_arguments">
32
- Parse the command arguments.
33
-
34
- **Input:** `$ARGUMENTS` (e.g., "my-feature wireframes")
35
-
36
- **Extract:**
37
- - Feature name: First word
38
- - Subcommand: Second word (optional) — "wireframes", "diagrams", or empty
39
-
40
- ```bash
41
- # Parse arguments
42
- FEATURE_NAME=$(echo "$ARGUMENTS" | awk '{print $1}')
43
- SUBCOMMAND=$(echo "$ARGUMENTS" | awk '{print $2}')
44
-
45
- echo "Feature: $FEATURE_NAME"
46
- echo "Subcommand: $SUBCOMMAND"
47
- ```
48
-
49
- **If no feature name:**
50
- ```
51
- Please provide a feature name: /specd:blueprint {feature-name}
52
- ```
53
-
54
- Continue to validate.
55
- </step>
56
-
57
- <step name="validate">
58
- Check feature exists and has required files.
59
-
60
- ```bash
61
- # Check feature directory exists
62
- [ -d ".specd/features/$FEATURE_NAME" ] || { echo "not found"; exit 1; }
63
-
64
- # Check required files
65
- [ -f ".specd/features/$FEATURE_NAME/FEATURE.md" ] || { echo "missing FEATURE.md"; exit 1; }
66
- [ -f ".specd/features/$FEATURE_NAME/CONTEXT.md" ] || { echo "missing CONTEXT.md"; exit 1; }
67
- [ -f ".specd/features/$FEATURE_NAME/DECISIONS.md" ] || { echo "missing DECISIONS.md"; exit 1; }
68
-
69
- # Check optional files
70
- [ -d ".specd/features/$FEATURE_NAME/plans" ] && echo "has_plans"
71
- [ -f ".specd/features/$FEATURE_NAME/blueprint/wireframes.html" ] && echo "has_wireframes"
72
- [ -f ".specd/features/$FEATURE_NAME/blueprint/diagrams.html" ] && echo "has_diagrams"
73
- ```
74
-
75
- **If feature not found:**
76
- ```
77
- Feature '{name}' not found.
78
-
79
- Run /specd:feature:new {name} to create it first.
80
- ```
81
-
82
- Continue to load_context.
83
- </step>
84
-
85
- <step name="load_context">
86
- Read all feature files.
87
-
88
- **Read with Read tool:**
89
- - `.specd/features/{name}/FEATURE.md`
90
- - `.specd/features/{name}/CONTEXT.md`
91
- - `.specd/features/{name}/DECISIONS.md`
92
- - `.specd/features/{name}/STATE.md` (for stats)
93
- - `.specd/features/{name}/config.json` (for counts)
94
-
95
- **If plans/ exists:**
96
- - List all plan files: `.specd/features/{name}/plans/phase-*/`
97
- - Read ROADMAP.md if exists
98
-
99
- Continue to parse_decisions.
100
- </step>
101
-
102
- <step name="parse_decisions">
103
- Parse DECISIONS.md to extract decision data.
104
-
105
- **Parsing strategy:**
106
- 1. Split content on `### DEC-` to find decision blocks
107
- 2. For each block:
108
- - Extract ID from heading: `### DEC-XXX: Title`
109
- - Parse `**Date:**` line for date
110
- - Parse `**Phase:**` line for phase number (default: 0 if missing)
111
- - Parse `**Status:**` line for status
112
- - Parse `**Context:**` for context (may be multi-line)
113
- - Parse `**Decision:**` for decision text
114
- - Parse `**Rationale:**` for bullet points
115
- - Parse `**Implications:**` for bullet points
116
-
117
- **Output format (for each decision):**
118
- ```
119
- {
120
- id: "DEC-001",
121
- title: "Decision title",
122
- date: "2026-02-04",
123
- phase: 0,
124
- status: "Active",
125
- context: "Context text...",
126
- decision: "Decision text...",
127
- rationale: ["Reason 1", "Reason 2"],
128
- implications: ["Implication 1", "Implication 2"]
129
- }
130
- ```
131
-
132
- **Edge cases:**
133
- - Missing Phase field → default to 0 (pre-planning)
134
- - Phase: 0 → label as "Pre-planning"
135
- - Missing fields → use empty string or "Unknown"
136
- - Multi-line values → collect until next `**Field:**`
137
- - Code blocks → skip parsing inside triple backticks
138
-
139
- **Collect unique phases** from all decisions (sorted numerically) for phase tab generation.
140
-
141
- Continue to parse_context.
142
- </step>
143
-
144
- <step name="parse_context">
145
- Parse CONTEXT.md to extract resolved questions.
146
-
147
- **Parsing strategy:**
148
- 1. Find `## Resolved Questions` section
149
- 2. Split on `### ` to find question blocks
150
- 3. For each question:
151
- - Extract title from heading
152
- - Parse `**Question:**` for the question
153
- - Parse `**Resolution:**` for the answer
154
- - Parse `**Details:**` for bullet points
155
- - Parse `**Related Decisions:**` for decision references (e.g., "DEC-001")
156
-
157
- **Associate with phase:**
158
- - Check `**Related Decisions:** DEC-XXX` field
159
- - Look up the phase of the referenced decision (from parsed decisions)
160
- - If no related decision, use phase 0
161
-
162
- **Output format:**
163
- ```
164
- {
165
- title: "Question title",
166
- question: "What was unclear?",
167
- resolution: "The answer",
168
- details: ["Detail 1", "Detail 2"],
169
- relatedDecisions: ["DEC-001"],
170
- phase: 0
171
- }
172
- ```
173
-
174
- Continue to parse_feature.
175
- </step>
176
-
177
- <step name="parse_feature">
178
- Parse FEATURE.md to extract overview and stats.
179
-
180
- **Extract:**
181
- - `## What This Is` section → feature description
182
- - Count items in `### Must Create` → files to create count
183
- - `## Success Criteria` items → for progress indicators
184
-
185
- **From config.json:**
186
- - `discussion_sessions` count
187
- - `decisions_count`
188
-
189
- **From plans/:**
190
- - Count phase directories
191
- - Count plan files
192
-
193
- Continue to generate_html.
194
- </step>
195
-
196
- <step name="generate_html">
197
- Generate the HTML by filling in the template.
198
-
199
- **Read templates:**
200
- - `~/.claude/specdacular/templates/blueprint/index.html`
201
- - `~/.claude/specdacular/templates/blueprint/styles.css`
202
- - `~/.claude/specdacular/templates/blueprint/scripts.js`
203
-
204
- **Replace placeholders:**
205
- - `{feature-name}` → Feature name
206
- - `{date}` → Current date (YYYY-MM-DD)
207
- - `{feature-description}` → From FEATURE.md "What This Is"
208
- - `{decisions-count}` → Number of decisions
209
- - `{sessions-count}` → Number of discussion sessions
210
- - `{plans-count}` → Number of plans
211
- - `{styles}` → Contents of styles.css
212
- - `{scripts}` → Contents of scripts.js
213
-
214
- **Generate phase tabs HTML:**
215
- Collect unique phases from decisions (sorted numerically).
216
- For each section (Decisions, Context), generate:
217
-
218
- ```html
219
- <button class="phase-tab all-tab active" data-phase="all">All</button>
220
- <button class="phase-tab" data-phase="0">Pre-planning</button>
221
- <button class="phase-tab" data-phase="1">Phase 1</button>
222
- <button class="phase-tab" data-phase="2">Phase 2</button>
223
- <!-- ... for each phase found -->
224
- ```
225
-
226
- **Replace placeholders:**
227
- - `{decisions-phase-tabs}` → Generated phase tabs for decisions
228
- - `{context-phase-tabs}` → Generated phase tabs for context
229
- - `{plans-phase-tabs}` → Generated phase tabs for plans (no "All" tab needed, use phase numbers only)
230
-
231
- **Generate decisions HTML:**
232
- Group decisions by phase, wrap each group in a phase-content div:
233
- ```html
234
- <div class="phase-content active" data-phase="0">
235
- <!-- Pre-planning decisions -->
236
- <details class="decision-item">
237
- <summary class="decision-header">
238
- <span class="decision-id">{id}</span>
239
- <span class="decision-title">{title}</span>
240
- <span class="decision-status status-{status-lower}">{status}</span>
241
- <span class="decision-date">{date}</span>
242
- </summary>
243
- <div class="decision-content">
244
- <p><strong>Context:</strong> {context}</p>
245
- <p><strong>Decision:</strong> {decision}</p>
246
- <p><strong>Rationale:</strong></p>
247
- <ul>{rationale-items}</ul>
248
- <p><strong>Implications:</strong></p>
249
- <ul>{implication-items}</ul>
250
- </div>
251
- </details>
252
- </div>
253
- <div class="phase-content active" data-phase="1">
254
- <!-- Phase 1 decisions -->
255
- </div>
256
- ```
257
-
258
- All phase-content divs start with `active` class so "All" tab shows everything by default.
259
-
260
- **Generate context HTML:**
261
- For each resolved question, associate with a phase via `**Related Decisions:** DEC-XXX` field:
262
- - Look up the phase of the referenced decision
263
- - If no related decision, use phase 0
264
- - Wrap context items in phase-content divs (same pattern as decisions)
265
-
266
- **Generate plans HTML:**
267
- Plans are already grouped by phase directory. Wrap each phase in a phase-content div:
268
- ```html
269
- <div class="phase-content active" data-phase="1">
270
- <div class="phase-group">
271
- <div class="phase-header">Phase 1: {title}</div>
272
- <div class="plan-item">...</div>
273
- </div>
274
- </div>
275
- <div class="phase-content active" data-phase="2">
276
- <div class="phase-group">
277
- <div class="phase-header">Phase 2: {title}</div>
278
- <div class="plan-item">...</div>
279
- </div>
280
- </div>
281
- ```
282
-
283
- **Generate timeline HTML:**
284
- Combine decision dates and discussion session dates into chronological timeline.
285
-
286
- **Tab states:**
287
- - `{wireframes-disabled}` → "disabled" if no wireframes, empty if exists
288
- - `{diagrams-disabled}` → "disabled" if no diagrams, empty if exists
289
-
290
- **HTML-escape all content:**
291
- ```javascript
292
- text.replace(/&/g, '&amp;')
293
- .replace(/</g, '&lt;')
294
- .replace(/>/g, '&gt;')
295
- .replace(/"/g, '&quot;')
296
- ```
297
-
298
- Continue to write_output.
299
- </step>
300
-
301
- <step name="write_output">
302
- Write the generated HTML to the blueprint directory.
303
-
304
- ```bash
305
- # Create blueprint directory
306
- mkdir -p ".specd/features/$FEATURE_NAME/blueprint"
307
- ```
308
-
309
- **Write file:**
310
- Use Write tool to create `.specd/features/{name}/blueprint/index.html`
311
- with the generated HTML content.
312
-
313
- Continue to open_browser.
314
- </step>
315
-
316
- <step name="open_browser">
317
- Open the blueprint in the default browser.
318
-
319
- ```bash
320
- open ".specd/features/$FEATURE_NAME/blueprint/index.html"
321
- ```
322
-
323
- **Present completion:**
324
- ```
325
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
326
- BLUEPRINT GENERATED
327
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
328
-
329
- **Feature:** {feature-name}
330
-
331
- ## Stats
332
- - {N} decisions
333
- - {N} discussion sessions
334
- - {N} plans
335
-
336
- ## Tabs
337
- - Overview ✓
338
- - Decisions ✓
339
- - Context ✓
340
- - Plans {✓ or ✗}
341
- - Wireframes {✓ or "not generated"}
342
- - Diagrams {✓ or "not generated"}
343
-
344
- **File:** `.specd/features/{name}/blueprint/index.html`
345
-
346
- ───────────────────────────────────────────────────────
347
-
348
- ## To Update
349
-
350
- Run `/specd:blueprint {name}` again to regenerate.
351
-
352
- ## To Add Wireframes
353
-
354
- Run `/specd:blueprint {name} wireframes`
355
-
356
- ## To Add Diagrams
357
-
358
- Run `/specd:blueprint {name} diagrams`
359
- ```
360
-
361
- End workflow.
362
- </step>
363
-
364
- </process>
365
-
366
- <success_criteria>
367
- - [ ] Feature validated
368
- - [ ] All files read and parsed
369
- - [ ] HTML generated with all content embedded
370
- - [ ] Output written to `.specd/features/{name}/blueprint/index.html`
371
- - [ ] Browser opens with the blueprint
372
- </success_criteria>