specsmd 0.0.0-dev.6 → 0.0.0-dev.60

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 (73) hide show
  1. package/README.md +10 -2
  2. package/flows/aidlc/commands/construction-agent.md +5 -1
  3. package/flows/aidlc/commands/inception-agent.md +4 -0
  4. package/flows/aidlc/commands/master-agent.md +4 -0
  5. package/flows/aidlc/commands/operations-agent.md +4 -0
  6. package/flows/aidlc/memory-bank.yaml +2 -1
  7. package/{scripts → flows/aidlc/scripts}/artifact-validator.js +3 -3
  8. package/{scripts → flows/aidlc/scripts}/bolt-complete.js +35 -4
  9. package/{scripts → flows/aidlc/scripts}/status-integrity.js +4 -4
  10. package/flows/aidlc/skills/construction/bolt-list.md +1 -1
  11. package/flows/aidlc/skills/construction/bolt-start.md +2 -2
  12. package/flows/aidlc/skills/construction/bolt-status.md +1 -1
  13. package/flows/aidlc/skills/construction/prototype-apply.md +305 -0
  14. package/flows/aidlc/skills/inception/bolt-plan.md +15 -2
  15. package/flows/aidlc/skills/inception/vibe-to-spec.md +406 -0
  16. package/flows/aidlc/skills/master/analyze-context.md +1 -1
  17. package/flows/aidlc/templates/construction/bolt-template.md +22 -1
  18. package/flows/aidlc/templates/construction/bolt-types/ddd-construction-bolt.md +73 -11
  19. package/flows/aidlc/templates/construction/bolt-types/simple-construction-bolt.md +5 -0
  20. package/flows/aidlc/templates/standards/decision-index-template.md +32 -0
  21. package/flows/fire/README.md +19 -0
  22. package/flows/fire/agents/builder/agent.md +272 -0
  23. package/flows/fire/agents/builder/skills/run-execute/SKILL.md +455 -0
  24. package/flows/fire/agents/builder/skills/run-execute/scripts/complete-run.js +549 -0
  25. package/flows/fire/agents/builder/skills/run-execute/scripts/init-run.js +454 -0
  26. package/flows/fire/agents/builder/skills/run-execute/templates/plan.md.hbs +61 -0
  27. package/flows/fire/agents/builder/skills/run-execute/templates/test-report.md.hbs +81 -0
  28. package/flows/fire/agents/builder/skills/run-plan/SKILL.md +376 -0
  29. package/flows/fire/agents/builder/skills/run-status/SKILL.md +94 -0
  30. package/flows/fire/agents/builder/skills/walkthrough-generate/SKILL.md +140 -0
  31. package/flows/fire/agents/builder/skills/walkthrough-generate/scripts/render-walkthrough.ts +755 -0
  32. package/flows/fire/agents/builder/skills/walkthrough-generate/templates/walkthrough.md.hbs +77 -0
  33. package/flows/fire/agents/orchestrator/agent.md +113 -0
  34. package/flows/fire/agents/orchestrator/skills/project-init/SKILL.md +150 -0
  35. package/flows/fire/agents/orchestrator/skills/project-init/templates/coding-standards.md.hbs +149 -0
  36. package/flows/fire/agents/orchestrator/skills/project-init/templates/system-architecture.md.hbs +101 -0
  37. package/flows/fire/agents/orchestrator/skills/project-init/templates/tech-stack.md.hbs +136 -0
  38. package/flows/fire/agents/orchestrator/skills/project-init/templates/testing-standards.md.hbs +94 -0
  39. package/flows/fire/agents/orchestrator/skills/route/SKILL.md +123 -0
  40. package/flows/fire/agents/orchestrator/skills/status/SKILL.md +99 -0
  41. package/flows/fire/agents/planner/agent.md +122 -0
  42. package/flows/fire/agents/planner/skills/design-doc-generate/SKILL.md +213 -0
  43. package/flows/fire/agents/planner/skills/design-doc-generate/templates/design.md.hbs +76 -0
  44. package/flows/fire/agents/planner/skills/intent-capture/SKILL.md +155 -0
  45. package/flows/fire/agents/planner/skills/intent-capture/templates/brief.md.hbs +40 -0
  46. package/flows/fire/agents/planner/skills/work-item-decompose/SKILL.md +194 -0
  47. package/flows/fire/agents/planner/skills/work-item-decompose/templates/work-item.md.hbs +40 -0
  48. package/flows/fire/commands/fire-builder.md +56 -0
  49. package/flows/fire/commands/fire-planner.md +48 -0
  50. package/flows/fire/commands/fire.md +46 -0
  51. package/flows/fire/memory-bank.yaml +164 -0
  52. package/flows/fire/quick-start.md +130 -0
  53. package/flows/simple/README.md +190 -0
  54. package/flows/simple/agents/agent.md +404 -0
  55. package/flows/simple/commands/agent.md +60 -0
  56. package/flows/simple/context-config.yaml +34 -0
  57. package/flows/simple/memory-bank.yaml +66 -0
  58. package/flows/simple/quick-start.md +231 -0
  59. package/flows/simple/skills/design.md +96 -0
  60. package/flows/simple/skills/execute.md +190 -0
  61. package/flows/simple/skills/requirements.md +94 -0
  62. package/flows/simple/skills/tasks.md +136 -0
  63. package/flows/simple/templates/design-template.md +138 -0
  64. package/flows/simple/templates/requirements-template.md +85 -0
  65. package/flows/simple/templates/tasks-template.md +104 -0
  66. package/lib/analytics/tracker.js +6 -2
  67. package/lib/constants.js +17 -8
  68. package/lib/installer.js +5 -15
  69. package/lib/installers/KiroInstaller.js +55 -0
  70. package/lib/installers/OpenCodeInstaller.js +9 -1
  71. package/lib/installers/ToolInstaller.js +4 -1
  72. package/lib/installers/WindsurfInstaller.js +0 -54
  73. package/package.json +3 -52
@@ -0,0 +1,455 @@
1
+ # Skill: Run Execute
2
+
3
+ Execute work items based on their assigned mode (autopilot, confirm, validate).
4
+ Supports both single-item and multi-item (batch/wide) runs.
5
+
6
+ ---
7
+
8
+ ## Prerequisites
9
+
10
+ Before executing scripts, ensure required dependencies are installed:
11
+
12
+ ```xml
13
+ <prerequisite-check>
14
+ <step n="1" title="Check yaml Package">
15
+ <action>Run: npm list yaml --depth=0 2>/dev/null || echo "NOT_FOUND"</action>
16
+ <check if="output contains NOT_FOUND">
17
+ <output>
18
+ Installing required dependency: yaml
19
+ </output>
20
+ <action>Run: npm install yaml</action>
21
+ </check>
22
+ </step>
23
+ </prerequisite-check>
24
+ ```
25
+
26
+ **Required packages:**
27
+ | Package | Purpose | Install Command |
28
+ |---------|---------|-----------------|
29
+ | `yaml` | Parse/stringify state.yaml | `npm install yaml` |
30
+
31
+ ---
32
+
33
+ ## Trigger
34
+
35
+ - Pending work item ready for execution
36
+ - Resumed from interrupted run
37
+ - Batch of work items passed from run-plan
38
+
39
+ ---
40
+
41
+ ## Degrees of Freedom
42
+
43
+ **Varies by mode**:
44
+ - Autopilot: LOW — Execute standard patterns decisively
45
+ - Confirm: MEDIUM — Present plan, adjust based on feedback
46
+ - Validate: LOW — Follow approved design precisely
47
+
48
+ ---
49
+
50
+ ## Critical Requirements
51
+
52
+ ### MUST Use Scripts - Never Bypass
53
+
54
+ **CRITICAL**: You MUST call the scripts. DO NOT use mkdir or manual file creation.
55
+
56
+ | Action | CORRECT | WRONG |
57
+ |--------|---------|-------|
58
+ | Initialize run | `node scripts/init-run.js ...` | `mkdir .specs-fire/runs/run-001` |
59
+ | Complete item | `node scripts/complete-run.js ... --complete-item` | Manual state editing |
60
+ | Complete run | `node scripts/complete-run.js ... --complete-run` | Manual state editing |
61
+
62
+ The scripts:
63
+ - Create run folder AND run.md together
64
+ - Update state.yaml atomically
65
+ - Track run history in runs.completed
66
+ - Handle batch run state transitions
67
+
68
+ ### Batch Run Execution Flow
69
+
70
+ For runs with multiple work items:
71
+
72
+ ```
73
+ 1. Call init-run.js ONCE at start (creates run.md with ALL items)
74
+ 2. Execute each work item sequentially:
75
+ - Load item context
76
+ - Execute based on mode (autopilot/confirm/validate)
77
+ - Call complete-run.js --complete-item after each
78
+ 3. Call complete-run.js --complete-run after final item
79
+ ```
80
+
81
+ ---
82
+
83
+ ## Workflow
84
+
85
+ ```xml
86
+ <skill name="run-execute">
87
+
88
+ <mandate>
89
+ USE SCRIPTS — Never bypass init-run.js or complete-run.js.
90
+ ALWAYS CREATE plan.md — Create plan BEFORE implementation starts (all modes).
91
+ ALWAYS CREATE test-report.md — Create test report AFTER tests complete.
92
+ TRACK ALL FILE OPERATIONS — Every create, modify must be recorded.
93
+ NEVER skip tests — Tests are mandatory, not optional.
94
+ FOLLOW BROWNFIELD RULES — Read before write, match existing patterns.
95
+ </mandate>
96
+
97
+ <artifact-timing critical="true">
98
+ Artifacts MUST be created at these points:
99
+ | Artifact | When Created | Created By |
100
+ |----------|--------------|------------|
101
+ | run.md | Start of run | init-run.js script |
102
+ | plan.md | BEFORE implementation (Step 4) | Agent using template |
103
+ | test-report.md | AFTER tests pass (Step 6) | Agent using template |
104
+ | walkthrough.md | After run completes (Step 8) | walkthrough-generate skill |
105
+
106
+ For batch runs: Append each work item's section to plan.md and test-report.md.
107
+ </artifact-timing>
108
+
109
+ <step n="1" title="Initialize Run">
110
+ <critical>
111
+ MUST call init-run.js script. DO NOT use mkdir directly.
112
+ The script creates BOTH the folder AND run.md file.
113
+ </critical>
114
+
115
+ <action>Prepare work items JSON array:</action>
116
+ <code>
117
+ # For single item:
118
+ node scripts/init-run.js {rootPath} {workItemId} {intentId} {mode}
119
+
120
+ # For batch/wide (multiple items):
121
+ node scripts/init-run.js {rootPath} --batch '[
122
+ {"id": "item-1", "intent": "intent-1", "mode": "autopilot"},
123
+ {"id": "item-2", "intent": "intent-1", "mode": "confirm"}
124
+ ]' --scope=batch
125
+ </code>
126
+
127
+ <action>Parse script output for runId and runPath</action>
128
+ <action>Verify run.md was created in .specs-fire/runs/{run-id}/</action>
129
+
130
+ <check if="run.md not found">
131
+ <error>init-run.js failed to create run.md. Check script output.</error>
132
+ </check>
133
+ </step>
134
+
135
+ <step n="2" title="Execute Work Items Loop">
136
+ <note>For batch runs, repeat steps 2-6 for each work item</note>
137
+
138
+ <action>Get current_item from state.yaml active_run</action>
139
+ <action>Load work item from .specs-fire/intents/{intent}/work-items/{id}.md</action>
140
+ <action>Read intent brief for broader context</action>
141
+ <action>Load ALL project standards:</action>
142
+ <substep>.specs-fire/standards/tech-stack.md — Technology choices</substep>
143
+ <substep>.specs-fire/standards/coding-standards.md — Code style and patterns</substep>
144
+ <substep>.specs-fire/standards/testing-standards.md — Testing strategy and coverage</substep>
145
+ <substep>.specs-fire/standards/system-architecture.md — Architecture context and constraints</substep>
146
+ <action>Determine execution mode from work item</action>
147
+ </step>
148
+
149
+ <step n="3a" title="Autopilot Mode" if="mode == autopilot">
150
+ <output>
151
+ Executing in Autopilot mode (0 checkpoints).
152
+ Work item: {title}
153
+ </output>
154
+ <goto step="4"/>
155
+ </step>
156
+
157
+ <step n="3b" title="Confirm Mode" if="mode == confirm">
158
+ <action>Generate implementation plan</action>
159
+ <action>Save plan IMMEDIATELY using template: templates/plan.md.hbs</action>
160
+ <action>Write to: .specs-fire/runs/{run-id}/plan.md</action>
161
+ <output>
162
+ Plan saved to: .specs-fire/runs/{run-id}/plan.md
163
+ </output>
164
+ <checkpoint>
165
+ <output>
166
+ ## Implementation Plan for "{title}"
167
+
168
+ ### Approach
169
+ {describe approach}
170
+
171
+ ### Files to Create
172
+ {list files}
173
+
174
+ ### Files to Modify
175
+ {list files}
176
+
177
+ ### Tests
178
+ {list test files}
179
+
180
+ ---
181
+ Approve plan? [Y/n/edit]
182
+ </output>
183
+ </checkpoint>
184
+ <check if="response == edit">
185
+ <ask>What changes to the plan?</ask>
186
+ <action>Adjust plan</action>
187
+ <action>Update plan.md with changes</action>
188
+ <goto step="3b"/>
189
+ </check>
190
+ <goto step="5"/>
191
+ </step>
192
+
193
+ <step n="3c" title="Validate Mode" if="mode == validate">
194
+ <action>Load design doc from .specs-fire/intents/{intent}/work-items/{id}-design.md</action>
195
+ <action>Generate implementation plan based on design</action>
196
+ <action>Save plan IMMEDIATELY using template: templates/plan.md.hbs</action>
197
+ <action>Write to: .specs-fire/runs/{run-id}/plan.md</action>
198
+ <action>Include reference to design doc in plan</action>
199
+ <output>
200
+ Plan saved to: .specs-fire/runs/{run-id}/plan.md
201
+ </output>
202
+ <checkpoint>
203
+ <output>
204
+ ## Implementation Plan for "{title}"
205
+
206
+ Based on approved design document.
207
+
208
+ ### Implementation Checklist
209
+ {from design doc}
210
+
211
+ ### Files to Create
212
+ {list files}
213
+
214
+ ### Files to Modify
215
+ {list files}
216
+
217
+ ---
218
+ This is Checkpoint 2 of Validate mode.
219
+ Approve implementation plan? [Y/n/edit]
220
+ </output>
221
+ </checkpoint>
222
+ <check if="response == edit">
223
+ <ask>What changes to the plan?</ask>
224
+ <action>Adjust plan</action>
225
+ <action>Update plan.md with changes</action>
226
+ <goto step="3c"/>
227
+ </check>
228
+ <goto step="5"/>
229
+ </step>
230
+
231
+ <step n="4" title="Generate Plan (Autopilot Only)" if="mode == autopilot">
232
+ <note>Confirm and Validate modes already saved plan in Step 3b/3c</note>
233
+ <action>Generate implementation plan</action>
234
+ <action>Save plan using template: templates/plan.md.hbs</action>
235
+ <action>Write to: .specs-fire/runs/{run-id}/plan.md</action>
236
+ <output>
237
+ Plan saved to: .specs-fire/runs/{run-id}/plan.md
238
+ (Autopilot mode - continuing without checkpoint)
239
+ </output>
240
+ <note>No checkpoint in autopilot - human can review plan.md while agent works</note>
241
+ </step>
242
+
243
+ <step n="5" title="Execute Implementation">
244
+ <action>For each planned change:</action>
245
+ <substep n="5a">Implement the change</substep>
246
+ <substep n="5b">Track file operation (create/modify)</substep>
247
+ <substep n="5c">Record decisions made</substep>
248
+
249
+ <brownfield-rules>
250
+ <rule>READ existing code before modifying</rule>
251
+ <rule>MATCH existing naming conventions</rule>
252
+ <rule>FOLLOW existing patterns in the codebase</rule>
253
+ <rule>PRESERVE existing tests</rule>
254
+ </brownfield-rules>
255
+ </step>
256
+
257
+ <step n="6" title="Run Tests">
258
+ <action>Load testing standards from .specs-fire/standards/testing-standards.md</action>
259
+ <action>Write tests following testing standards:</action>
260
+ <substep>Unit tests for new/modified functions</substep>
261
+ <substep>Integration tests for API endpoints or workflows</substep>
262
+ <substep>Follow test naming and structure conventions</substep>
263
+
264
+ <action>Run test suite</action>
265
+ <check if="tests fail">
266
+ <output>
267
+ Tests failed. Fixing issues...
268
+ </output>
269
+ <action>Fix failing tests</action>
270
+ <action>Re-run tests</action>
271
+ </check>
272
+
273
+ <action>Validate acceptance criteria from work item</action>
274
+
275
+ <critical>Create test report AFTER tests pass</critical>
276
+ <action>Generate test report using template: templates/test-report.md.hbs</action>
277
+ <action>Write to: .specs-fire/runs/{run-id}/test-report.md</action>
278
+ <action>Include in test report:</action>
279
+ <substep>Test results summary (passed/failed/skipped)</substep>
280
+ <substep>Code coverage percentage</substep>
281
+ <substep>Acceptance criteria validation results</substep>
282
+ <substep>Any test warnings or notes</substep>
283
+ <output>
284
+ Test report saved to: .specs-fire/runs/{run-id}/test-report.md
285
+ </output>
286
+ </step>
287
+
288
+ <step n="7" title="Complete Current Work Item">
289
+ <critical>
290
+ MUST call complete-run.js script. Check if more items remain.
291
+ </critical>
292
+
293
+ <check if="batch run with more items pending">
294
+ <action>Call complete-run.js with --complete-item flag:</action>
295
+ <code>
296
+ node scripts/complete-run.js {rootPath} {runId} --complete-item
297
+ </code>
298
+ <action>Parse output for nextItem</action>
299
+ <output>
300
+ Work item {current_item} complete.
301
+ Next: {nextItem}
302
+ </output>
303
+ <goto step="2">Continue with next work item</goto>
304
+ </check>
305
+
306
+ <check if="last item or single item run">
307
+ <action>Call complete-run.js with --complete-run flag:</action>
308
+ <code>
309
+ node scripts/complete-run.js {rootPath} {runId} --complete-run \
310
+ --files-created='[{"path":"...","purpose":"..."}]' \
311
+ --files-modified='[{"path":"...","changes":"..."}]' \
312
+ --tests=5 --coverage=85
313
+ </code>
314
+ <goto step="8"/>
315
+ </check>
316
+ </step>
317
+
318
+ <step n="8" title="Generate Walkthrough">
319
+ <invoke-skill>walkthrough-generate</invoke-skill>
320
+ </step>
321
+
322
+ <step n="9" title="Report Completion">
323
+ <output>
324
+ Run {run-id} completed.
325
+
326
+ Work items completed: {count}
327
+ Files created: {count}
328
+ Files modified: {count}
329
+ Tests added: {count}
330
+
331
+ Artifacts:
332
+ - Run Log: .specs-fire/runs/{run-id}/run.md
333
+ - Plan: .specs-fire/runs/{run-id}/plan.md
334
+ - Test Report: .specs-fire/runs/{run-id}/test-report.md
335
+ - Walkthrough: .specs-fire/runs/{run-id}/walkthrough.md
336
+ </output>
337
+ </step>
338
+
339
+ </skill>
340
+ ```
341
+
342
+ ---
343
+
344
+ ## Scripts
345
+
346
+ | Script | Purpose | Usage |
347
+ |--------|---------|-------|
348
+ | `scripts/init-run.js` | Initialize run record and folder | Creates run.md with all work items |
349
+ | `scripts/complete-run.js` | Finalize run and update state | `--complete-item` or `--complete-run` |
350
+
351
+ ### init-run.js Usage
352
+
353
+ ```bash
354
+ # Single work item
355
+ node scripts/init-run.js /project work-item-id intent-id autopilot
356
+
357
+ # Batch/wide (multiple items)
358
+ node scripts/init-run.js /project --batch '[
359
+ {"id": "wi-1", "intent": "int-1", "mode": "autopilot"},
360
+ {"id": "wi-2", "intent": "int-1", "mode": "confirm"}
361
+ ]' --scope=batch
362
+ ```
363
+
364
+ **Output:**
365
+ ```json
366
+ {
367
+ "success": true,
368
+ "runId": "run-001",
369
+ "runPath": "/project/.specs-fire/runs/run-001",
370
+ "scope": "batch",
371
+ "workItems": [...],
372
+ "currentItem": "wi-1"
373
+ }
374
+ ```
375
+
376
+ ### complete-run.js Usage
377
+
378
+ ```bash
379
+ # Complete current item (batch runs - moves to next item)
380
+ node scripts/complete-run.js /project run-001 --complete-item
381
+
382
+ # Complete entire run (single runs or final item in batch)
383
+ node scripts/complete-run.js /project run-001 --complete-run \
384
+ --files-created='[{"path":"src/new.ts","purpose":"New feature"}]' \
385
+ --files-modified='[{"path":"src/old.ts","changes":"Added import"}]' \
386
+ --tests=5 --coverage=85
387
+ ```
388
+
389
+ **--complete-item Output:**
390
+ ```json
391
+ {
392
+ "success": true,
393
+ "runId": "run-001",
394
+ "completedItem": "wi-1",
395
+ "nextItem": "wi-2",
396
+ "remainingItems": 1,
397
+ "allItemsCompleted": false
398
+ }
399
+ ```
400
+
401
+ **--complete-run Output:**
402
+ ```json
403
+ {
404
+ "success": true,
405
+ "runId": "run-001",
406
+ "scope": "batch",
407
+ "workItemsCompleted": 2,
408
+ "completedAt": "2026-01-20T..."
409
+ }
410
+ ```
411
+
412
+ ---
413
+
414
+ ## File Tracking Format
415
+
416
+ ```yaml
417
+ files_created:
418
+ - path: src/auth/login.ts
419
+ purpose: Login endpoint handler
420
+
421
+ files_modified:
422
+ - path: src/routes/index.ts
423
+ changes: Added login route
424
+
425
+ decisions:
426
+ - decision: Use JWT for tokens
427
+ rationale: Stateless, works with load balancer
428
+ ```
429
+
430
+ ---
431
+
432
+ ## Run Folder Structure
433
+
434
+ After init-run.js creates a run:
435
+
436
+ ```
437
+ .specs-fire/runs/run-001/
438
+ ├── run.md # Created by init-run.js, updated by complete-run.js
439
+ ├── plan.md # Created BEFORE implementation (ALL modes - required)
440
+ ├── test-report.md # Created AFTER tests pass (required)
441
+ └── walkthrough.md # Created by walkthrough-generate skill
442
+ ```
443
+
444
+ **Artifact Creation Timeline:**
445
+ 1. `run.md` — Created at run start by init-run.js
446
+ 2. `plan.md` — Created BEFORE implementation begins (Step 4)
447
+ 3. `test-report.md` — Created AFTER tests pass (Step 6)
448
+ 4. `walkthrough.md` — Created after run completes (Step 8)
449
+
450
+ The run.md contains:
451
+ - All work items with their statuses
452
+ - Current item being executed
453
+ - Files created/modified (after completion)
454
+ - Decisions made (after completion)
455
+ - Summary (after completion)