speccrew 0.7.57 → 0.7.58

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.
@@ -786,6 +786,20 @@ node {update_progress_script} update-task --file {iterations_dir}/{current}/03.s
786
786
 
787
787
  All workers execute simultaneously to maximize efficiency.
788
788
 
789
+ > 🛑 **CRITICAL: Phase 5 dispatch-to-worker Protocol**
790
+ > 1. **ONE Worker per Feature×Platform combination** — DO NOT group
791
+ > 2. Use **Agent tool** to create `speccrew-task-worker` for each task
792
+ > 3. Pass `skill_path`: `${ide_skills_dir}/${skill_name}/SKILL.md` (platform-specific skill)
793
+ > 4. Pass context: task_id, feature_id, feature_name, platform_id, feature_spec_path, api_contract_path, techs_knowledge_paths, framework_decisions, output_base_path
794
+ > 5. Dispatch ALL Workers in the same batch **SIMULTANEOUSLY** in a single turn
795
+ > 6. **Wait** for ALL Workers in the batch to complete before dispatching next batch
796
+ > 7. Update DISPATCH-PROGRESS.json after each Worker completes
797
+ > **FORBIDDEN**:
798
+ > - ❌ DO NOT group multiple features into one Worker
799
+ > - ❌ DO NOT use Skill tool to invoke platform skills (when Features ≥ 2 OR Platforms ≥ 2)
800
+ > - ❌ DO NOT dispatch Workers sequentially — ALL in same batch must be simultaneous
801
+ > - ❌ DO NOT generate *-design.md files yourself as fallback
802
+
789
803
  ### 5.5 Update DISPATCH-PROGRESS.json
790
804
 
791
805
  After each worker completes, parse its **Task Completion Report** and update:
@@ -119,6 +119,30 @@ This skill MUST execute tasks continuously without unnecessary interruptions.
119
119
 
120
120
  **CRITICAL**: The `Agent tool` creates a NEW agent session — this is completely different from the `Skill tool` which executes inline.
121
121
 
122
+ ### Phase 5 Execution Method — Feature×Platform Worker Dispatch
123
+
124
+ **DISPATCH GRANULARITY**: ONE Worker per Feature×Platform combination — NO EXCEPTIONS.
125
+
126
+ **HOW TO DISPATCH**: When executing Phase 5 dispatch blocks (action="dispatch-to-worker"):
127
+ 1. Build Feature×Platform matrix from DESIGN-OVERVIEW.md Platform Design Index
128
+ 2. Create `.tasks-temp.json` with one entry per Feature×Platform combination
129
+ 3. Initialize DISPATCH-PROGRESS.json via `update-progress.js init`
130
+ 4. Compute batch plan (batch size = 6)
131
+ 5. For each batch:
132
+ a. Use **Agent tool** to create `speccrew-task-worker` agents for ALL tasks in the batch **SIMULTANEOUSLY**
133
+ b. Each Worker receives: `skill_path` (platform-specific skill), `task_id`, `feature_id`, `feature_name`, `platform_id`, `feature_spec_path`, `api_contract_path`, `techs_knowledge_paths`, `framework_decisions`, `output_base_path`
134
+ c. **Wait** for ALL Workers in the batch to complete
135
+ d. Update DISPATCH-PROGRESS.json for each completed Worker
136
+ e. Log batch progress
137
+ 6. After all batches complete, read final progress summary
138
+
139
+ **CRITICAL**: Each Worker handles exactly ONE feature on ONE platform. DO NOT group multiple features or platforms into a single Worker.
140
+
141
+ **Example** (5 features × 3 platforms = 15 workers, 3 batches of 6/6/3):
142
+ - Batch 1: Workers 1-6 (parallel)
143
+ - Batch 2: Workers 7-12 (parallel, after batch 1 completes)
144
+ - Batch 3: Workers 13-15 (parallel, after batch 2 completes)
145
+
122
146
  ### HARD STOP Checkpoints
123
147
 
124
148
  This workflow has **mandatory HARD STOP** checkpoints at:
@@ -147,3 +171,5 @@ DO NOT proceed past these checkpoints without explicit user confirmation.
147
171
  - **DO NOT skip reading workflow.agentflow.xml** — XML is the execution authority
148
172
  - **DO NOT generate DESIGN-OVERVIEW.md yourself** — Dispatch speccrew-task-worker with speccrew-sd-design-overview-generate skill
149
173
  - **DO NOT use Skill tool for Phase 4 design overview generation** — Skill tool executes inline, Agent tool creates a worker
174
+ - **DO NOT group multiple features into a single Worker** — Each Worker handles exactly ONE feature on ONE platform
175
+ - **DO NOT dispatch Workers sequentially** — ALL Workers in the same batch MUST be dispatched simultaneously
@@ -341,25 +341,91 @@
341
341
  </block>
342
342
  </branch>
343
343
  <branch default="true" name="Multi Feature/Platform - Worker Dispatch Required">
344
- <!-- Parallel Worker Dispatch -->
345
- <block type="rule" id="P5-R2" level="mandatory" desc="Parallel dispatch rule">
346
- <field name="text">Dispatch ALL platform workers IN PARALLEL DO NOT execute sequentially</field>
347
- <field name="text">Each Worker runs independently dispatch all at once, then monitor completion</field>
344
+ <!-- Parallel Worker Dispatch with Batch Loop -->
345
+ <block type="rule" id="P5-R2" level="mandatory" desc="Feature×Platform dispatch rules">
346
+ <field name="text">ONE Worker per Feature×Platform combinationNO EXCEPTIONS</field>
347
+ <field name="text">DO NOT group multiple features or platforms into a single Worker</field>
348
+ <field name="text">ALL Workers in the same batch MUST be dispatched IN PARALLEL — sequential dispatch is FORBIDDEN</field>
349
+ <field name="text">ALL Worker dispatch calls MUST be issued SIMULTANEOUSLY in a SINGLE orchestration turn</field>
350
+ <field name="text">DO NOT wait for any Worker to complete before dispatching the next Worker in the same batch</field>
351
+ <field name="text">Batch size is 6 — DO NOT exceed</field>
352
+ <field name="text">Each Worker MUST receive a single feature_spec_path and single platform_id — NOT arrays</field>
348
353
  </block>
349
- <block type="task" id="P5-B4" action="dispatch-to-worker" status="pending"
350
- desc="Dispatch workers for Feature×Platform matrix">
351
- <field name="worker">speccrew-task-worker</field>
352
- <field name="max_concurrent">6</field>
353
- <field name="tasks">${dispatch_tasks_matrix}</field>
354
- <field name="note">Each worker receives: skill_path, task_id, feature_id, feature_name, platform_id, feature_spec_path, api_contract_path, techs_knowledge_paths, framework_decisions, output_base_path</field>
354
+
355
+ <!-- Compute batch plan from dispatch_tasks_matrix -->
356
+ <block type="task" id="P5-B4-BATCH" action="compute-batches" status="pending"
357
+ desc="Calculate batch plan from Feature×Platform matrix">
358
+ <field name="items" value="${dispatch_tasks_matrix}"/>
359
+ <field name="batch_size" value="6"/>
360
+ <field name="output" var="batch_plan"/>
361
+ </block>
362
+
363
+ <!-- Batch Loop: Process all Feature×Platform tasks in batches of 6 -->
364
+ <block type="loop" id="P5-L-MAIN" over="${batch_plan.batches}" as="batch"
365
+ desc="Process batches sequentially — wait for each batch to complete before next">
366
+
367
+ <!-- Parallel dispatch for each task in current batch -->
368
+ <block type="loop" id="P5-L-INNER" over="${batch.tasks}" as="task" parallel="true" max-concurrency="6"
369
+ desc="Dispatch Worker for each Feature×Platform combination IN PARALLEL">
370
+
371
+ <!-- Update task status to in_progress -->
372
+ <block type="task" id="P5-B4-PRE" action="run-script" status="pending"
373
+ desc="Update task status to in_progress before dispatch">
374
+ <field name="command">node "${update_progress_script}" update-task --file "${iterations_dir}/${current_iteration}/03.system-design/DISPATCH-PROGRESS.json" --task-id "${task.id}" --status in_progress</field>
375
+ </block>
376
+
377
+ <!-- Dispatch single Worker for ONE Feature × ONE Platform -->
378
+ <block type="task" id="P5-B4-DISPATCH" action="dispatch-to-worker" status="pending"
379
+ desc="Dispatch Worker: ${task.feature_id} on ${task.platform_id}">
380
+ <field name="agent">speccrew-task-worker</field>
381
+ <field name="skill">${task.skill}</field>
382
+ <field name="skill_path">${ide_skills_dir}/${task.skill}/SKILL.md</field>
383
+ <field name="context">
384
+ task_id: ${task.id},
385
+ feature_id: ${task.feature_id},
386
+ feature_name: ${task.feature_name},
387
+ platform_id: ${task.platform_id},
388
+ feature_spec_path: ${task.feature_spec_path},
389
+ api_contract_path: ${task.api_contract_path},
390
+ techs_knowledge_paths: ${task.techs_knowledge_paths},
391
+ framework_decisions: ${framework_result.decisions},
392
+ output_base_path: ${iterations_dir}/${current_iteration}/03.system-design
393
+ </field>
394
+ <field name="output" var="worker_result_${task.id}"/>
395
+ </block>
396
+
397
+ <!-- Update progress after worker completes -->
398
+ <block type="task" id="P5-B4-POST" action="run-script" status="pending"
399
+ desc="Update task progress after worker completes">
400
+ <field name="command">node "${update_progress_script}" update-task --file "${iterations_dir}/${current_iteration}/03.system-design/DISPATCH-PROGRESS.json" --task-id "${task.id}" --status ${worker_result_${task.id}.status}</field>
401
+ </block>
402
+
403
+ </block>
404
+
405
+ <!-- Log batch completion -->
406
+ <block type="task" id="P5-B4-BATCH-READ" action="run-script" status="pending"
407
+ desc="Read current progress after batch">
408
+ <field name="command">node "${update_progress_script}" read --file "${iterations_dir}/${current_iteration}/03.system-design/DISPATCH-PROGRESS.json" --summary</field>
409
+ <field name="output" var="batch_progress"/>
410
+ </block>
411
+
412
+ <block type="event" id="P5-E-BATCH-END" action="log" level="info"
413
+ desc="Log batch completion">
414
+ <field name="message">✅ Batch ${batch.index} Complete
415
+ ├── Progress: ${batch_progress.counts.completed}/${dispatch_tasks_matrix.length} completed
416
+ ├── Failed: ${batch_progress.counts.failed}
417
+ └── Remaining: ${batch_progress.counts.pending}</field>
418
+ </block>
419
+
355
420
  </block>
356
421
  </branch>
357
422
  </block>
358
423
 
359
- <!-- Step 5.5: Update DISPATCH-PROGRESS.json after completion -->
424
+ <!-- Step 5.5: Read final dispatch progress -->
360
425
  <block type="task" id="P5-B5" action="run-script" status="pending"
361
- desc="Update task status based on completion">
362
- <field name="command">node ${update_progress_script} update-task --file ${iterations_dir}/${current_iteration}/03.system-design/DISPATCH-PROGRESS.json --task-id ${task_id} --status ${completion_status} --output "${output_path}"</field>
426
+ desc="Read final dispatch progress summary">
427
+ <field name="command">node "${update_progress_script}" read --file "${iterations_dir}/${current_iteration}/03.system-design/DISPATCH-PROGRESS.json" --summary</field>
428
+ <field name="output" var="final_dispatch_progress"/>
363
429
  </block>
364
430
 
365
431
  <!-- Step 5.6: Error Handling -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speccrew",
3
- "version": "0.7.57",
3
+ "version": "0.7.58",
4
4
  "description": "Spec-Driven Development toolkit for AI-powered IDEs",
5
5
  "author": "charlesmu99",
6
6
  "repository": {