speccrew 0.7.57 → 0.7.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.
- package/.speccrew/agents/speccrew-system-designer.md +25 -2
- package/.speccrew/skills/speccrew-sd-backend/SKILL.md +10 -2
- package/.speccrew/skills/speccrew-sd-frontend/SKILL.md +10 -2
- package/.speccrew/skills/speccrew-sd-mobile/SKILL.md +15 -2
- package/.speccrew/skills/speccrew-system-designer-orchestration/SKILL.md +48 -0
- package/.speccrew/skills/speccrew-system-designer-orchestration/workflow.agentflow.xml +109 -13
- package/package.json +1 -1
- package/workspace-template/scripts/update-progress.js +158 -1
|
@@ -36,7 +36,10 @@ Phase 4: Generate DESIGN-OVERVIEW.md (WORKER-DISPATCH + HARD STOP)
|
|
|
36
36
|
↓
|
|
37
37
|
Phase 5: Dispatch Per-Platform Skills
|
|
38
38
|
├── Single Feature + Single Platform → Direct skill invocation
|
|
39
|
-
└── Multi-Feature or Multi-Platform → Worker dispatch (batch of 6)
|
|
39
|
+
└── Multi-Feature or Multi-Platform → Worker dispatch (batch of 6, skip_confirmation + skip_index_generation)
|
|
40
|
+
↓
|
|
41
|
+
Phase 5.5: Generate Platform INDEX.md (AGENT-OWNED)
|
|
42
|
+
└── Orchestrator generates INDEX.md per platform after all workers complete
|
|
40
43
|
↓
|
|
41
44
|
Phase 6: Joint Confirmation (HARD STOP)
|
|
42
45
|
└── Present all designs → User confirms → Finalize stage
|
|
@@ -59,6 +62,7 @@ This agent is an **orchestrator/dispatcher**. For system design execution (Phase
|
|
|
59
62
|
This agent MAY directly create/modify ONLY the following files:
|
|
60
63
|
- ✅ `DISPATCH-PROGRESS.json` (via update-progress.js script only)
|
|
61
64
|
- ✅ `.checkpoints.json` (via update-progress.js script only)
|
|
65
|
+
- ✅ `INDEX.md` per platform directory (AGENT-OWNED — generated by orchestrator after all workers complete, NOT by workers in batch mode)
|
|
62
66
|
- ✅ Progress summary messages to user
|
|
63
67
|
|
|
64
68
|
> Note: `framework-evaluation.md` is generated **ONLY** by the `speccrew-sd-framework-evaluate` skill.
|
|
@@ -74,7 +78,7 @@ This agent MAY directly create/modify ONLY the following files:
|
|
|
74
78
|
3. ❌ DO NOT invoke `speccrew-sd-mobile` skill directly
|
|
75
79
|
4. ❌ DO NOT invoke `speccrew-sd-desktop` skill directly
|
|
76
80
|
5. ❌ DO NOT generate `*-design.md` files yourself
|
|
77
|
-
6. ❌ DO NOT generate platform `INDEX.md`
|
|
81
|
+
6. ❌ DO NOT let individual workers generate platform `INDEX.md` in batch mode — orchestrator generates INDEX.md in Phase 5.5 (AGENT-OWNED)
|
|
78
82
|
7. ❌ DO NOT create design document content as fallback if worker fails
|
|
79
83
|
|
|
80
84
|
### Violation Recovery
|
|
@@ -128,6 +132,8 @@ This agent MUST execute tasks continuously without unnecessary interruptions.
|
|
|
128
132
|
| Phase 3 | HARD STOP | User must confirm framework decisions before proceeding to Phase 4 |
|
|
129
133
|
| Phase 4 | WORKER-DISPATCH + HARD STOP | DESIGN-OVERVIEW.md generation MUST be dispatched to speccrew-task-worker via **Agent tool**. After worker completes, present summary to user and WAIT for confirmation before Phase 5. |
|
|
130
134
|
| Phase 5 | SKILL-ONLY | Platform design workers MUST use platform-specific design skills. Agent MUST NOT write design documents itself |
|
|
135
|
+
| Phase 5 | SKIP-CONFIRMATION | Batch dispatch MUST include `skip_confirmation: true` and `skip_index_generation: true` in worker context. Workers skip Checkpoint A and Step 5 in batch mode |
|
|
136
|
+
| Phase 5.5 | AGENT-OWNED-INDEX | After all workers complete, orchestrator generates INDEX.md per platform. Workers MUST NOT generate INDEX.md in batch mode |
|
|
131
137
|
| Phase 6 | HARD STOP | User must confirm all designs before finalizing |
|
|
132
138
|
| ALL | ABORT ON FAILURE | If any skill invocation fails → STOP and report. Do NOT generate content manually as fallback |
|
|
133
139
|
| ALL | SCRIPT ENFORCEMENT | All .checkpoints.json and WORKFLOW-PROGRESS.json updates via update-progress.js script. Manual JSON creation FORBIDDEN |
|
|
@@ -786,6 +792,22 @@ node {update_progress_script} update-task --file {iterations_dir}/{current}/03.s
|
|
|
786
792
|
|
|
787
793
|
All workers execute simultaneously to maximize efficiency.
|
|
788
794
|
|
|
795
|
+
> 🛑 **CRITICAL: Phase 5 dispatch-to-worker Protocol**
|
|
796
|
+
> 1. **ONE Worker per Feature×Platform combination** — DO NOT group
|
|
797
|
+
> 2. Use **Agent tool** to create `speccrew-task-worker` for each task
|
|
798
|
+
> 3. Pass `skill_path`: `${ide_skills_dir}/${skill_name}/SKILL.md` (platform-specific skill)
|
|
799
|
+
> 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, **skip_confirmation: true**, **skip_index_generation: true**
|
|
800
|
+
> 5. Dispatch ALL Workers in the same batch **SIMULTANEOUSLY** in a single turn
|
|
801
|
+
> 6. **Wait** for ALL Workers in the batch to complete before dispatching next batch
|
|
802
|
+
> 7. Update DISPATCH-PROGRESS.json after each Worker completes
|
|
803
|
+
> 8. After ALL workers complete, generate INDEX.md for each platform directory (AGENT-OWNED task — see Phase 5.5 in orchestration SKILL.md)
|
|
804
|
+
> **FORBIDDEN**:
|
|
805
|
+
> - ❌ DO NOT group multiple features into one Worker
|
|
806
|
+
> - ❌ DO NOT use Skill tool to invoke platform skills (when Features ≥ 2 OR Platforms ≥ 2)
|
|
807
|
+
> - ❌ DO NOT dispatch Workers sequentially — ALL in same batch must be simultaneous
|
|
808
|
+
> - ❌ DO NOT generate *-design.md files yourself as fallback
|
|
809
|
+
> - ❌ DO NOT let individual workers generate INDEX.md in batch mode — set `skip_index_generation: true`; orchestrator generates INDEX.md after all workers complete
|
|
810
|
+
|
|
789
811
|
### 5.5 Update DISPATCH-PROGRESS.json
|
|
790
812
|
|
|
791
813
|
After each worker completes, parse its **Task Completion Report** and update:
|
|
@@ -1074,6 +1096,7 @@ Otherwise
|
|
|
1074
1096
|
- DO NOT create or manually edit DISPATCH-PROGRESS.json, .checkpoints.json, or WORKFLOW-PROGRESS.json — use update-progress.js script only
|
|
1075
1097
|
- DO NOT update WORKFLOW-PROGRESS.json status to "confirmed" before joint user confirmation in Phase 6
|
|
1076
1098
|
- DO NOT proceed to the next batch or Phase 6 if any Phase 5 batch worker failure rate > 50% — follow the Batch Failure recovery flow in Phase 5.6
|
|
1099
|
+
- DO NOT let individual workers generate INDEX.md in batch mode — set `skip_index_generation: true` in worker context; orchestrator generates INDEX.md in Phase 5.5 (AGENT-OWNED)
|
|
1077
1100
|
- DO NOT skip backward compatibility checks for old format Feature Specs
|
|
1078
1101
|
- DO NOT automatically transition to or invoke the next stage agent — user starts next stage in a new conversation
|
|
1079
1102
|
|
|
@@ -34,6 +34,8 @@ tools: Read, Write, Glob, Grep
|
|
|
34
34
|
- `feature_id` (optional): Feature identifier, e.g., `F-CRM-01`. If provided, use new naming format.
|
|
35
35
|
- `feature_name`: Feature name, e.g., `customer-list`.
|
|
36
36
|
- `platform_id`: Target platform, e.g., `backend-spring`, `backend-nestjs`.
|
|
37
|
+
- `skip_confirmation` (optional, boolean): When `true`, skip Checkpoint A user confirmation (used in batch dispatch mode)
|
|
38
|
+
- `skip_index_generation` (optional, boolean): When `true`, skip Step 5 INDEX.md generation (INDEX.md will be generated by orchestrator after all workers complete)
|
|
37
39
|
|
|
38
40
|
Read in order:
|
|
39
41
|
|
|
@@ -88,7 +90,11 @@ Mark each function as:
|
|
|
88
90
|
| `[MODIFIED]` | Modify existing implementation |
|
|
89
91
|
| `[NEW]` | Create brand new implementation |
|
|
90
92
|
|
|
91
|
-
**Checkpoint A
|
|
93
|
+
**Checkpoint A**:
|
|
94
|
+
- If `skip_confirmation` = `true`: Log the function list with markers and **proceed automatically** without waiting for user confirmation.
|
|
95
|
+
- If `skip_confirmation` is not set or `false`: Present function list with markers to user and **wait for explicit confirmation** before proceeding.
|
|
96
|
+
|
|
97
|
+
> ⚠️ **FORBIDDEN**: Worker MUST NOT self-decide to skip confirmation. Only the `skip_confirmation` parameter from dispatch context controls this behavior.
|
|
92
98
|
|
|
93
99
|
## Step 4: Generate Module Design Documents
|
|
94
100
|
|
|
@@ -160,6 +166,8 @@ Verify the completed design document:
|
|
|
160
166
|
|
|
161
167
|
## Step 5: Generate Platform INDEX.md
|
|
162
168
|
|
|
169
|
+
> **Conditional Execution**: If `skip_index_generation` = `true`, **skip this entire Step 5** and proceed to completion. INDEX.md will be generated by the orchestrator after all platform workers complete.
|
|
170
|
+
|
|
163
171
|
After all module designs are complete:
|
|
164
172
|
|
|
165
173
|
### 5.1 Read Index Template
|
|
@@ -311,7 +319,7 @@ When generating Mermaid diagrams, follow compatibility guidelines:
|
|
|
311
319
|
- [ ] Feature Spec and API Contract read and understood
|
|
312
320
|
- [ ] Existing codebase structure analyzed (Glob/Grep)
|
|
313
321
|
- [ ] Function extraction completed with [EXISTING]/[MODIFIED]/[NEW] markers
|
|
314
|
-
- [ ] Checkpoint A passed: function list confirmed
|
|
322
|
+
- [ ] Checkpoint A passed: function list confirmed (or skipped via skip_confirmation)
|
|
315
323
|
- [ ] Every API in API Contract has a corresponding implementation design
|
|
316
324
|
- [ ] Database entities cover all data requirements from Feature Spec
|
|
317
325
|
- [ ] Transaction boundaries defined for multi-step operations
|
|
@@ -34,6 +34,8 @@ tools: Read, Write, Glob, Grep
|
|
|
34
34
|
- `feature_id` (optional): Feature identifier, e.g., `F-CRM-01`. If provided, use new naming format.
|
|
35
35
|
- `feature_name`: Feature name, e.g., `customer-list`.
|
|
36
36
|
- `platform_id`: Target platform, e.g., `frontend-vue`, `frontend-react`.
|
|
37
|
+
- `skip_confirmation` (optional, boolean): When `true`, skip Checkpoint A user confirmation (used in batch dispatch mode)
|
|
38
|
+
- `skip_index_generation` (optional, boolean): When `true`, skip Step 5 INDEX.md generation (INDEX.md will be generated by orchestrator after all workers complete)
|
|
37
39
|
|
|
38
40
|
Read in order:
|
|
39
41
|
|
|
@@ -86,7 +88,11 @@ Mark each function's components as:
|
|
|
86
88
|
| `[MODIFIED]` | Enhance/change existing | `[MODIFIED] OrderTable - add new column` |
|
|
87
89
|
| `[NEW]` | Create brand new | `[NEW] ProductDetailDrawer` |
|
|
88
90
|
|
|
89
|
-
**Checkpoint A
|
|
91
|
+
**Checkpoint A**:
|
|
92
|
+
- If `skip_confirmation` = `true`: Log the function extraction summary and **proceed automatically** without waiting for user confirmation.
|
|
93
|
+
- If `skip_confirmation` is not set or `false`: Present function extraction summary to user and **wait for explicit confirmation** before proceeding.
|
|
94
|
+
|
|
95
|
+
> ⚠️ **FORBIDDEN**: Worker MUST NOT self-decide to skip confirmation. Only the `skip_confirmation` parameter from dispatch context controls this behavior.
|
|
90
96
|
|
|
91
97
|
## Step 4: Generate Module Design Documents
|
|
92
98
|
|
|
@@ -143,6 +149,8 @@ Verify the completed design document:
|
|
|
143
149
|
|
|
144
150
|
## Step 5: Generate Platform INDEX.md
|
|
145
151
|
|
|
152
|
+
> **Conditional Execution**: If `skip_index_generation` = `true`, **skip this entire Step 5** and proceed to completion. INDEX.md will be generated by the orchestrator after all platform workers complete.
|
|
153
|
+
|
|
146
154
|
After all module designs are complete:
|
|
147
155
|
|
|
148
156
|
### 5.1 Read Template
|
|
@@ -286,7 +294,7 @@ After completing all steps, output a structured completion report for the System
|
|
|
286
294
|
- [ ] Directory structure follows conventions-design.md
|
|
287
295
|
- [ ] INDEX.md generated with complete module list
|
|
288
296
|
- [ ] All files written to correct paths under 03.system-design/{platform_id}/
|
|
289
|
-
- [ ] Checkpoint A passed: function extraction confirmed
|
|
297
|
+
- [ ] Checkpoint A passed: function extraction confirmed (or skipped via skip_confirmation)
|
|
290
298
|
- [ ] **No TODO/FIXME placeholders** — all components and methods have complete pseudocode
|
|
291
299
|
- [ ] **API routes match API Contract exactly** — verified route-by-route
|
|
292
300
|
- [ ] **Cross-Feature dependencies explicitly marked** — all `[DEPENDENCY: F-XXX-NNN]` tags present with degradation strategy
|
|
@@ -30,6 +30,13 @@ tools: Read, Write, Glob, Grep
|
|
|
30
30
|
|
|
31
31
|
## Step 1: Read Inputs
|
|
32
32
|
|
|
33
|
+
**Input Parameters** (from agent context):
|
|
34
|
+
- `feature_id` (optional): Feature identifier, e.g., `F-CRM-01`.
|
|
35
|
+
- `feature_name`: Feature name, e.g., `customer-list`.
|
|
36
|
+
- `platform_id`: Target platform, e.g., `mobile-uniapp`, `mobile-flutter`.
|
|
37
|
+
- `skip_confirmation` (optional, boolean): When `true`, skip Checkpoint A user confirmation (used in batch dispatch mode)
|
|
38
|
+
- `skip_index_generation` (optional, boolean): When `true`, skip Step 5 INDEX.md generation (INDEX.md will be generated by orchestrator after all workers complete)
|
|
39
|
+
|
|
33
40
|
Read in order:
|
|
34
41
|
|
|
35
42
|
1. **Feature Spec document(s)**: `speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/[feature-name]-feature-spec.md`
|
|
@@ -80,7 +87,11 @@ Mark each function's screens/widgets as:
|
|
|
80
87
|
| `[MODIFIED]` | Enhance/change existing | `[MODIFIED] OrderList - add pull-to-refresh` |
|
|
81
88
|
| `[NEW]` | Create brand new | `[NEW] ProductDetailPage` |
|
|
82
89
|
|
|
83
|
-
**Checkpoint A
|
|
90
|
+
**Checkpoint A**:
|
|
91
|
+
- If `skip_confirmation` = `true`: Log the function extraction summary and **proceed automatically** without waiting for user confirmation.
|
|
92
|
+
- If `skip_confirmation` is not set or `false`: Present function extraction summary to user and **wait for explicit confirmation** before proceeding.
|
|
93
|
+
|
|
94
|
+
> ⚠️ **FORBIDDEN**: Worker MUST NOT self-decide to skip confirmation. Only the `skip_confirmation` parameter from dispatch context controls this behavior.
|
|
84
95
|
|
|
85
96
|
## Step 4: Generate Module Design Documents
|
|
86
97
|
|
|
@@ -136,6 +147,8 @@ Verify the completed design document:
|
|
|
136
147
|
|
|
137
148
|
## Step 5: Generate Platform INDEX.md
|
|
138
149
|
|
|
150
|
+
> **Conditional Execution**: If `skip_index_generation` = `true`, **skip this entire Step 5** and proceed to completion. INDEX.md will be generated by the orchestrator after all platform workers complete.
|
|
151
|
+
|
|
139
152
|
After all module designs are complete:
|
|
140
153
|
|
|
141
154
|
### 5.1 Read Template
|
|
@@ -279,7 +292,7 @@ After completing all steps, output a structured completion report for the System
|
|
|
279
292
|
- [ ] App lifecycle handling documented
|
|
280
293
|
- [ ] INDEX.md generated with complete module list
|
|
281
294
|
- [ ] All files written to correct paths under 03.system-design/{platform_id}/
|
|
282
|
-
- [ ] **Checkpoint A passed**: function extraction confirmed
|
|
295
|
+
- [ ] **Checkpoint A passed**: function extraction confirmed (or skipped via skip_confirmation)
|
|
283
296
|
- [ ] **No TODO/FIXME placeholders** — all screens and methods have complete pseudocode
|
|
284
297
|
- [ ] **API routes match API Contract exactly** — verified route-by-route
|
|
285
298
|
- [ ] **Cross-Feature dependencies explicitly marked** — all `[DEPENDENCY: F-XXX-NNN]` tags present with degradation strategy
|
|
@@ -119,11 +119,56 @@ 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`, `skip_confirmation: true`, `skip_index_generation: true`
|
|
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
|
+
7. Generate INDEX.md for each platform (AGENT-OWNED, see Phase 5.5)
|
|
139
|
+
|
|
140
|
+
**CRITICAL**: Each Worker handles exactly ONE feature on ONE platform. DO NOT group multiple features or platforms into a single Worker.
|
|
141
|
+
|
|
142
|
+
**Batch Dispatch Context Parameters**: When dispatching Workers in batch mode, the following parameters MUST be included in each Worker's context:
|
|
143
|
+
- `skip_confirmation: true` — Workers skip Checkpoint A user confirmation (not feasible in batch mode)
|
|
144
|
+
- `skip_index_generation: true` — Workers skip Step 5 INDEX.md generation (INDEX.md will be generated by orchestrator after all workers complete)
|
|
145
|
+
|
|
146
|
+
### Phase 5.5: INDEX.md Generation (AGENT-OWNED)
|
|
147
|
+
|
|
148
|
+
After ALL Feature×Platform workers complete successfully, the orchestrator generates INDEX.md for each platform directory. This is an AGENT-OWNED task — the orchestrator generates INDEX.md directly, NOT by dispatching a worker.
|
|
149
|
+
|
|
150
|
+
**Steps per platform**:
|
|
151
|
+
1. Read INDEX-TEMPLATE.md from techs knowledge templates
|
|
152
|
+
2. Copy template to `{output_dir}/{platform_id}/INDEX.md`
|
|
153
|
+
3. Fill sections using `search_replace` with actual content from:
|
|
154
|
+
- Tech stack summary from techs knowledge
|
|
155
|
+
- Module list table from completed design documents
|
|
156
|
+
- Shared design decisions from architecture knowledge
|
|
157
|
+
4. Verify all placeholders are replaced
|
|
158
|
+
|
|
159
|
+
**FORBIDDEN**: Dispatching a worker for INDEX.md generation. INDEX.md is a summary/aggregation file that the orchestrator creates by reading completed worker outputs.
|
|
160
|
+
|
|
161
|
+
**Example** (5 features × 3 platforms = 15 workers, 3 batches of 6/6/3):
|
|
162
|
+
- Batch 1: Workers 1-6 (parallel)
|
|
163
|
+
- Batch 2: Workers 7-12 (parallel, after batch 1 completes)
|
|
164
|
+
- Batch 3: Workers 13-15 (parallel, after batch 2 completes)
|
|
165
|
+
|
|
122
166
|
### HARD STOP Checkpoints
|
|
123
167
|
|
|
124
168
|
This workflow has **mandatory HARD STOP** checkpoints at:
|
|
125
169
|
- **Phase 3.5**: Framework evaluation confirmation (user MUST approve framework decisions)
|
|
126
170
|
- **Phase 4.5**: Design overview confirmation (user MUST approve DESIGN-OVERVIEW.md before Phase 5 dispatch)
|
|
171
|
+
- **Phase 5.5**: (No HARD STOP — INDEX.md generation is automatic after all workers complete)
|
|
127
172
|
- **Phase 6.1**: Joint design confirmation (user MUST approve all designs)
|
|
128
173
|
|
|
129
174
|
DO NOT proceed past these checkpoints without explicit user confirmation.
|
|
@@ -144,6 +189,9 @@ DO NOT proceed past these checkpoints without explicit user confirmation.
|
|
|
144
189
|
- **DO NOT generate framework-evaluation.md yourself** — Only workers generate it
|
|
145
190
|
- **DO NOT create scripts for batch analysis** — Workers handle this via their own skill
|
|
146
191
|
- **DO NOT fallback to inline execution if worker fails** — ABORT instead
|
|
192
|
+
- **DO NOT let individual workers generate INDEX.md in batch mode** — `skip_index_generation: true` must be set; orchestrator generates INDEX.md after all workers complete
|
|
147
193
|
- **DO NOT skip reading workflow.agentflow.xml** — XML is the execution authority
|
|
148
194
|
- **DO NOT generate DESIGN-OVERVIEW.md yourself** — Dispatch speccrew-task-worker with speccrew-sd-design-overview-generate skill
|
|
149
195
|
- **DO NOT use Skill tool for Phase 4 design overview generation** — Skill tool executes inline, Agent tool creates a worker
|
|
196
|
+
- **DO NOT group multiple features into a single Worker** — Each Worker handles exactly ONE feature on ONE platform
|
|
197
|
+
- **DO NOT dispatch Workers sequentially** — ALL Workers in the same batch MUST be dispatched simultaneously
|
|
@@ -341,25 +341,121 @@
|
|
|
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="
|
|
346
|
-
<field name="text">
|
|
347
|
-
<field name="text">
|
|
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 combination — NO 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
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
<field name="
|
|
354
|
-
<field name="
|
|
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
|
+
skip_confirmation: true,
|
|
394
|
+
skip_index_generation: true
|
|
395
|
+
</field>
|
|
396
|
+
<field name="output" var="worker_result_${task.id}"/>
|
|
397
|
+
</block>
|
|
398
|
+
|
|
399
|
+
<!-- Update progress after worker completes -->
|
|
400
|
+
<block type="task" id="P5-B4-POST" action="run-script" status="pending"
|
|
401
|
+
desc="Update task progress after worker completes">
|
|
402
|
+
<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>
|
|
403
|
+
</block>
|
|
404
|
+
|
|
405
|
+
</block>
|
|
406
|
+
|
|
407
|
+
<!-- Log batch completion -->
|
|
408
|
+
<block type="task" id="P5-B4-BATCH-READ" action="run-script" status="pending"
|
|
409
|
+
desc="Read current progress after batch">
|
|
410
|
+
<field name="command">node "${update_progress_script}" read --file "${iterations_dir}/${current_iteration}/03.system-design/DISPATCH-PROGRESS.json" --summary</field>
|
|
411
|
+
<field name="output" var="batch_progress"/>
|
|
412
|
+
</block>
|
|
413
|
+
|
|
414
|
+
<block type="event" id="P5-E-BATCH-END" action="log" level="info"
|
|
415
|
+
desc="Log batch completion">
|
|
416
|
+
<field name="message">✅ Batch ${batch.index} Complete
|
|
417
|
+
├── Progress: ${batch_progress.counts.completed}/${dispatch_tasks_matrix.length} completed
|
|
418
|
+
├── Failed: ${batch_progress.counts.failed}
|
|
419
|
+
└── Remaining: ${batch_progress.counts.pending}</field>
|
|
420
|
+
</block>
|
|
421
|
+
|
|
355
422
|
</block>
|
|
356
423
|
</branch>
|
|
357
424
|
</block>
|
|
358
425
|
|
|
359
|
-
<!--
|
|
426
|
+
<!-- batch-update is available via: node update-progress.js batch-update --file <progress.json> --tasks-file <tasks.json> -->
|
|
427
|
+
<!-- Use when orchestrator needs to batch-update multiple task statuses at once -->
|
|
428
|
+
|
|
429
|
+
<!-- Phase 5.5: Generate Platform INDEX.md (AGENT-OWNED) -->
|
|
430
|
+
<block type="rule" id="P5-IDX-R1" level="mandatory" desc="INDEX.md Generation - Agent Owned">
|
|
431
|
+
<field name="text">
|
|
432
|
+
After all workers complete, the orchestrator generates INDEX.md for each platform.
|
|
433
|
+
Steps per platform:
|
|
434
|
+
1. Read INDEX-TEMPLATE.md from techs knowledge templates
|
|
435
|
+
2. Copy template to {output_dir}/{platform_id}/INDEX.md
|
|
436
|
+
3. Fill sections using search_replace with actual content from:
|
|
437
|
+
- Tech stack summary from techs knowledge
|
|
438
|
+
- Module list table from completed design documents
|
|
439
|
+
- Shared design decisions from architecture knowledge
|
|
440
|
+
4. Verify all placeholders are replaced
|
|
441
|
+
FORBIDDEN: Dispatching a worker for INDEX.md generation.
|
|
442
|
+
</field>
|
|
443
|
+
</block>
|
|
444
|
+
<block type="loop" id="P5-IDX-L1" over="${platforms}" as="platform">
|
|
445
|
+
<block type="task" id="P5-IDX-B1" action="write-file" status="pending"
|
|
446
|
+
desc="Generate INDEX.md for ${platform.id}">
|
|
447
|
+
<field name="template_source">${techs_knowledge_dir}/${platform.id}/templates/INDEX-TEMPLATE.md</field>
|
|
448
|
+
<field name="output">${iterations_dir}/${current_iteration}/03.system-design/${platform.id}/INDEX.md</field>
|
|
449
|
+
<field name="fill_method">search_replace per section</field>
|
|
450
|
+
<field name="module_list_source">${platform.completed_documents}</field>
|
|
451
|
+
</block>
|
|
452
|
+
</block>
|
|
453
|
+
|
|
454
|
+
<!-- Step 5.5: Read final dispatch progress -->
|
|
360
455
|
<block type="task" id="P5-B5" action="run-script" status="pending"
|
|
361
|
-
desc="
|
|
362
|
-
<field name="command">node ${update_progress_script}
|
|
456
|
+
desc="Read final dispatch progress summary">
|
|
457
|
+
<field name="command">node "${update_progress_script}" read --file "${iterations_dir}/${current_iteration}/03.system-design/DISPATCH-PROGRESS.json" --summary</field>
|
|
458
|
+
<field name="output" var="final_dispatch_progress"/>
|
|
363
459
|
</block>
|
|
364
460
|
|
|
365
461
|
<!-- Step 5.6: Error Handling -->
|
package/package.json
CHANGED
|
@@ -65,7 +65,14 @@
|
|
|
65
65
|
* --features-dir <dir> Directory containing features-*.json files (required)
|
|
66
66
|
* --force Overwrite existing file
|
|
67
67
|
*
|
|
68
|
-
* 8.
|
|
68
|
+
* 8. batch-update - Batch update multiple task statuses from a JSON file
|
|
69
|
+
* node update-progress.js batch-update --file <path> --tasks-file <path>
|
|
70
|
+
* Options:
|
|
71
|
+
* --file <path> Progress file path (required)
|
|
72
|
+
* --tasks-file <path> JSON file with task updates (required)
|
|
73
|
+
* Format: [{"id": "task-id", "status": "completed", ...}]
|
|
74
|
+
*
|
|
75
|
+
* 9. sync - Sync task status with actual output files
|
|
69
76
|
* node update-progress.js sync --file <path> --dir <dir> --suffix <suffix> [--strict]
|
|
70
77
|
* Options:
|
|
71
78
|
* --file <path> Progress file path (required)
|
|
@@ -1146,6 +1153,152 @@ function cmdInitKnowledgeTasks(args) {
|
|
|
1146
1153
|
}
|
|
1147
1154
|
}
|
|
1148
1155
|
|
|
1156
|
+
/**
|
|
1157
|
+
* Command: batch-update - Batch update multiple task statuses from a JSON file
|
|
1158
|
+
*
|
|
1159
|
+
* Reads a list of task updates from a JSON file and applies them to the progress file.
|
|
1160
|
+
* This avoids long command lines that can crash PSReadLine.
|
|
1161
|
+
*
|
|
1162
|
+
* Tasks file format:
|
|
1163
|
+
* [
|
|
1164
|
+
* {"id": "task-1", "status": "completed"},
|
|
1165
|
+
* {"id": "task-2", "status": "failed", "error": "error message"},
|
|
1166
|
+
* {"id": "task-3", "status": "completed", "output": "result info"}
|
|
1167
|
+
* ]
|
|
1168
|
+
*/
|
|
1169
|
+
function cmdBatchUpdate(args) {
|
|
1170
|
+
if (!args.file || !args.tasksFile) {
|
|
1171
|
+
outputError('Usage: batch-update --file <path> --tasks-file <path>');
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
const filePath = path.resolve(args.file);
|
|
1175
|
+
const tasksFilePath = path.resolve(args.tasksFile);
|
|
1176
|
+
|
|
1177
|
+
// Read tasks file
|
|
1178
|
+
let updates;
|
|
1179
|
+
try {
|
|
1180
|
+
updates = readJsonFile(tasksFilePath);
|
|
1181
|
+
} catch (e) {
|
|
1182
|
+
outputError(`Failed to read tasks file: ${e.message}`);
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
// Validate updates is an array
|
|
1186
|
+
if (!Array.isArray(updates)) {
|
|
1187
|
+
outputError('Tasks file must contain a JSON array of task updates');
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
if (updates.length === 0) {
|
|
1191
|
+
outputError('Tasks file is empty — no updates to apply');
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
// Validate each update entry
|
|
1195
|
+
const validStatuses = ['pending', 'in_progress', 'partial', 'completed', 'failed', 'confirmed'];
|
|
1196
|
+
for (let i = 0; i < updates.length; i++) {
|
|
1197
|
+
if (!updates[i].id) {
|
|
1198
|
+
outputError(`Update entry at index ${i} is missing required "id" field`);
|
|
1199
|
+
}
|
|
1200
|
+
if (!updates[i].status) {
|
|
1201
|
+
outputError(`Update entry at index ${i} (id: ${updates[i].id}) is missing required "status" field`);
|
|
1202
|
+
}
|
|
1203
|
+
if (!validStatuses.includes(updates[i].status)) {
|
|
1204
|
+
outputError(`Invalid status "${updates[i].status}" for task ${updates[i].id}. Must be one of: ${validStatuses.join(', ')}`);
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
let lockPath = null;
|
|
1209
|
+
try {
|
|
1210
|
+
lockPath = acquireLock(filePath);
|
|
1211
|
+
const data = readJsonFile(filePath);
|
|
1212
|
+
|
|
1213
|
+
const now = getTimestamp();
|
|
1214
|
+
let updated = 0;
|
|
1215
|
+
let notFound = 0;
|
|
1216
|
+
let skipped = 0;
|
|
1217
|
+
const notFoundIds = [];
|
|
1218
|
+
|
|
1219
|
+
// Build a lookup map for tasks (support both flat and nested structures)
|
|
1220
|
+
// Flat structure: data.tasks array
|
|
1221
|
+
if (data.tasks && Array.isArray(data.tasks)) {
|
|
1222
|
+
for (const update of updates) {
|
|
1223
|
+
const taskIndex = data.tasks.findIndex(t => t.id === update.id);
|
|
1224
|
+
if (taskIndex === -1) {
|
|
1225
|
+
notFound++;
|
|
1226
|
+
notFoundIds.push(update.id);
|
|
1227
|
+
continue;
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
const task = data.tasks[taskIndex];
|
|
1231
|
+
|
|
1232
|
+
// Skip if already in target status
|
|
1233
|
+
if (task.status === update.status) {
|
|
1234
|
+
skipped++;
|
|
1235
|
+
continue;
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
// Apply status update
|
|
1239
|
+
task.status = update.status;
|
|
1240
|
+
task.updated_at = now;
|
|
1241
|
+
|
|
1242
|
+
// Set timestamps based on status
|
|
1243
|
+
if (update.status === 'in_progress') {
|
|
1244
|
+
task.started_at = now;
|
|
1245
|
+
} else if (update.status === 'completed') {
|
|
1246
|
+
task.completed_at = now;
|
|
1247
|
+
if (update.output) {
|
|
1248
|
+
task.output = update.output;
|
|
1249
|
+
}
|
|
1250
|
+
} else if (update.status === 'confirmed') {
|
|
1251
|
+
task.confirmed_at = now;
|
|
1252
|
+
} else if (update.status === 'failed') {
|
|
1253
|
+
task.completed_at = now;
|
|
1254
|
+
if (update.error) {
|
|
1255
|
+
task.error = update.error;
|
|
1256
|
+
}
|
|
1257
|
+
if (update.error_category) {
|
|
1258
|
+
task.error_category = update.error_category;
|
|
1259
|
+
}
|
|
1260
|
+
} else if (update.status === 'partial') {
|
|
1261
|
+
if (!task.started_at) {
|
|
1262
|
+
task.started_at = now;
|
|
1263
|
+
}
|
|
1264
|
+
if (update.output) {
|
|
1265
|
+
task.output = update.output;
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
updated++;
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
// Recalculate counts
|
|
1273
|
+
data.counts = calculateCounts(data.tasks);
|
|
1274
|
+
} else {
|
|
1275
|
+
// No flat tasks array — cannot batch update
|
|
1276
|
+
outputError('Progress file does not contain a tasks array — batch-update only supports flat task structure');
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
data.updated_at = now;
|
|
1280
|
+
|
|
1281
|
+
// Atomic write
|
|
1282
|
+
atomicWriteJson(filePath, data);
|
|
1283
|
+
|
|
1284
|
+
const result = {
|
|
1285
|
+
total_updates_requested: updates.length,
|
|
1286
|
+
updated: updated,
|
|
1287
|
+
skipped_already_current: skipped,
|
|
1288
|
+
not_found: notFound,
|
|
1289
|
+
counts: data.counts
|
|
1290
|
+
};
|
|
1291
|
+
|
|
1292
|
+
if (notFoundIds.length > 0) {
|
|
1293
|
+
result.not_found_ids = notFoundIds;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
outputSuccess(`Batch update completed: ${updated} tasks updated, ${skipped} skipped, ${notFound} not found`, result);
|
|
1297
|
+
} finally {
|
|
1298
|
+
if (lockPath) releaseLock(lockPath);
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1149
1302
|
/**
|
|
1150
1303
|
* Command: sync - Sync task status with actual output files
|
|
1151
1304
|
* Scans directory for files matching suffix, extracts task IDs from filenames,
|
|
@@ -1494,6 +1647,7 @@ function main() {
|
|
|
1494
1647
|
console.error(' update-workflow Update a workflow stage status');
|
|
1495
1648
|
console.error(' init-tasks Generate tasks from feature-spec files');
|
|
1496
1649
|
console.error(' init-knowledge-tasks Generate knowledge initialization tasks from matcher results');
|
|
1650
|
+
console.error(' batch-update Batch update multiple task statuses from a JSON file');
|
|
1497
1651
|
console.error(' sync Sync task status with actual output files');
|
|
1498
1652
|
console.error('');
|
|
1499
1653
|
console.error('Run "node update-progress.js <command> --help" for more information.');
|
|
@@ -1527,6 +1681,9 @@ function main() {
|
|
|
1527
1681
|
case 'init-knowledge-tasks':
|
|
1528
1682
|
cmdInitKnowledgeTasks(args);
|
|
1529
1683
|
break;
|
|
1684
|
+
case 'batch-update':
|
|
1685
|
+
cmdBatchUpdate(args);
|
|
1686
|
+
break;
|
|
1530
1687
|
case 'sync':
|
|
1531
1688
|
cmdSync(args);
|
|
1532
1689
|
break;
|