specsmd 0.0.0-dev.63 → 0.0.0-dev.65

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.
@@ -1,116 +1,71 @@
1
- # Skill: Run Execute
1
+ ---
2
+ name: run-execute
3
+ description: Execute work items based on their assigned mode (autopilot, confirm, validate). Supports single-item and multi-item (batch/wide) runs.
4
+ version: 1.0.0
5
+ ---
2
6
 
7
+ <objective>
3
8
  Execute work items based on their assigned mode (autopilot, confirm, validate).
4
9
  Supports both single-item and multi-item (batch/wide) runs.
10
+ </objective>
5
11
 
6
- ---
7
-
8
- ## Prerequisites
12
+ <prerequisites>
13
+ Before executing scripts, ensure required dependencies are installed:
9
14
 
10
- Before executing scripts, ensure required dependencies are installed:
11
-
12
- ```xml
13
- <prerequisite-check>
14
15
  <step n="1" title="Check yaml Package">
15
16
  <action>Run: npm list yaml --depth=0 2>/dev/null || echo "NOT_FOUND"</action>
16
17
  <check if="output contains NOT_FOUND">
17
- <output>
18
- Installing required dependency: yaml
19
- </output>
18
+ <output>Installing required dependency: yaml</output>
20
19
  <action>Run: npm install yaml</action>
21
20
  </check>
22
21
  </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
22
 
23
+ | Package | Purpose | Install Command |
24
+ |---------|---------|-----------------|
25
+ | `yaml` | Parse/stringify state.yaml | `npm install yaml` |
26
+ </prerequisites>
27
+
28
+ <triggers>
29
+ - Pending work item ready for execution
30
+ - Resumed from interrupted run
31
+ - Batch of work items passed from run-plan
32
+ </triggers>
33
+
34
+ <degrees_of_freedom>
35
+ Varies by mode:
36
+ - **Autopilot**: LOW — Execute standard patterns decisively
37
+ - **Confirm**: MEDIUM — Present plan, adjust based on feedback
38
+ - **Validate**: LOW — Follow approved design precisely
39
+ </degrees_of_freedom>
40
+
41
+ <llm critical="true">
42
+ <mandate>USE SCRIPTS — NEVER bypass init-run.js or complete-run.js</mandate>
43
+ <mandate>ALWAYS CREATE plan.md — Create plan BEFORE implementation starts (ALL modes)</mandate>
44
+ <mandate>ALWAYS CREATE test-report.md — Create test report AFTER tests complete</mandate>
45
+ <mandate>ALWAYS RUN code-review — Invoke code-review skill after tests pass</mandate>
46
+ <mandate>TRACK ALL FILE OPERATIONS — Every create, modify MUST be recorded</mandate>
47
+ <mandate>NEVER skip tests — Tests are mandatory, not optional</mandate>
48
+ <mandate>FOLLOW BROWNFIELD RULES — Read before write, match existing patterns</mandate>
49
+ </llm>
50
+
51
+ <artifact_timing critical="true">
52
+ Artifacts MUST be created at these points:
53
+
54
+ | Artifact | When Created | Created By |
55
+ |----------|--------------|------------|
56
+ | run.md | Start of run | init-run.js script |
57
+ | plan.md | BEFORE implementation (Step 4) | Agent using template |
58
+ | test-report.md | AFTER tests pass (Step 6) | Agent using template |
59
+ | review-report.md | AFTER test report (Step 6b) | code-review skill |
60
+ | walkthrough.md | After run completes (Step 8) | walkthrough-generate skill |
61
+
62
+ For batch runs: Append each work item's section to plan.md and test-report.md.
63
+ </artifact_timing>
64
+
65
+ <flow>
109
66
  <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>
67
+ <critical>MUST call init-run.js script. DO NOT use mkdir directly.</critical>
68
+ <note>The script creates BOTH the folder AND run.md file.</note>
114
69
 
115
70
  <action>Prepare work items JSON array:</action>
116
71
  <code>
@@ -132,8 +87,8 @@ For runs with multiple work items:
132
87
  </check>
133
88
  </step>
134
89
 
135
- <step n="2" title="Execute Work Items Loop">
136
- <note>For batch runs, repeat steps 2-6 for each work item</note>
90
+ <step n="2" title="Load Work Item Context">
91
+ <note>For batch runs, repeat steps 2-6b for each work item</note>
137
92
 
138
93
  <action>Get current_item from state.yaml active_run</action>
139
94
  <action>Load work item from .specs-fire/intents/{intent}/work-items/{id}.md</action>
@@ -158,11 +113,10 @@ For runs with multiple work items:
158
113
  <action>Generate implementation plan</action>
159
114
  <action>Save plan IMMEDIATELY using template: templates/plan.md.hbs</action>
160
115
  <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>
116
+ <output>Plan saved to: .specs-fire/runs/{run-id}/plan.md</output>
117
+
164
118
  <checkpoint>
165
- <output>
119
+ <template_output section="plan">
166
120
  ## Implementation Plan for "{title}"
167
121
 
168
122
  ### Approach
@@ -179,8 +133,9 @@ For runs with multiple work items:
179
133
 
180
134
  ---
181
135
  Approve plan? [Y/n/edit]
182
- </output>
136
+ </template_output>
183
137
  </checkpoint>
138
+
184
139
  <check if="response == edit">
185
140
  <ask>What changes to the plan?</ask>
186
141
  <action>Adjust plan</action>
@@ -196,11 +151,10 @@ For runs with multiple work items:
196
151
  <action>Save plan IMMEDIATELY using template: templates/plan.md.hbs</action>
197
152
  <action>Write to: .specs-fire/runs/{run-id}/plan.md</action>
198
153
  <action>Include reference to design doc in plan</action>
199
- <output>
200
- Plan saved to: .specs-fire/runs/{run-id}/plan.md
201
- </output>
154
+ <output>Plan saved to: .specs-fire/runs/{run-id}/plan.md</output>
155
+
202
156
  <checkpoint>
203
- <output>
157
+ <template_output section="plan">
204
158
  ## Implementation Plan for "{title}"
205
159
 
206
160
  Based on approved design document.
@@ -217,8 +171,9 @@ For runs with multiple work items:
217
171
  ---
218
172
  This is Checkpoint 2 of Validate mode.
219
173
  Approve implementation plan? [Y/n/edit]
220
- </output>
174
+ </template_output>
221
175
  </checkpoint>
176
+
222
177
  <check if="response == edit">
223
178
  <ask>What changes to the plan?</ask>
224
179
  <action>Adjust plan</action>
@@ -246,12 +201,12 @@ For runs with multiple work items:
246
201
  <substep n="5b">Track file operation (create/modify)</substep>
247
202
  <substep n="5c">Record decisions made</substep>
248
203
 
249
- <brownfield-rules>
204
+ <brownfield_rules>
250
205
  <rule>READ existing code before modifying</rule>
251
206
  <rule>MATCH existing naming conventions</rule>
252
207
  <rule>FOLLOW existing patterns in the codebase</rule>
253
208
  <rule>PRESERVE existing tests</rule>
254
- </brownfield-rules>
209
+ </brownfield_rules>
255
210
  </step>
256
211
 
257
212
  <step n="6" title="Run Tests">
@@ -263,9 +218,7 @@ For runs with multiple work items:
263
218
 
264
219
  <action>Run test suite</action>
265
220
  <check if="tests fail">
266
- <output>
267
- Tests failed. Fixing issues...
268
- </output>
221
+ <output>Tests failed. Fixing issues...</output>
269
222
  <action>Fix failing tests</action>
270
223
  <action>Re-run tests</action>
271
224
  </check>
@@ -280,9 +233,7 @@ For runs with multiple work items:
280
233
  <substep>Code coverage percentage</substep>
281
234
  <substep>Acceptance criteria validation results</substep>
282
235
  <substep>Any test warnings or notes</substep>
283
- <output>
284
- Test report saved to: .specs-fire/runs/{run-id}/test-report.md
285
- </output>
236
+ <output>Test report saved to: .specs-fire/runs/{run-id}/test-report.md</output>
286
237
  </step>
287
238
 
288
239
  <step n="6b" title="Code Review">
@@ -299,7 +250,7 @@ For runs with multiple work items:
299
250
  intent_id: {intent_id}
300
251
  </code>
301
252
 
302
- <invoke-skill>code-review</invoke-skill>
253
+ <invoke_skill>code-review</invoke_skill>
303
254
 
304
255
  <note>
305
256
  Code review skill will:
@@ -317,9 +268,7 @@ For runs with multiple work items:
317
268
  <check if="code-review applied fixes">
318
269
  <action>Re-run tests to verify fixes didn't break anything</action>
319
270
  <check if="tests fail">
320
- <output>
321
- Code review fixes caused test failure. Reverting...
322
- </output>
271
+ <output>Code review fixes caused test failure. Reverting...</output>
323
272
  <action>Revert code review changes</action>
324
273
  <action>Re-run tests to confirm passing</action>
325
274
  </check>
@@ -332,9 +281,7 @@ For runs with multiple work items:
332
281
  </step>
333
282
 
334
283
  <step n="7" title="Complete Current Work Item">
335
- <critical>
336
- MUST call complete-run.js script. Check if more items remain.
337
- </critical>
284
+ <critical>MUST call complete-run.js script. Check if more items remain.</critical>
338
285
 
339
286
  <check if="batch run with more items pending">
340
287
  <action>Call complete-run.js with --complete-item flag:</action>
@@ -362,7 +309,7 @@ For runs with multiple work items:
362
309
  </step>
363
310
 
364
311
  <step n="8" title="Generate Walkthrough">
365
- <invoke-skill>walkthrough-generate</invoke-skill>
312
+ <invoke_skill>walkthrough-generate</invoke_skill>
366
313
  </step>
367
314
 
368
315
  <step n="9" title="Report Completion">
@@ -382,123 +329,131 @@ For runs with multiple work items:
382
329
  - Walkthrough: .specs-fire/runs/{run-id}/walkthrough.md
383
330
  </output>
384
331
  </step>
385
-
386
- </skill>
387
- ```
388
-
389
- ---
390
-
391
- ## Scripts
392
-
393
- | Script | Purpose | Usage |
394
- |--------|---------|-------|
395
- | `scripts/init-run.js` | Initialize run record and folder | Creates run.md with all work items |
396
- | `scripts/complete-run.js` | Finalize run and update state | `--complete-item` or `--complete-run` |
397
-
398
- ### init-run.js Usage
399
-
400
- ```bash
401
- # Single work item
402
- node scripts/init-run.js /project work-item-id intent-id autopilot
403
-
404
- # Batch/wide (multiple items)
405
- node scripts/init-run.js /project --batch '[
406
- {"id": "wi-1", "intent": "int-1", "mode": "autopilot"},
407
- {"id": "wi-2", "intent": "int-1", "mode": "confirm"}
408
- ]' --scope=batch
409
- ```
410
-
411
- **Output:**
412
- ```json
413
- {
414
- "success": true,
415
- "runId": "run-001",
416
- "runPath": "/project/.specs-fire/runs/run-001",
417
- "scope": "batch",
418
- "workItems": [...],
419
- "currentItem": "wi-1"
420
- }
421
- ```
422
-
423
- ### complete-run.js Usage
424
-
425
- ```bash
426
- # Complete current item (batch runs - moves to next item)
427
- node scripts/complete-run.js /project run-001 --complete-item
428
-
429
- # Complete entire run (single runs or final item in batch)
430
- node scripts/complete-run.js /project run-001 --complete-run \
431
- --files-created='[{"path":"src/new.ts","purpose":"New feature"}]' \
432
- --files-modified='[{"path":"src/old.ts","changes":"Added import"}]' \
433
- --tests=5 --coverage=85
434
- ```
435
-
436
- **--complete-item Output:**
437
- ```json
438
- {
439
- "success": true,
440
- "runId": "run-001",
441
- "completedItem": "wi-1",
442
- "nextItem": "wi-2",
443
- "remainingItems": 1,
444
- "allItemsCompleted": false
445
- }
446
- ```
447
-
448
- **--complete-run Output:**
449
- ```json
450
- {
451
- "success": true,
452
- "runId": "run-001",
453
- "scope": "batch",
454
- "workItemsCompleted": 2,
455
- "completedAt": "2026-01-20T..."
456
- }
457
- ```
458
-
459
- ---
460
-
461
- ## File Tracking Format
462
-
463
- ```yaml
464
- files_created:
465
- - path: src/auth/login.ts
466
- purpose: Login endpoint handler
467
-
468
- files_modified:
469
- - path: src/routes/index.ts
470
- changes: Added login route
471
-
472
- decisions:
473
- - decision: Use JWT for tokens
474
- rationale: Stateless, works with load balancer
475
- ```
476
-
477
- ---
478
-
479
- ## Run Folder Structure
480
-
481
- After init-run.js creates a run:
482
-
483
- ```
484
- .specs-fire/runs/run-001/
485
- ├── run.md # Created by init-run.js, updated by complete-run.js
486
- ├── plan.md # Created BEFORE implementation (ALL modes - required)
487
- ├── test-report.md # Created AFTER tests pass (required)
488
- ├── review-report.md # Created by code-review skill (Step 6b)
489
- └── walkthrough.md # Created by walkthrough-generate skill
490
- ```
491
-
492
- **Artifact Creation Timeline:**
493
- 1. `run.md` — Created at run start by init-run.js
494
- 2. `plan.md` — Created BEFORE implementation begins (Step 4)
495
- 3. `test-report.md` Created AFTER tests pass (Step 6)
496
- 4. `review-report.md` Created by code-review skill (Step 6b)
497
- 5. `walkthrough.md` Created after run completes (Step 8)
498
-
499
- The run.md contains:
500
- - All work items with their statuses
501
- - Current item being executed
502
- - Files created/modified (after completion)
503
- - Decisions made (after completion)
504
- - Summary (after completion)
332
+ </flow>
333
+
334
+ <scripts>
335
+ | Script | Purpose | Usage |
336
+ |--------|---------|-------|
337
+ | `scripts/init-run.js` | Initialize run record and folder | Creates run.md with all work items |
338
+ | `scripts/complete-run.js` | Finalize run and update state | `--complete-item` or `--complete-run` |
339
+
340
+ <script name="init-run.js">
341
+ ```bash
342
+ # Single work item
343
+ node scripts/init-run.js /project work-item-id intent-id autopilot
344
+
345
+ # Batch/wide (multiple items)
346
+ node scripts/init-run.js /project --batch '[
347
+ {"id": "wi-1", "intent": "int-1", "mode": "autopilot"},
348
+ {"id": "wi-2", "intent": "int-1", "mode": "confirm"}
349
+ ]' --scope=batch
350
+ ```
351
+
352
+ <output_format>
353
+ ```json
354
+ {
355
+ "success": true,
356
+ "runId": "run-001",
357
+ "runPath": "/project/.specs-fire/runs/run-001",
358
+ "scope": "batch",
359
+ "workItems": [...],
360
+ "currentItem": "wi-1"
361
+ }
362
+ ```
363
+ </output_format>
364
+ </script>
365
+
366
+ <script name="complete-run.js">
367
+ ```bash
368
+ # Complete current item (batch runs - moves to next item)
369
+ node scripts/complete-run.js /project run-001 --complete-item
370
+
371
+ # Complete entire run (single runs or final item in batch)
372
+ node scripts/complete-run.js /project run-001 --complete-run \
373
+ --files-created='[{"path":"src/new.ts","purpose":"New feature"}]' \
374
+ --files-modified='[{"path":"src/old.ts","changes":"Added import"}]' \
375
+ --tests=5 --coverage=85
376
+ ```
377
+
378
+ <complete_item_output>
379
+ ```json
380
+ {
381
+ "success": true,
382
+ "runId": "run-001",
383
+ "completedItem": "wi-1",
384
+ "nextItem": "wi-2",
385
+ "remainingItems": 1,
386
+ "allItemsCompleted": false
387
+ }
388
+ ```
389
+ </complete_item_output>
390
+
391
+ <complete_run_output>
392
+ ```json
393
+ {
394
+ "success": true,
395
+ "runId": "run-001",
396
+ "scope": "batch",
397
+ "workItemsCompleted": 2,
398
+ "completedAt": "2026-01-20T..."
399
+ }
400
+ ```
401
+ </complete_run_output>
402
+ </script>
403
+ </scripts>
404
+
405
+ <file_tracking_format>
406
+ ```yaml
407
+ files_created:
408
+ - path: src/auth/login.ts
409
+ purpose: Login endpoint handler
410
+
411
+ files_modified:
412
+ - path: src/routes/index.ts
413
+ changes: Added login route
414
+
415
+ decisions:
416
+ - decision: Use JWT for tokens
417
+ rationale: Stateless, works with load balancer
418
+ ```
419
+ </file_tracking_format>
420
+
421
+ <run_folder_structure>
422
+ After init-run.js creates a run:
423
+
424
+ ```
425
+ .specs-fire/runs/run-001/
426
+ ├── run.md # Created by init-run.js, updated by complete-run.js
427
+ ├── plan.md # Created BEFORE implementation (ALL modes - required)
428
+ ├── test-report.md # Created AFTER tests pass (required)
429
+ ├── review-report.md # Created by code-review skill (Step 6b)
430
+ └── walkthrough.md # Created by walkthrough-generate skill
431
+ ```
432
+
433
+ <timeline>
434
+ 1. `run.md` Created at run start by init-run.js
435
+ 2. `plan.md` Created BEFORE implementation begins (Step 4)
436
+ 3. `test-report.md` Created AFTER tests pass (Step 6)
437
+ 4. `review-report.md` — Created by code-review skill (Step 6b)
438
+ 5. `walkthrough.md` — Created after run completes (Step 8)
439
+ </timeline>
440
+
441
+ The run.md contains:
442
+ - All work items with their statuses
443
+ - Current item being executed
444
+ - Files created/modified (after completion)
445
+ - Decisions made (after completion)
446
+ - Summary (after completion)
447
+ </run_folder_structure>
448
+
449
+ <success_criteria>
450
+ <criterion>Run initialized via init-run.js script</criterion>
451
+ <criterion>plan.md created BEFORE implementation</criterion>
452
+ <criterion>All work items implemented</criterion>
453
+ <criterion>All tests pass</criterion>
454
+ <criterion>test-report.md created AFTER tests pass</criterion>
455
+ <criterion>code-review skill invoked and completed</criterion>
456
+ <criterion>review-report.md created</criterion>
457
+ <criterion>Run completed via complete-run.js script</criterion>
458
+ <criterion>walkthrough.md generated</criterion>
459
+ </success_criteria>