speccrew 0.7.59 → 0.7.61

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.
@@ -38,8 +38,8 @@ Phase 5: Dispatch Per-Platform Skills
38
38
  ├── Single Feature + Single Platform → Direct skill invocation
39
39
  └── Multi-Feature or Multi-Platform → Worker dispatch (batch of 6, skip_confirmation + skip_index_generation)
40
40
 
41
- Phase 5.5: Generate Platform INDEX.md (AGENT-OWNED)
42
- └── Orchestrator generates INDEX.md per platform after all workers complete
41
+ Phase 5.5: Generate Platform INDEX.md (WORKER-DISPATCH)
42
+ └── Dispatch worker per platform with index_only=true to generate INDEX.md
43
43
 
44
44
  Phase 6: Joint Confirmation (HARD STOP)
45
45
  └── Present all designs → User confirms → Finalize stage
@@ -62,7 +62,7 @@ This agent is an **orchestrator/dispatcher**. For system design execution (Phase
62
62
  This agent MAY directly create/modify ONLY the following files:
63
63
  - ✅ `DISPATCH-PROGRESS.json` (via update-progress.js script only)
64
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)
65
+ - ✅ `INDEX.md` per platform directory (generated by worker dispatched with `index_only: true` after all Feature×Platform workers complete)
66
66
  - ✅ Progress summary messages to user
67
67
 
68
68
  > Note: `framework-evaluation.md` is generated **ONLY** by the `speccrew-sd-framework-evaluate` skill.
@@ -78,7 +78,7 @@ This agent MAY directly create/modify ONLY the following files:
78
78
  3. ❌ DO NOT invoke `speccrew-sd-mobile` skill directly
79
79
  4. ❌ DO NOT invoke `speccrew-sd-desktop` skill directly
80
80
  5. ❌ DO NOT generate `*-design.md` files yourself
81
- 6. ❌ DO NOT let individual workers generate platform `INDEX.md` in batch mode orchestrator generates INDEX.md in Phase 5.5 (AGENT-OWNED)
81
+ 6. ❌ DO NOT generate INDEX.md directly MUST dispatch worker with `index_only: true` in Phase 5.5 (WORKER-DISPATCH)
82
82
  7. ❌ DO NOT create design document content as fallback if worker fails
83
83
 
84
84
  ### Violation Recovery
@@ -133,7 +133,8 @@ This agent MUST execute tasks continuously without unnecessary interruptions.
133
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. |
134
134
  | Phase 5 | SKILL-ONLY | Platform design workers MUST use platform-specific design skills. Agent MUST NOT write design documents itself |
135
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 |
136
+ | Phase 5 | WORKER-SELF-UPDATE | Batch dispatch MUST include `dispatch_progress_file` and `update_progress_script` in worker context. Workers self-update task status in DISPATCH-PROGRESS.json upon completion (Step 7 of platform skills). Orchestrator's P5-B4-POST serves as fallback |
137
+ | Phase 5.5 | WORKER-DISPATCH-INDEX | After all workers complete, dispatch ONE worker per platform with `index_only: true` to generate INDEX.md. Orchestrator MUST NOT generate INDEX.md directly |
137
138
  | Phase 6 | HARD STOP | User must confirm all designs before finalizing |
138
139
  | ALL | ABORT ON FAILURE | If any skill invocation fails → STOP and report. Do NOT generate content manually as fallback |
139
140
  | ALL | SCRIPT ENFORCEMENT | All .checkpoints.json and WORKFLOW-PROGRESS.json updates via update-progress.js script. Manual JSON creation FORBIDDEN |
@@ -776,6 +777,8 @@ Each worker receives:
776
777
  - `techs_knowledge_paths`: Techs knowledge paths for this platform
777
778
  - `framework_decisions`: Framework decisions from Phase 3
778
779
  - `output_base_path`: Path to `03.system-design/` directory
780
+ - `dispatch_progress_file`: Path to DISPATCH-PROGRESS.json (enables Worker to self-update task status on completion)
781
+ - `update_progress_script`: Path to update-progress.js script
779
782
 
780
783
  **Before dispatch**: Update each task status to `in_progress`:
781
784
  ```bash
@@ -796,17 +799,17 @@ All workers execute simultaneously to maximize efficiency.
796
799
  > 1. **ONE Worker per Feature×Platform combination** — DO NOT group
797
800
  > 2. Use **Agent tool** to create `speccrew-task-worker` for each task
798
801
  > 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**
802
+ > 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**, **dispatch_progress_file**, **update_progress_script**
800
803
  > 5. Dispatch ALL Workers in the same batch **SIMULTANEOUSLY** in a single turn
801
804
  > 6. **Wait** for ALL Workers in the batch to complete before dispatching next batch
802
805
  > 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)
806
+ > 8. After ALL workers complete, dispatch ONE worker per platform with `index_only: true` to generate INDEX.md (WORKER-DISPATCH — see Phase 5.5 in orchestration SKILL.md)
804
807
  > **FORBIDDEN**:
805
808
  > - ❌ DO NOT group multiple features into one Worker
806
809
  > - ❌ DO NOT use Skill tool to invoke platform skills (when Features ≥ 2 OR Platforms ≥ 2)
807
810
  > - ❌ DO NOT dispatch Workers sequentially — ALL in same batch must be simultaneous
808
811
  > - ❌ 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
812
+ > - ❌ DO NOT let individual workers generate INDEX.md in batch mode — set `skip_index_generation: true`; INDEX.md is generated in Phase 5.5 by separate worker with `index_only: true`
810
813
 
811
814
  ### 5.5 Update DISPATCH-PROGRESS.json
812
815
 
@@ -1096,7 +1099,7 @@ Otherwise
1096
1099
  - DO NOT create or manually edit DISPATCH-PROGRESS.json, .checkpoints.json, or WORKFLOW-PROGRESS.json — use update-progress.js script only
1097
1100
  - DO NOT update WORKFLOW-PROGRESS.json status to "confirmed" before joint user confirmation in Phase 6
1098
1101
  - 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)
1102
+ - DO NOT generate INDEX.md directly — set `skip_index_generation: true` in Feature×Platform worker context; dispatch separate worker with `index_only: true` in Phase 5.5 (WORKER-DISPATCH)
1100
1103
  - DO NOT skip backward compatibility checks for old format Feature Specs
1101
1104
  - DO NOT automatically transition to or invoke the next stage agent — user starts next stage in a new conversation
1102
1105
 
@@ -28,14 +28,22 @@ tools: Read, Write, Glob, Grep
28
28
 
29
29
  3. **MANDATORY: Template-first workflow** — Copy template MUST execute before fill sections. Skipping copy and writing content directly is FORBIDDEN.
30
30
 
31
+ 4. **MANDATORY: Output filename pattern** — Output filename MUST follow pattern: `{feature_id}-{feature_name}-design.md`. Omitting feature_id or using alternative naming is FORBIDDEN.
32
+
31
33
  ## Step 1: Read Inputs
32
34
 
35
+ > **Conditional Execution**: If `index_only` = `true`, **skip Steps 1-4** and jump directly to Step 5 to generate INDEX.md.
36
+
33
37
  **Input Parameters** (from agent context):
34
38
  - `feature_id` (optional): Feature identifier, e.g., `F-CRM-01`. If provided, use new naming format.
35
39
  - `feature_name`: Feature name, e.g., `customer-list`.
36
40
  - `platform_id`: Target platform, e.g., `backend-spring`, `backend-nestjs`.
37
41
  - `skip_confirmation` (optional, boolean): When `true`, skip Checkpoint A user confirmation (used in batch dispatch mode)
38
42
  - `skip_index_generation` (optional, boolean): When `true`, skip Step 5 INDEX.md generation (INDEX.md will be generated by orchestrator after all workers complete)
43
+ - `index_only` (optional, boolean): When `true`, skip Steps 1-4 and ONLY execute Step 5 (INDEX.md generation). Used after all platform workers complete.
44
+ - `task_id` (optional, string): Task identifier in DISPATCH-PROGRESS.json. Used for status tracking.
45
+ - `dispatch_progress_file` (optional, string): Path to DISPATCH-PROGRESS.json. If provided, worker updates its own task status on completion.
46
+ - `update_progress_script` (optional, string): Path to update-progress.js script.
39
47
 
40
48
  Read in order:
41
49
 
@@ -100,6 +108,30 @@ Mark each function as:
100
108
 
101
109
  For each function (or logical group = one controller/module):
102
110
 
111
+ ### Output File Naming Convention
112
+
113
+ **MANDATORY**: The design document file MUST be named using this exact pattern:
114
+
115
+ ```
116
+ {feature_id}-{feature_name}-design.md
117
+ ```
118
+
119
+ Examples:
120
+ - `F-M01-05-操作日志-design.md` ✅
121
+ - `F-M02-01-顾客档案管理-design.md` ✅
122
+ - `member-level-change-history-design.md` ❌ (missing feature_id prefix)
123
+ - `customer-profile-design.md` ❌ (missing feature_id prefix)
124
+
125
+ Where:
126
+ - `feature_id`: The exact feature ID from dispatch context (e.g., `F-M01-05`, `F-M02-01`)
127
+ - `feature_name`: The exact feature name from dispatch context (e.g., `操作日志`, `顾客档案管理`)
128
+
129
+ > ⚠️ **FORBIDDEN**:
130
+ > - Using any filename format other than `{feature_id}-{feature_name}-design.md`
131
+ > - Omitting the feature_id prefix
132
+ > - Translating or paraphrasing the feature_name (must use the exact name from context)
133
+ > - Using function/sub-feature names instead of the main feature_name
134
+
103
135
  ### 4.1 Read Template
104
136
 
105
137
  Read the SD-BACKEND-TEMPLATE.md to understand document structure.
@@ -166,7 +198,9 @@ Verify the completed design document:
166
198
 
167
199
  ## Step 5: Generate Platform INDEX.md
168
200
 
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.
201
+ > **Conditional Execution**:
202
+ > - If `skip_index_generation` = `true`, **skip this entire Step 5**.
203
+ > - If `index_only` = `true`, this step is the ONLY step to execute (Steps 1-4 are skipped).
170
204
 
171
205
  After all module designs are complete:
172
206
 
@@ -231,7 +265,24 @@ Files Generated:
231
265
  - {list all file paths}
232
266
  ```
233
267
 
234
- ## Step 7: Task Completion Report
268
+ ## Step 7: Update Task Status (if dispatch_progress_file provided)
269
+
270
+ > **Conditional Execution**: Only execute this step if `dispatch_progress_file` and `task_id` parameters are provided in the dispatch context.
271
+
272
+ Update the task status in DISPATCH-PROGRESS.json to mark this task as completed:
273
+
274
+ ```
275
+ node "${update_progress_script}" update-task --file "${dispatch_progress_file}" --task-id "${task_id}" --status completed
276
+ ```
277
+
278
+ If the design document generation failed at any step, update with status `failed` instead:
279
+ ```
280
+ node "${update_progress_script}" update-task --file "${dispatch_progress_file}" --task-id "${task_id}" --status failed
281
+ ```
282
+
283
+ > ⚠️ **IMPORTANT**: This step MUST be the last action before returning the completion report. Do NOT skip this step in batch dispatch mode.
284
+
285
+ ## Step 8: Task Completion Report
235
286
 
236
287
  After completing all steps, output a structured completion report for the System Designer Agent to parse and update DISPATCH-PROGRESS.json:
237
288
 
@@ -300,6 +351,7 @@ When executing this skill:
300
351
  | **FORBIDDEN: TODO/FIXME Placeholders** | Design documents MUST contain complete implementation logic. Do NOT use TODO, FIXME, HACK, or any placeholder comments. Every method, validation rule, and business logic MUST be fully specified with actual pseudocode. |
301
352
  | **API Route Consistency** | All API routes in the design document MUST exactly match the routes defined in the API Contract document. Before writing any route, READ the API Contract and copy routes verbatim. Do NOT invent or modify routes. |
302
353
  | **Cross-Feature Dependency Marking** | When referencing functionality from another Feature (e.g., conflict detection from F-APPT-002), MUST explicitly mark it as `[DEPENDENCY: F-XXX-NNN]` and define a degradation strategy for when that Feature is not yet implemented. |
354
+ | **Output Filename Pattern** | Output filename MUST follow pattern: `{feature_id}-{feature_name}-design.md` |
303
355
 
304
356
  # Mermaid Diagram Requirements
305
357
 
@@ -329,6 +381,7 @@ When generating Mermaid diagrams, follow compatibility guidelines:
329
381
  - [ ] Migration requirements documented
330
382
  - [ ] INDEX.md generated with complete module list
331
383
  - [ ] All files written to correct paths under 03.system-design/{platform_id}/
384
+ - [ ] Output file named as `{feature_id}-{feature_name}-design.md`
332
385
  - [ ] All Mermaid diagrams follow compatibility guidelines
333
386
  - [ ] **No TODO/FIXME placeholders** — all methods have complete pseudocode implementation
334
387
  - [ ] **API routes match API Contract exactly** — verified route-by-route
@@ -28,14 +28,22 @@ tools: Read, Write, Glob, Grep
28
28
 
29
29
  3. **MANDATORY: Template-first workflow** — Copy template MUST execute before fill sections. Skipping copy and writing content directly is FORBIDDEN.
30
30
 
31
+ 4. **MANDATORY: Output filename pattern** — Output filename MUST follow pattern: `{feature_id}-{feature_name}-design.md`. Omitting feature_id or using alternative naming is FORBIDDEN.
32
+
31
33
  ## Step 1: Read Inputs
32
34
 
35
+ > **Conditional Execution**: If `index_only` = `true`, **skip Steps 1-4** and jump directly to Step 5 to generate INDEX.md.
36
+
33
37
  **Input Parameters** (from agent context):
34
38
  - `feature_id` (optional): Feature identifier, e.g., `F-CRM-01`. If provided, use new naming format.
35
39
  - `feature_name`: Feature name, e.g., `customer-list`.
36
40
  - `platform_id`: Target platform, e.g., `frontend-vue`, `frontend-react`.
37
41
  - `skip_confirmation` (optional, boolean): When `true`, skip Checkpoint A user confirmation (used in batch dispatch mode)
38
42
  - `skip_index_generation` (optional, boolean): When `true`, skip Step 5 INDEX.md generation (INDEX.md will be generated by orchestrator after all workers complete)
43
+ - `index_only` (optional, boolean): When `true`, skip Steps 1-4 and ONLY execute Step 5 (INDEX.md generation). Used after all platform workers complete.
44
+ - `task_id` (optional, string): Task identifier in DISPATCH-PROGRESS.json. Used for status tracking.
45
+ - `dispatch_progress_file` (optional, string): Path to DISPATCH-PROGRESS.json. If provided, worker updates its own task status on completion.
46
+ - `update_progress_script` (optional, string): Path to update-progress.js script.
39
47
 
40
48
  Read in order:
41
49
 
@@ -98,6 +106,30 @@ Mark each function's components as:
98
106
 
99
107
  For each function (or logical group of closely related functions = one module):
100
108
 
109
+ ### Output File Naming Convention
110
+
111
+ **MANDATORY**: The design document file MUST be named using this exact pattern:
112
+
113
+ ```
114
+ {feature_id}-{feature_name}-design.md
115
+ ```
116
+
117
+ Examples:
118
+ - `F-M01-05-操作日志-design.md` ✅
119
+ - `F-M02-01-顾客档案管理-design.md` ✅
120
+ - `member-level-change-history-design.md` ❌ (missing feature_id prefix)
121
+ - `customer-profile-design.md` ❌ (missing feature_id prefix)
122
+
123
+ Where:
124
+ - `feature_id`: The exact feature ID from dispatch context (e.g., `F-M01-05`, `F-M02-01`)
125
+ - `feature_name`: The exact feature name from dispatch context (e.g., `操作日志`, `顾客档案管理`)
126
+
127
+ > ⚠️ **FORBIDDEN**:
128
+ > - Using any filename format other than `{feature_id}-{feature_name}-design.md`
129
+ > - Omitting the feature_id prefix
130
+ > - Translating or paraphrasing the feature_name (must use the exact name from context)
131
+ > - Using function/sub-feature names instead of the main feature_name
132
+
101
133
  ### 4.1 Read Template
102
134
 
103
135
  Read `SD-FRONTEND-TEMPLATE.md` for document structure.
@@ -149,7 +181,9 @@ Verify the completed design document:
149
181
 
150
182
  ## Step 5: Generate Platform INDEX.md
151
183
 
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.
184
+ > **Conditional Execution**:
185
+ > - If `skip_index_generation` = `true`, **skip this entire Step 5**.
186
+ > - If `index_only` = `true`, this step is the ONLY step to execute (Steps 1-4 are skipped).
153
187
 
154
188
  After all module designs are complete:
155
189
 
@@ -229,7 +263,24 @@ Concerns/Trade-offs:
229
263
  3. Do the pseudo-code patterns match project conventions?
230
264
  4. Are all API calls from API Contract covered?
231
265
 
232
- ## Step 7: Task Completion Report
266
+ ## Step 7: Update Task Status (if dispatch_progress_file provided)
267
+
268
+ > **Conditional Execution**: Only execute this step if `dispatch_progress_file` and `task_id` parameters are provided in the dispatch context.
269
+
270
+ Update the task status in DISPATCH-PROGRESS.json to mark this task as completed:
271
+
272
+ ```
273
+ node "${update_progress_script}" update-task --file "${dispatch_progress_file}" --task-id "${task_id}" --status completed
274
+ ```
275
+
276
+ If the design document generation failed at any step, update with status `failed` instead:
277
+ ```
278
+ node "${update_progress_script}" update-task --file "${dispatch_progress_file}" --task-id "${task_id}" --status failed
279
+ ```
280
+
281
+ > ⚠️ **IMPORTANT**: This step MUST be the last action before returning the completion report. Do NOT skip this step in batch dispatch mode.
282
+
283
+ ## Step 8: Task Completion Report
233
284
 
234
285
  After completing all steps, output a structured completion report for the System Designer Agent to parse and update DISPATCH-PROGRESS.json:
235
286
 
@@ -281,6 +332,7 @@ After completing all steps, output a structured completion report for the System
281
332
  | **API Route Consistency** | All API routes in the design document MUST exactly match the routes defined in the API Contract document. Before writing any route, READ the API Contract and copy routes verbatim. Do NOT invent or modify routes. |
282
333
  | **Cross-Feature Dependency Marking** | When referencing functionality from another Feature (e.g., conflict detection from F-APPT-002), MUST explicitly mark it as `[DEPENDENCY: F-XXX-NNN]` and define a degradation strategy (e.g., hide button, show placeholder) for when that Feature is not yet implemented. |
283
334
  | **Mermaid for All Diagrams** | ALL component trees, interaction flows, and state management diagrams MUST use Mermaid syntax (`graph TB`, `sequenceDiagram`, `flowchart`). Plain text ASCII diagrams are FORBIDDEN for these sections. |
335
+ | **Output Filename Pattern** | Output filename MUST follow pattern: `{feature_id}-{feature_name}-design.md` |
284
336
 
285
337
  # Checklist
286
338
 
@@ -294,6 +346,7 @@ After completing all steps, output a structured completion report for the System
294
346
  - [ ] Directory structure follows conventions-design.md
295
347
  - [ ] INDEX.md generated with complete module list
296
348
  - [ ] All files written to correct paths under 03.system-design/{platform_id}/
349
+ - [ ] Output file named as `{feature_id}-{feature_name}-design.md`
297
350
  - [ ] Checkpoint A passed: function extraction confirmed (or skipped via skip_confirmation)
298
351
  - [ ] **No TODO/FIXME placeholders** — all components and methods have complete pseudocode
299
352
  - [ ] **API routes match API Contract exactly** — verified route-by-route
@@ -28,14 +28,22 @@ tools: Read, Write, Glob, Grep
28
28
 
29
29
  3. **MANDATORY: Template-first workflow** — Copy template MUST execute before fill sections. Skipping copy and writing content directly is FORBIDDEN.
30
30
 
31
+ 4. **MANDATORY: Output filename pattern** — Output filename MUST follow pattern: `{feature_id}-{feature_name}-design.md`. Omitting feature_id or using alternative naming is FORBIDDEN.
32
+
31
33
  ## Step 1: Read Inputs
32
34
 
35
+ > **Conditional Execution**: If `index_only` = `true`, **skip Steps 1-4** and jump directly to Step 5 to generate INDEX.md.
36
+
33
37
  **Input Parameters** (from agent context):
34
38
  - `feature_id` (optional): Feature identifier, e.g., `F-CRM-01`.
35
39
  - `feature_name`: Feature name, e.g., `customer-list`.
36
40
  - `platform_id`: Target platform, e.g., `mobile-uniapp`, `mobile-flutter`.
37
41
  - `skip_confirmation` (optional, boolean): When `true`, skip Checkpoint A user confirmation (used in batch dispatch mode)
38
42
  - `skip_index_generation` (optional, boolean): When `true`, skip Step 5 INDEX.md generation (INDEX.md will be generated by orchestrator after all workers complete)
43
+ - `index_only` (optional, boolean): When `true`, skip Steps 1-4 and ONLY execute Step 5 (INDEX.md generation). Used after all platform workers complete.
44
+ - `task_id` (optional, string): Task identifier in DISPATCH-PROGRESS.json. Used for status tracking.
45
+ - `dispatch_progress_file` (optional, string): Path to DISPATCH-PROGRESS.json. If provided, worker updates its own task status on completion.
46
+ - `update_progress_script` (optional, string): Path to update-progress.js script.
39
47
 
40
48
  Read in order:
41
49
 
@@ -97,6 +105,30 @@ Mark each function's screens/widgets as:
97
105
 
98
106
  For each function (or logical group of closely related functions = one module):
99
107
 
108
+ ### Output File Naming Convention
109
+
110
+ **MANDATORY**: The design document file MUST be named using this exact pattern:
111
+
112
+ ```
113
+ {feature_id}-{feature_name}-design.md
114
+ ```
115
+
116
+ Examples:
117
+ - `F-M01-05-操作日志-design.md` ✅
118
+ - `F-M02-01-顾客档案管理-design.md` ✅
119
+ - `member-level-change-history-design.md` ❌ (missing feature_id prefix)
120
+ - `customer-profile-design.md` ❌ (missing feature_id prefix)
121
+
122
+ Where:
123
+ - `feature_id`: The exact feature ID from dispatch context (e.g., `F-M01-05`, `F-M02-01`)
124
+ - `feature_name`: The exact feature name from dispatch context (e.g., `操作日志`, `顾客档案管理`)
125
+
126
+ > ⚠️ **FORBIDDEN**:
127
+ > - Using any filename format other than `{feature_id}-{feature_name}-design.md`
128
+ > - Omitting the feature_id prefix
129
+ > - Translating or paraphrasing the feature_name (must use the exact name from context)
130
+ > - Using function/sub-feature names instead of the main feature_name
131
+
100
132
  ### 4.1 Read Template
101
133
 
102
134
  Read `SD-MOBILE-TEMPLATE.md` for document structure.
@@ -147,7 +179,9 @@ Verify the completed design document:
147
179
 
148
180
  ## Step 5: Generate Platform INDEX.md
149
181
 
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.
182
+ > **Conditional Execution**:
183
+ > - If `skip_index_generation` = `true`, **skip this entire Step 5**.
184
+ > - If `index_only` = `true`, this step is the ONLY step to execute (Steps 1-4 are skipped).
151
185
 
152
186
  After all module designs are complete:
153
187
 
@@ -223,7 +257,24 @@ Concerns/Trade-offs:
223
257
  4. Are all API calls from API Contract covered?
224
258
  5. Are platform-specific features (permissions, native integration) properly handled?
225
259
 
226
- ## Step 7: Task Completion Report
260
+ ## Step 7: Update Task Status (if dispatch_progress_file provided)
261
+
262
+ > **Conditional Execution**: Only execute this step if `dispatch_progress_file` and `task_id` parameters are provided in the dispatch context.
263
+
264
+ Update the task status in DISPATCH-PROGRESS.json to mark this task as completed:
265
+
266
+ ```
267
+ node "${update_progress_script}" update-task --file "${dispatch_progress_file}" --task-id "${task_id}" --status completed
268
+ ```
269
+
270
+ If the design document generation failed at any step, update with status `failed` instead:
271
+ ```
272
+ node "${update_progress_script}" update-task --file "${dispatch_progress_file}" --task-id "${task_id}" --status failed
273
+ ```
274
+
275
+ > ⚠️ **IMPORTANT**: This step MUST be the last action before returning the completion report. Do NOT skip this step in batch dispatch mode.
276
+
277
+ ## Step 8: Task Completion Report
227
278
 
228
279
  After completing all steps, output a structured completion report for the System Designer Agent to parse and update DISPATCH-PROGRESS.json:
229
280
 
@@ -276,6 +327,7 @@ After completing all steps, output a structured completion report for the System
276
327
  | **API Route Consistency** | All API routes in the design document MUST exactly match the routes defined in the API Contract document. Before writing any route, READ the API Contract and copy routes verbatim. Do NOT invent or modify routes. |
277
328
  | **Cross-Feature Dependency Marking** | When referencing functionality from another Feature (e.g., conflict detection from F-APPT-002), MUST explicitly mark it as `[DEPENDENCY: F-XXX-NNN]` and define a degradation strategy (e.g., hide button, show placeholder) for when that Feature is not yet implemented. |
278
329
  | **Mermaid for All Diagrams** | ALL screen trees, navigation flows, interaction sequences, and state diagrams MUST use Mermaid syntax (`graph TB`, `sequenceDiagram`, `flowchart`). Plain text ASCII diagrams are FORBIDDEN for these sections. |
330
+ | **Output Filename Pattern** | Output filename MUST follow pattern: `{feature_id}-{feature_name}-design.md` |
279
331
 
280
332
  # Checklist
281
333
 
@@ -292,6 +344,7 @@ After completing all steps, output a structured completion report for the System
292
344
  - [ ] App lifecycle handling documented
293
345
  - [ ] INDEX.md generated with complete module list
294
346
  - [ ] All files written to correct paths under 03.system-design/{platform_id}/
347
+ - [ ] Output file named as `{feature_id}-{feature_name}-design.md`
295
348
  - [ ] **Checkpoint A passed**: function extraction confirmed (or skipped via skip_confirmation)
296
349
  - [ ] **No TODO/FIXME placeholders** — all screens and methods have complete pseudocode
297
350
  - [ ] **API routes match API Contract exactly** — verified route-by-route
@@ -130,33 +130,45 @@ This skill MUST execute tasks continuously without unnecessary interruptions.
130
130
  4. Compute batch plan (batch size = 6)
131
131
  5. For each batch:
132
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`
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`, `dispatch_progress_file`, `update_progress_script`
134
134
  c. **Wait** for ALL Workers in the batch to complete
135
135
  d. Update DISPATCH-PROGRESS.json for each completed Worker
136
136
  e. Log batch progress
137
137
  6. After all batches complete, read final progress summary
138
- 7. Generate INDEX.md for each platform (AGENT-OWNED, see Phase 5.5)
138
+ 7. Dispatch worker per platform with `index_only: true` to generate INDEX.md (see Phase 5.5)
139
139
 
140
140
  **CRITICAL**: Each Worker handles exactly ONE feature on ONE platform. DO NOT group multiple features or platforms into a single Worker.
141
141
 
142
142
  **Batch Dispatch Context Parameters**: When dispatching Workers in batch mode, the following parameters MUST be included in each Worker's context:
143
143
  - `skip_confirmation: true` — Workers skip Checkpoint A user confirmation (not feasible in batch mode)
144
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.
145
+ - `dispatch_progress_file` — Path to DISPATCH-PROGRESS.json, enables Worker to self-update its task status on completion
146
+ - `update_progress_script` Path to update-progress.js script, used by Worker to execute status updates
147
+ - `task_id` — Task identifier in DISPATCH-PROGRESS.json (already part of dispatch context, listed here for completeness)
148
+
149
+ > **Worker Self-Update**: When `dispatch_progress_file` and `task_id` are provided, the Worker is responsible for updating its own task status in DISPATCH-PROGRESS.json upon completion (Step 7 of platform skills). The orchestrator's P5-B4-POST block serves as a fallback, but the Worker self-update is the primary mechanism.
150
+
151
+ ### Phase 5.5: INDEX.md Generation (WORKER-DISPATCH)
152
+
153
+ After ALL Feature×Platform workers complete successfully, dispatch ONE worker per platform to generate INDEX.md. Each worker receives `index_only: true` and `skip_index_generation: false`, executing ONLY Step 5 of the platform skill.
154
+
155
+ **Dispatch parameters per platform**:
156
+ - `agent`: speccrew-task-worker
157
+ - `skill`: speccrew-sd-${platform.type}
158
+ - `skill_path`: ${ide_skills_dir}/speccrew-sd-${platform.type}/SKILL.md
159
+ - `context`:
160
+ - `index_only: true`
161
+ - `skip_index_generation: false`
162
+ - `platform_id`: ${platform.id}
163
+ - `output_dir`: ${iterations_dir}/${current_iteration}/03.system-design/${platform.id}
164
+ - `completed_documents`: ${platform.completed_documents}
165
+ - `techs_knowledge_dir`: ${techs_knowledge_dir}
166
+ - `workspace_path`: ${workspace_path}
167
+ - `task_id`: idx-${platform.id}
168
+ - `dispatch_progress_file`: ${iterations_dir}/${current_iteration}/03.system-design/DISPATCH-PROGRESS.json
169
+ - `update_progress_script`: ${update_progress_script}
170
+
171
+ **FORBIDDEN**: Orchestrator generating INDEX.md directly. INDEX.md MUST be generated by worker.
160
172
 
161
173
  **Example** (5 features × 3 platforms = 15 workers, 3 batches of 6/6/3):
162
174
  - Batch 1: Workers 1-6 (parallel)
@@ -189,7 +201,7 @@ DO NOT proceed past these checkpoints without explicit user confirmation.
189
201
  - **DO NOT generate framework-evaluation.md yourself** — Only workers generate it
190
202
  - **DO NOT create scripts for batch analysis** — Workers handle this via their own skill
191
203
  - **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
204
+ - **DO NOT let individual workers generate INDEX.md in batch mode** — `skip_index_generation: true` must be set; INDEX.md is generated in Phase 5.5 by separate worker with `index_only: true`
193
205
  - **DO NOT skip reading workflow.agentflow.xml** — XML is the execution authority
194
206
  - **DO NOT generate DESIGN-OVERVIEW.md yourself** — Dispatch speccrew-task-worker with speccrew-sd-design-overview-generate skill
195
207
  - **DO NOT use Skill tool for Phase 4 design overview generation** — Skill tool executes inline, Agent tool creates a worker
@@ -391,7 +391,9 @@
391
391
  framework_decisions: ${framework_result.decisions},
392
392
  output_base_path: ${iterations_dir}/${current_iteration}/03.system-design,
393
393
  skip_confirmation: true,
394
- skip_index_generation: true
394
+ skip_index_generation: true,
395
+ dispatch_progress_file: ${iterations_dir}/${current_iteration}/03.system-design/DISPATCH-PROGRESS.json,
396
+ update_progress_script: ${update_progress_script}
395
397
  </field>
396
398
  <field name="output" var="worker_result_${task.id}"/>
397
399
  </block>
@@ -426,30 +428,36 @@
426
428
  <!-- batch-update is available via: node update-progress.js batch-update --file <progress.json> --tasks-file <tasks.json> -->
427
429
  <!-- Use when orchestrator needs to batch-update multiple task statuses at once -->
428
430
 
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
+ <!-- Phase 5.5: Generate Platform INDEX.md (WORKER-DISPATCH) -->
432
+ <block type="rule" id="P5-IDX-R1" level="mandatory" desc="INDEX.md Generation via Worker Dispatch">
431
433
  <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.
434
+ After ALL Feature×Platform workers complete, dispatch ONE worker per platform to generate INDEX.md.
435
+ - Each worker receives index_only=true, skip_index_generation=false
436
+ - Worker executes ONLY Step 5 of the platform skill
437
+ - FORBIDDEN: Orchestrator generating INDEX.md directly (must use worker)
442
438
  </field>
443
439
  </block>
444
440
  <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>
441
+ <block type="task" id="P5-IDX-DISPATCH" action="dispatch-to-worker" status="pending"
442
+ desc="Dispatch worker to generate INDEX.md for ${platform.id}">
443
+ <field name="agent">speccrew-task-worker</field>
444
+ <field name="skill">speccrew-sd-${platform.type}</field>
445
+ <field name="skill_path">${ide_skills_dir}/speccrew-sd-${platform.type}/SKILL.md</field>
446
+ <field name="context">
447
+ index_only: true
448
+ skip_index_generation: false
449
+ platform_id: ${platform.id}
450
+ output_dir: ${iterations_dir}/${current_iteration}/03.system-design/${platform.id}
451
+ completed_documents: ${platform.completed_documents}
452
+ techs_knowledge_dir: ${techs_knowledge_dir}
453
+ workspace_path: ${workspace_path}
454
+ task_id: idx-${platform.id}
455
+ dispatch_progress_file: ${iterations_dir}/${current_iteration}/03.system-design/DISPATCH-PROGRESS.json
456
+ update_progress_script: ${update_progress_script}
457
+ </field>
451
458
  </block>
452
459
  </block>
460
+ <block type="gateway" id="P5-IDX-GW1" mode="wait" desc="Wait for all INDEX.md workers to complete"/>
453
461
 
454
462
  <!-- Step 5.5: Read final dispatch progress -->
455
463
  <block type="task" id="P5-B5" action="run-script" status="pending"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speccrew",
3
- "version": "0.7.59",
3
+ "version": "0.7.61",
4
4
  "description": "Spec-Driven Development toolkit for AI-powered IDEs",
5
5
  "author": "charlesmu99",
6
6
  "repository": {