specsmd 0.0.0-dev.57 → 0.0.0-dev.59

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.
@@ -41,11 +41,12 @@ When routed from Orchestrator or user invokes this agent:
41
41
  ### Autopilot Mode (0 checkpoints)
42
42
 
43
43
  ```text
44
- [1] Load work item and context
45
- [2] Execute implementation directly
46
- [3] Run tests
47
- [4] Generate walkthrough
48
- [5] Mark complete
44
+ [1] Call init-run.js to initialize run (creates run folder + run.md)
45
+ [2] Load work item and context
46
+ [3] Execute implementation directly
47
+ [4] Run tests
48
+ [5] Generate walkthrough
49
+ [6] Call complete-run.js to finalize (updates state.yaml + run.md)
49
50
  ```
50
51
 
51
52
  For: Bug fixes, minor updates, low-complexity tasks.
@@ -53,15 +54,16 @@ For: Bug fixes, minor updates, low-complexity tasks.
53
54
  ### Confirm Mode (1 checkpoint)
54
55
 
55
56
  ```text
56
- [1] Load work item and context
57
- [2] Generate implementation plan
58
- [3] CHECKPOINT: Present plan to user
57
+ [1] Call init-run.js to initialize run (creates run folder + run.md)
58
+ [2] Load work item and context
59
+ [3] Generate implementation plan
60
+ [4] CHECKPOINT: Present plan to user
59
61
  → User confirms → Continue
60
62
  → User modifies → Adjust plan, re-confirm
61
- [4] Execute implementation
62
- [5] Run tests
63
- [6] Generate walkthrough
64
- [7] Mark complete
63
+ [5] Execute implementation
64
+ [6] Run tests
65
+ [7] Generate walkthrough
66
+ [8] Call complete-run.js to finalize (updates state.yaml + run.md)
65
67
  ```
66
68
 
67
69
  For: Standard features, medium-complexity tasks.
@@ -69,16 +71,17 @@ For: Standard features, medium-complexity tasks.
69
71
  ### Validate Mode (2 checkpoints)
70
72
 
71
73
  ```text
72
- [1] Load work item and design doc
73
- [2] CHECKPOINT 1: Design doc review (already done by Planner)
74
- [3] Generate implementation plan
75
- [4] CHECKPOINT 2: Present plan to user
74
+ [1] Call init-run.js to initialize run (creates run folder + run.md)
75
+ [2] Load work item and design doc
76
+ [3] CHECKPOINT 1: Design doc review (already done by Planner)
77
+ [4] Generate implementation plan
78
+ [5] CHECKPOINT 2: Present plan to user
76
79
  → User confirms → Continue
77
80
  → User modifies → Adjust plan, re-confirm
78
- [5] Execute implementation
79
- [6] Run tests
80
- [7] Generate walkthrough
81
- [8] Mark complete
81
+ [6] Execute implementation
82
+ [7] Run tests
83
+ [8] Generate walkthrough
84
+ [9] Call complete-run.js to finalize (updates state.yaml + run.md)
82
85
  ```
83
86
 
84
87
  For: Security features, payments, core architecture.
@@ -136,6 +139,36 @@ files_modified:
136
139
 
137
140
  ---
138
141
 
142
+ ## CRITICAL: Script Usage for State Management
143
+
144
+ **NEVER edit `.specs-fire/state.yaml` or run artifacts directly.**
145
+
146
+ All state changes MUST go through the scripts in `skills/run-execute/scripts/`:
147
+
148
+ | Action | Script | Direct Editing |
149
+ |--------|--------|----------------|
150
+ | Initialize run | `node scripts/init-run.js ...` | ❌ FORBIDDEN |
151
+ | Complete work item | `node scripts/complete-run.js ... --complete-item` | ❌ FORBIDDEN |
152
+ | Complete run | `node scripts/complete-run.js ... --complete-run` | ❌ FORBIDDEN |
153
+ | Create run folder | (handled by init-run.js) | ❌ NO mkdir |
154
+ | Create run.md | (handled by init-run.js) | ❌ NO direct write |
155
+ | Update state.yaml | (handled by scripts) | ❌ NO direct edit |
156
+
157
+ **Why scripts are mandatory:**
158
+ - Scripts atomically update both state.yaml AND run artifacts
159
+ - Scripts track run history in `runs.completed`
160
+ - Scripts handle batch run state transitions
161
+ - Scripts ensure consistent state across interruptions
162
+
163
+ **If you find yourself about to:**
164
+ - `mkdir .specs-fire/runs/run-XXX` → STOP, use `init-run.js`
165
+ - Edit `state.yaml` directly → STOP, use `complete-run.js`
166
+ - Write `run.md` directly → STOP, use `init-run.js`
167
+
168
+ See `skills/run-execute/SKILL.md` for full script documentation.
169
+
170
+ ---
171
+
139
172
  ## Brownfield Rules
140
173
 
141
174
  When working in existing codebases:
@@ -165,12 +198,25 @@ Each run creates a folder with its artifacts:
165
198
  - **test-report.md** — Test results and acceptance criteria validation
166
199
  - **walkthrough.md** — Human-readable summary after completion
167
200
 
168
- | Artifact | Location | Template |
169
- |----------|----------|----------|
170
- | Plan | `.specs-fire/runs/{run-id}/plan.md` | `skills/run-execute/templates/plan.md.hbs` |
171
- | Run Log | `.specs-fire/runs/{run-id}/run.md` | (generated by script) |
172
- | Test Report | `.specs-fire/runs/{run-id}/test-report.md` | `skills/run-execute/templates/test-report.md.hbs` |
173
- | Walkthrough | `.specs-fire/runs/{run-id}/walkthrough.md` | `skills/walkthrough-generate/templates/walkthrough.md.hbs` |
201
+ | Artifact | Location | Created By | When |
202
+ |----------|----------|------------|------|
203
+ | Run Log | `.specs-fire/runs/{run-id}/run.md` | **init-run.js script** | At run START |
204
+ | Plan | `.specs-fire/runs/{run-id}/plan.md` | Agent (template) | BEFORE implementation |
205
+ | Test Report | `.specs-fire/runs/{run-id}/test-report.md` | Agent (template) | AFTER tests pass |
206
+ | Walkthrough | `.specs-fire/runs/{run-id}/walkthrough.md` | Agent (template) | After run END |
207
+
208
+ **CRITICAL - Artifact Timing**:
209
+ ```
210
+ 1. init-run.js → creates run.md (with all work items listed)
211
+ 2. BEFORE implementation → create plan.md (ALL modes, not just confirm/validate)
212
+ 3. AFTER tests pass → create test-report.md
213
+ 4. After run completes → create walkthrough.md via skill
214
+ ```
215
+
216
+ **IMPORTANT**:
217
+ - The run folder and run.md are created by `init-run.js`. Do NOT use mkdir or Write tool to create these.
218
+ - plan.md is REQUIRED for ALL modes (autopilot, confirm, validate). In autopilot mode, the plan is created but no checkpoint pause occurs.
219
+ - test-report.md is REQUIRED after tests complete.
174
220
 
175
221
  ---
176
222
 
@@ -87,11 +87,25 @@ For runs with multiple work items:
87
87
 
88
88
  <mandate>
89
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.
90
92
  TRACK ALL FILE OPERATIONS — Every create, modify must be recorded.
91
93
  NEVER skip tests — Tests are mandatory, not optional.
92
94
  FOLLOW BROWNFIELD RULES — Read before write, match existing patterns.
93
95
  </mandate>
94
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
+
95
109
  <step n="1" title="Initialize Run">
96
110
  <critical>
97
111
  MUST call init-run.js script. DO NOT use mkdir directly.
@@ -137,11 +151,16 @@ For runs with multiple work items:
137
151
  Executing in Autopilot mode (0 checkpoints).
138
152
  Work item: {title}
139
153
  </output>
140
- <goto step="5"/>
154
+ <goto step="4"/>
141
155
  </step>
142
156
 
143
157
  <step n="3b" title="Confirm Mode" if="mode == confirm">
144
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>
145
164
  <checkpoint>
146
165
  <output>
147
166
  ## Implementation Plan for "{title}"
@@ -165,18 +184,21 @@ For runs with multiple work items:
165
184
  <check if="response == edit">
166
185
  <ask>What changes to the plan?</ask>
167
186
  <action>Adjust plan</action>
187
+ <action>Update plan.md with changes</action>
168
188
  <goto step="3b"/>
169
189
  </check>
170
- <check if="response == y">
171
- <action>Save approved plan using template: templates/plan.md.hbs</action>
172
- <action>Write to: .specs-fire/runs/{run-id}/plan.md</action>
173
- </check>
174
190
  <goto step="5"/>
175
191
  </step>
176
192
 
177
193
  <step n="3c" title="Validate Mode" if="mode == validate">
178
194
  <action>Load design doc from .specs-fire/intents/{intent}/work-items/{id}-design.md</action>
179
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>
180
202
  <checkpoint>
181
203
  <output>
182
204
  ## Implementation Plan for "{title}"
@@ -200,16 +222,24 @@ For runs with multiple work items:
200
222
  <check if="response == edit">
201
223
  <ask>What changes to the plan?</ask>
202
224
  <action>Adjust plan</action>
225
+ <action>Update plan.md with changes</action>
203
226
  <goto step="3c"/>
204
227
  </check>
205
- <check if="response == y">
206
- <action>Save approved plan using template: templates/plan.md.hbs</action>
207
- <action>Write to: .specs-fire/runs/{run-id}/plan.md</action>
208
- <action>Include reference to design doc in plan</action>
209
- </check>
210
228
  <goto step="5"/>
211
229
  </step>
212
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
+
213
243
  <step n="5" title="Execute Implementation">
214
244
  <action>For each planned change:</action>
215
245
  <substep n="5a">Implement the change</substep>
@@ -241,6 +271,18 @@ For runs with multiple work items:
241
271
  </check>
242
272
 
243
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>
244
286
  </step>
245
287
 
246
288
  <step n="7" title="Complete Current Work Item">
@@ -288,6 +330,8 @@ For runs with multiple work items:
288
330
 
289
331
  Artifacts:
290
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
291
335
  - Walkthrough: .specs-fire/runs/{run-id}/walkthrough.md
292
336
  </output>
293
337
  </step>
@@ -392,10 +436,17 @@ After init-run.js creates a run:
392
436
  ```
393
437
  .specs-fire/runs/run-001/
394
438
  ├── run.md # Created by init-run.js, updated by complete-run.js
395
- ├── plan.md # Created during confirm/validate mode (optional)
439
+ ├── plan.md # Created BEFORE implementation (ALL modes - required)
440
+ ├── test-report.md # Created AFTER tests pass (required)
396
441
  └── walkthrough.md # Created by walkthrough-generate skill
397
442
  ```
398
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
+
399
450
  The run.md contains:
400
451
  - All work items with their statuses
401
452
  - Current item being executed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specsmd",
3
- "version": "0.0.0-dev.57",
3
+ "version": "0.0.0-dev.59",
4
4
  "description": "Multi-agent orchestration system for AI-native software development. Delivers AI-DLC, Agile, and custom SDLC flows as markdown-based agent systems.",
5
5
  "main": "lib/installer.js",
6
6
  "bin": {