speccrew 0.7.4 → 0.7.6

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.
Files changed (31) hide show
  1. package/.speccrew/agents/speccrew-feature-designer.md +6 -0
  2. package/.speccrew/agents/speccrew-product-manager.md +6 -0
  3. package/.speccrew/agents/speccrew-system-deployer.md +6 -0
  4. package/.speccrew/agents/speccrew-system-designer.md +6 -0
  5. package/.speccrew/agents/speccrew-system-developer.md +6 -0
  6. package/.speccrew/agents/speccrew-task-worker.md +5 -0
  7. package/.speccrew/agents/speccrew-test-manager.md +6 -0
  8. package/.speccrew/skills/speccrew-feature-designer-orchestration/SKILL.md +117 -0
  9. package/.speccrew/skills/speccrew-feature-designer-orchestration/workflow.agentflow.xml +463 -0
  10. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/workflow.agentflow.xml +119 -10
  11. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/SKILL.md +3 -3
  12. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/SKILL.md +1 -1
  13. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/generate-inventory.js +289 -0
  14. package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/reindex-modules.js +1 -1
  15. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/workflow.agentflow.xml +170 -3
  16. package/.speccrew/skills/speccrew-knowledge-graph-write/SKILL.md +1 -1
  17. package/.speccrew/skills/speccrew-pm-module-initializer/SKILL.md +1 -1
  18. package/.speccrew/skills/speccrew-pm-module-initializer/workflow.agentflow.xml +1 -1
  19. package/.speccrew/skills/speccrew-product-manager-orchestration/SKILL.md +111 -0
  20. package/.speccrew/skills/speccrew-product-manager-orchestration/workflow.agentflow.xml +534 -0
  21. package/.speccrew/skills/speccrew-system-deployer-orchestration/SKILL.md +91 -0
  22. package/.speccrew/skills/speccrew-system-deployer-orchestration/workflow.agentflow.xml +309 -0
  23. package/.speccrew/skills/speccrew-system-designer-orchestration/SKILL.md +102 -0
  24. package/.speccrew/skills/speccrew-system-designer-orchestration/workflow.agentflow.xml +375 -0
  25. package/.speccrew/skills/speccrew-system-developer-orchestration/SKILL.md +110 -0
  26. package/.speccrew/skills/speccrew-system-developer-orchestration/workflow.agentflow.xml +422 -0
  27. package/.speccrew/skills/speccrew-task-worker-execution/SKILL.md +106 -0
  28. package/.speccrew/skills/speccrew-task-worker-execution/workflow.agentflow.xml +177 -0
  29. package/.speccrew/skills/speccrew-test-manager-orchestration/SKILL.md +106 -0
  30. package/.speccrew/skills/speccrew-test-manager-orchestration/workflow.agentflow.xml +442 -0
  31. package/package.json +1 -1
@@ -0,0 +1,422 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <workflow id="system-developer-orchestration" status="pending">
3
+
4
+ <block type="input" id="I1" desc="System Developer orchestration input">
5
+ <field name="workspace_path" required="true" type="string" desc="speccrew-workspace root directory path"/>
6
+ <field name="iterations_dir" required="true" type="string" desc="iterations directory path"/>
7
+ <field name="update_progress_script" required="true" type="string" desc="Path to update-progress.js script"/>
8
+ <field name="current_iteration" required="false" type="string" desc="Current active iteration identifier"/>
9
+ </block>
10
+
11
+ <!-- ========== Phase 0: Stage Gate & Resume ========== -->
12
+ <sequence name="Phase 0: Stage Gate &amp; Resume">
13
+
14
+ <!-- Step 0.1: Verify Upstream Completion -->
15
+ <block type="task" id="P0-B1" action="run-script" status="pending"
16
+ desc="Read WORKFLOW-PROGRESS.json overview">
17
+ <field name="command">node ${update_progress_script} read --file ${iterations_dir}/${current_iteration}/WORKFLOW-PROGRESS.json --overview</field>
18
+ <field name="output" var="workflow_progress"/>
19
+ </block>
20
+
21
+ <block type="gateway" id="P0-G1" mode="exclusive" desc="Check System Design stage status">
22
+ <branch test="${workflow_progress.stages.03_system_design.status} == 'confirmed'" name="System Design Confirmed">
23
+ <block type="task" id="P0-B2" action="run-script" status="pending"
24
+ desc="Update Development stage status to in_progress">
25
+ <field name="command">node ${update_progress_script} update-workflow --file ${iterations_dir}/${current_iteration}/WORKFLOW-PROGRESS.json --stage 04_development --status in_progress</field>
26
+ </block>
27
+ </branch>
28
+ <branch default="true" name="System Design Not Confirmed">
29
+ <block type="event" id="P0-E1" action="log" desc="Report System Design not confirmed">
30
+ <field name="message">System Design stage has not been confirmed. Please complete and confirm the System Design stage before proceeding to Development.</field>
31
+ </block>
32
+ <block type="event" id="P0-E2" action="abort" desc="Stop workflow"/>
33
+ </branch>
34
+ </block>
35
+
36
+ <!-- Step 0.2: Check Resume State -->
37
+ <block type="task" id="P0-B3" action="run-script" status="pending"
38
+ desc="Read checkpoints for resume state">
39
+ <field name="command">node ${update_progress_script} read --file ${iterations_dir}/${current_iteration}/04.development/.checkpoints.json --checkpoints</field>
40
+ <field name="output" var="checkpoints"/>
41
+ </block>
42
+
43
+ <!-- Step 0.3: Check Dispatch Resume -->
44
+ <block type="task" id="P0-B4" action="run-script" status="pending"
45
+ desc="Read dispatch progress summary">
46
+ <field name="command">node ${update_progress_script} read --file ${iterations_dir}/${current_iteration}/04.development/DISPATCH-PROGRESS.json --summary</field>
47
+ <field name="output" var="dispatch_progress"/>
48
+ </block>
49
+ </sequence>
50
+
51
+ <!-- ========== Phase 0.5: IDE Directory Detection ========== -->
52
+ <sequence name="Phase 0.5: IDE Directory Detection">
53
+ <block type="task" id="P05-B1" action="read-file" status="pending"
54
+ desc="Detect IDE directory and skills">
55
+ <field name="path">${workspace_path}/.qoder/skills</field>
56
+ <field name="output" var="ide_skills_dir"/>
57
+ </block>
58
+
59
+ <block type="rule" id="P05-R1" level="mandatory" desc="IDE skills directory verification">
60
+ <field name="text">Verify skills directory exists in priority order: .qoder/skills, .cursor/skills, .claude/skills, .speccrew/skills</field>
61
+ <field name="text">If NO IDE directory contains skills folder → STOP and report error</field>
62
+ </block>
63
+
64
+ <block type="gateway" id="P05-G1" mode="exclusive" desc="Verify dev skills availability">
65
+ <branch test="${ide_skills_dir} exists" name="Skills Directory Found">
66
+ <block type="event" id="P05-E1" action="log" desc="Report available dev skills">
67
+ <field name="template">dev-skills-availability-check</field>
68
+ <field name="skills">speccrew-dev-backend, speccrew-dev-frontend, speccrew-dev-mobile, speccrew-dev-desktop-electron, speccrew-dev-desktop-tauri, speccrew-dev-review-*</field>
69
+ </block>
70
+ </branch>
71
+ <branch default="true" name="Skills Directory Not Found">
72
+ <block type="event" id="P05-E2" action="log" desc="Report missing skills directory">
73
+ <field name="message">IDE Skills Directory Not Found. Ensure IDE configuration is correct or run: npx speccrew init</field>
74
+ </block>
75
+ <block type="event" id="P05-E3" action="abort" desc="Stop workflow"/>
76
+ </branch>
77
+ </block>
78
+ </sequence>
79
+
80
+ <!-- ========== Step 1: Read System Design ========== -->
81
+ <sequence name="Step 1: Read System Design">
82
+ <!-- Step 1.1: Locate System Design Documents -->
83
+ <block type="task" id="P1-B1" action="read-file" status="pending"
84
+ desc="Read DESIGN-OVERVIEW.md">
85
+ <field name="path">${iterations_dir}/${current_iteration}/03.system-design/DESIGN-OVERVIEW.md</field>
86
+ <field name="output" var="design_overview"/>
87
+ </block>
88
+
89
+ <!-- Step 1.2: Read Per-Platform Module Index -->
90
+ <block type="event" id="P1-E1" action="log" desc="Read per-platform INDEX.md files">
91
+ <field name="template">read-platform-indexes</field>
92
+ <field name="output" var="platform_indexes"/>
93
+ </block>
94
+
95
+ <!-- Step 1.3: Build Module List -->
96
+ <block type="event" id="P1-E2" action="log" desc="Build module task list from design docs">
97
+ <field name="template">build-module-list</field>
98
+ <field name="output" var="module_list"/>
99
+ </block>
100
+ </sequence>
101
+
102
+ <!-- ========== Step 2: Load Techs Knowledge ========== -->
103
+ <sequence name="Step 2: Load Techs Knowledge">
104
+ <block type="task" id="P2-B1" action="read-file" status="pending"
105
+ desc="Check techs-manifest.json exists">
106
+ <field name="path">${workspace_path}/knowledges/techs/techs-manifest.json</field>
107
+ <field name="output" var="techs_manifest"/>
108
+ </block>
109
+
110
+ <block type="gateway" id="P2-G1" mode="exclusive" desc="Check techs knowledge base availability">
111
+ <branch test="${techs_manifest} exists" name="Techs Knowledge Exists">
112
+ <block type="event" id="P2-E1" action="log" desc="Load platform-specific tech stacks"/>
113
+ </branch>
114
+ <branch default="true" name="Techs Knowledge Not Found">
115
+ <block type="event" id="P2-E2" action="log" desc="Report techs knowledge missing">
116
+ <field name="message">TECHS KNOWLEDGE BASE NOT FOUND. Required file missing: knowledges/techs/techs-manifest.json. Please initialize the techs knowledge base first.</field>
117
+ </block>
118
+ <block type="event" id="P2-E3" action="abort" desc="Stop workflow"/>
119
+ </branch>
120
+ </block>
121
+
122
+ <!-- Step 2.1: Common Knowledge -->
123
+ <block type="event" id="P2-E4" action="log" desc="Load architecture.md and tech-stack.md for each platform">
124
+ <field name="template">load-common-techs-knowledge</field>
125
+ </block>
126
+
127
+ <!-- Step 2.2: Platform-Specific Knowledge -->
128
+ <block type="event" id="P2-E5" action="log" desc="Load platform-specific conventions">
129
+ <field name="template">load-platform-specific-knowledge</field>
130
+ </block>
131
+ </sequence>
132
+
133
+ <!-- ========== Step 3: Environment Pre-check ========== -->
134
+ <sequence name="Step 3: Environment Pre-check">
135
+ <!-- Step 3.1: Check Runtime Versions -->
136
+ <block type="task" id="P3-B1" action="run-script" status="pending"
137
+ desc="Verify runtime versions">
138
+ <field name="command">node --version; java -version; flutter --version 2>&1 || echo "Some runtimes may not be installed"</field>
139
+ <field name="output" var="runtime_versions"/>
140
+ </block>
141
+
142
+ <!-- Step 3.2: Check Dependencies -->
143
+ <block type="event" id="P3-E1" action="log" desc="Verify dependencies are installed">
144
+ <field name="template">check-dependencies</field>
145
+ </block>
146
+
147
+ <!-- Step 3.3: Check Services Availability -->
148
+ <block type="event" id="P3-E2" action="log" desc="Verify required services are accessible">
149
+ <field name="template">check-services</field>
150
+ </block>
151
+
152
+ <block type="gateway" id="P3-G1" mode="exclusive" desc="Check pre-check result">
153
+ <branch test="${precheck_passed} == true" name="Pre-check Passed">
154
+ <block type="task" id="P3-B2" action="run-script" status="pending"
155
+ desc="Write environment_precheck checkpoint">
156
+ <field name="command">node ${update_progress_script} write-checkpoint --file ${iterations_dir}/${current_iteration}/04.development/.checkpoints.json --stage 04_development --checkpoint environment_precheck --passed true --description "Runtime environment verification"</field>
157
+ </block>
158
+ </branch>
159
+ <branch default="true" name="Pre-check Failed">
160
+ <block type="event" id="P3-E3" action="log" desc="Report pre-check failure">
161
+ <field name="message">Environment pre-check failed. Please resolve the issues before proceeding.</field>
162
+ </block>
163
+ <block type="event" id="P3-E4" action="abort" desc="Stop workflow"/>
164
+ </branch>
165
+ </block>
166
+ </sequence>
167
+
168
+ <!-- ========== Step 4: Dispatch Per-Module Dev Skills ========== -->
169
+ <sequence name="Step 4: Dispatch Per-Module Dev Skills">
170
+ <block type="rule" id="P4-R1" level="forbidden" desc="Worker-Only Rules">
171
+ <field name="text">ALL dev tasks MUST be dispatched to speccrew-task-worker. Agent NEVER writes application code.</field>
172
+ <field name="text">DO NOT create source code files (*.java, *.ts, *.vue, *.py, *.dart, *.rs, etc.)</field>
173
+ <field name="text">DO NOT invoke dev skills directly (only via speccrew-task-worker)</field>
174
+ <field name="text">DO NOT skip review phase even if dev worker reports success</field>
175
+ <field name="text">DO NOT write code as fallback if worker fails</field>
176
+ </block>
177
+
178
+ <block type="rule" id="P4-R2" level="mandatory" desc="Stage 4 Directory Constraint">
179
+ <field name="text">All development outputs MUST go under iterations/{iter}/04.development/</field>
180
+ <field name="text">Task records: 04.development/{platform_id}/{module}-task.md</field>
181
+ <field name="text">Review reports: 04.development/{platform_id}/{module}-review-report.md</field>
182
+ <field name="text">FORBIDDEN directory names: 04.dev-report/, 04.dev-reports/, 04.implementation/</field>
183
+ </block>
184
+
185
+ <!-- Step 4.0: Initialize DISPATCH-PROGRESS.json -->
186
+ <block type="task" id="P4-B1" action="run-script" status="pending"
187
+ desc="Initialize dispatch progress with task list">
188
+ <field name="command">node ${update_progress_script} init --file ${iterations_dir}/${current_iteration}/04.development/DISPATCH-PROGRESS.json --stage 04_development --tasks-file ${iterations_dir}/${current_iteration}/04.development/.tasks-temp.json</field>
189
+ </block>
190
+
191
+ <!-- Step 4.1: Determine Skill for Each Platform -->
192
+ <block type="event" id="P4-E1" action="log" desc="Map platform types to dev skills">
193
+ <field name="template">platform-dev-skill-mapping</field>
194
+ <field name="output" var="platform_skill_map"/>
195
+ </block>
196
+
197
+ <!-- Step 4.2: Build Module Task List -->
198
+ <block type="event" id="P4-E2" action="log" desc="Build task list from module designs">
199
+ <field name="template">build-dev-task-list</field>
200
+ <field name="output" var="task_list"/>
201
+ </block>
202
+
203
+ <!-- Step 4.2a: Task List Review Checkpoint -->
204
+ <block type="event" id="P4-E3" action="confirm" desc="Present task list for user confirmation">
205
+ <field name="prompt">📋 Development Task List. Total tasks: ${task_count}. Proceed with dispatch? (确认/取消)</field>
206
+ <field name="template">task-list-summary</field>
207
+ </block>
208
+
209
+ <block type="gateway" id="P4-G1" mode="exclusive" desc="Handle task list confirmation">
210
+ <branch test="${user_response} == '确认' or ${user_response} == 'OK'" name="User Confirmed">
211
+ <block type="task" id="P4-B2" action="run-script" status="pending"
212
+ desc="Write task_list_review checkpoint">
213
+ <field name="command">node ${update_progress_script} write-checkpoint --file ${iterations_dir}/${current_iteration}/04.development/.checkpoints.json --stage 04_development --checkpoint task_list_review --passed true --description "Development task list confirmed by user"</field>
214
+ </block>
215
+ </branch>
216
+ <branch default="true" name="User Cancelled">
217
+ <block type="event" id="P4-E4" action="abort" desc="Stop workflow"/>
218
+ </branch>
219
+ </block>
220
+
221
+ <!-- Step 4.3: Dispatch Workers with Concurrency Limit -->
222
+ <block type="rule" id="P4-R3" level="mandatory" desc="Parallel dispatch rule">
223
+ <field name="text">Max concurrent workers: 6</field>
224
+ <field name="text">Dispatch ALL workers IN PARALLEL — DO NOT execute sequentially</field>
225
+ </block>
226
+
227
+ <block type="task" id="P4-B3" action="run-script" status="pending"
228
+ desc="Update task status to in_progress">
229
+ <field name="command">node ${update_progress_script} update-task --file ${iterations_dir}/${current_iteration}/04.development/DISPATCH-PROGRESS.json --task-id ${task_id} --status in_progress</field>
230
+ </block>
231
+
232
+ <block type="task" id="P4-B4" action="dispatch-to-worker" status="pending"
233
+ desc="Dispatch dev workers for modules">
234
+ <field name="worker">speccrew-task-worker</field>
235
+ <field name="max_concurrent">6</field>
236
+ <field name="tasks">${task_list}</field>
237
+ <field name="note">Each worker receives: skill_path, task_id, platform_id, feature_id, iteration_path, design_doc_path, api_contract_path, techs_knowledge_paths</field>
238
+ </block>
239
+
240
+ <!-- Step 4.4: Review Verification (MANDATORY) -->
241
+ <block type="rule" id="P4-R4" level="mandatory" desc="Review Rules">
242
+ <field name="text">After EVERY dev worker batch completes, MUST dispatch review workers BEFORE next batch or re-dispatch</field>
243
+ <field name="text">Both successful and failed dev workers require review for diagnosis</field>
244
+ <field name="text">Task cannot proceed to 'completed' status without passing review</field>
245
+ </block>
246
+
247
+ <block type="task" id="P4-B5" action="run-script" status="pending"
248
+ desc="Update task status to in_review after dev worker completes">
249
+ <field name="command">node ${update_progress_script} update-task --file ${iterations_dir}/${current_iteration}/04.development/DISPATCH-PROGRESS.json --task-id ${task_id} --status in_review --output "${output_files}"</field>
250
+ </block>
251
+
252
+ <block type="task" id="P4-B6" action="dispatch-to-worker" status="pending"
253
+ desc="Dispatch review workers">
254
+ <field name="worker">speccrew-task-worker</field>
255
+ <field name="skill">speccrew-dev-review-${platform_type}</field>
256
+ <field name="context">design_doc_path, implementation_report_path, source_root, platform_id, api_contract_path, task_id</field>
257
+ </block>
258
+
259
+ <!-- Review Result Handling -->
260
+ <block type="gateway" id="P4-G2" mode="exclusive" desc="Handle review verdict">
261
+ <branch test="${review.verdict} == 'PASS'" name="Review Passed">
262
+ <block type="task" id="P4-B7" action="run-script" status="pending"
263
+ desc="Update task status to completed">
264
+ <field name="command">node ${update_progress_script} update-task --file ${iterations_dir}/${current_iteration}/04.development/DISPATCH-PROGRESS.json --task-id ${task_id} --status completed --output "${review_report_path}"</field>
265
+ </block>
266
+ </branch>
267
+ <branch test="${review.verdict} == 'PARTIAL'" name="Review Partial">
268
+ <block type="task" id="P4-B8" action="run-script" status="pending"
269
+ desc="Update task status to partial">
270
+ <field name="command">node ${update_progress_script} update-task --file ${iterations_dir}/${current_iteration}/04.development/DISPATCH-PROGRESS.json --task-id ${task_id} --status partial --output "${review_report_path}" --metadata "${review.redispatch_guidance}"</field>
271
+ </block>
272
+ </branch>
273
+ <branch default="true" name="Review Failed">
274
+ <block type="task" id="P4-B9" action="run-script" status="pending"
275
+ desc="Update task status to failed">
276
+ <field name="command">node ${update_progress_script} update-task --file ${iterations_dir}/${current_iteration}/04.development/DISPATCH-PROGRESS.json --task-id ${task_id} --status failed --error "${review.summary}" --error-category VALIDATION_ERROR</field>
277
+ </block>
278
+ </branch>
279
+ </block>
280
+
281
+ <!-- Step 4.5: Re-dispatch Partial/Failed Tasks -->
282
+ <block type="rule" id="P4-R5" level="mandatory" desc="Re-dispatch Rules">
283
+ <field name="text">Maximum re-dispatch attempts: 2 (total 3 attempts including initial)</field>
284
+ <field name="text">After 3 attempts, mark as 'failed' with accumulated error info</field>
285
+ </block>
286
+
287
+ <block type="gateway" id="P4-G3" mode="exclusive" desc="Check batch failure rate">
288
+ <branch test="${failure_rate} > 0.5" name="Batch Failure Threshold Exceeded">
289
+ <block type="event" id="P4-E5" action="log" desc="Report batch failure">
290
+ <field name="message">❌ BATCH FAILURE THRESHOLD EXCEEDED. Failure Rate: ${failure_rate}% (exceeds 50% threshold)</field>
291
+ </block>
292
+ <block type="event" id="P4-E6" action="abort" desc="Stop workflow"/>
293
+ </branch>
294
+ <branch default="true" name="Within Failure Threshold">
295
+ <block type="event" id="P4-E7" action="log" desc="Continue with remaining/retry tasks"/>
296
+ </branch>
297
+ </block>
298
+ </sequence>
299
+
300
+ <!-- ========== Step 5: Integration Check ========== -->
301
+ <sequence name="Step 5: Integration Check">
302
+ <!-- Step 5.1: API Contract Alignment -->
303
+ <block type="event" id="P5-E1" action="log" desc="Verify cross-platform API consistency">
304
+ <field name="template">api-contract-alignment-check</field>
305
+ <field name="checklist">exact_path_match, request_format, response_format, error_codes, auth_headers</field>
306
+ </block>
307
+
308
+ <!-- Step 5.1a: API Contract Alignment Checklist -->
309
+ <block type="checkpoint" id="P5-CP1" name="api_alignment" desc="API Contract alignment verification">
310
+ <field name="conditions">api_calls_match_backend_endpoints, request_response_dtos_consistent, error_handling_aligned</field>
311
+ </block>
312
+
313
+ <!-- Step 5.1b: Data Model Consistency -->
314
+ <block type="event" id="P5-E2" action="log" desc="Verify shared data structures consistency">
315
+ <field name="template">data-model-consistency-check</field>
316
+ <field name="checklist">field_definitions, field_types, enum_values, required_fields</field>
317
+ </block>
318
+
319
+ <!-- Step 5.1c: Cross-Feature Dependencies -->
320
+ <block type="event" id="P5-E3" action="log" desc="Verify cross-feature dependencies">
321
+ <field name="template">cross-feature-dependencies-check</field>
322
+ <field name="checklist">dependency_markers, fallback_strategies</field>
323
+ </block>
324
+
325
+ <!-- Step 5.4: Cross-Platform Issues -->
326
+ <block type="gateway" id="P5-G1" mode="exclusive" desc="Check for integration issues">
327
+ <branch test="${integration_issues} empty" name="No Integration Issues">
328
+ <block type="event" id="P5-E4" action="log" desc="Integration check passed"/>
329
+ </branch>
330
+ <branch default="true" name="Integration Issues Found">
331
+ <block type="event" id="P5-E5" action="log" desc="Report integration issues">
332
+ <field name="template">integration-issues-report</field>
333
+ </block>
334
+ </branch>
335
+ </block>
336
+ </sequence>
337
+
338
+ <!-- ========== Step 6: Delivery Report ========== -->
339
+ <sequence name="Step 6: Delivery Report">
340
+ <!-- Step 6.1: Read Final Dispatch Progress -->
341
+ <block type="task" id="P6-B1" action="run-script" status="pending"
342
+ desc="Read DISPATCH-PROGRESS.json summary">
343
+ <field name="command">node ${update_progress_script} read --file ${iterations_dir}/${current_iteration}/04.development/DISPATCH-PROGRESS.json --summary</field>
344
+ <field name="output" var="final_progress"/>
345
+ </block>
346
+
347
+ <!-- Step 6.2: Per-Platform Summary -->
348
+ <block type="event" id="P6-E1" action="log" desc="Display per-platform summary">
349
+ <field name="template">per-platform-summary</field>
350
+ <field name="data" value="${final_progress}"/>
351
+ </block>
352
+
353
+ <!-- Step 6.3: Failed Tasks Report -->
354
+ <block type="gateway" id="P6-G1" mode="exclusive" desc="Check for failed tasks">
355
+ <branch test="${failed_count} > 0" name="Has Failed Tasks">
356
+ <block type="event" id="P6-E2" action="log" desc="Display failed tasks report">
357
+ <field name="template">failed-tasks-report</field>
358
+ </block>
359
+ </branch>
360
+ <branch default="true" name="No Failed Tasks"/>
361
+ </block>
362
+
363
+ <!-- Step 6.4: Overall Statistics -->
364
+ <block type="event" id="P6-E3" action="log" desc="Display development stage summary">
365
+ <field name="template">development-stage-summary</field>
366
+ <field name="data">
367
+ total_modules: ${total_count},
368
+ completed: ${completed_count},
369
+ failed: ${failed_count},
370
+ skipped: ${skipped_count},
371
+ cross_platform_integration: ${integration_status},
372
+ overall_status: ${overall_status}
373
+ </field>
374
+ </block>
375
+
376
+ <!-- Step 6.5: Tech Debt Items -->
377
+ <block type="event" id="P6-E4" action="log" desc="List tech debt items">
378
+ <field name="template">tech-debt-list</field>
379
+ <field name="path">${iterations_dir}/${current_iteration}/tech-debt/</field>
380
+ </block>
381
+
382
+ <!-- Step 6.6.5: User Confirmation (HARD STOP) -->
383
+ <block type="event" id="P6-E5" action="confirm" desc="Request delivery report confirmation">
384
+ <field name="prompt">🛑 AWAITING USER CONFIRMATION. 开发阶段已完成,请审查交付报告。确认无误后将更新工作流状态。 (确认/需要修改/取消)</field>
385
+ </block>
386
+
387
+ <block type="gateway" id="P6-G2" mode="exclusive" desc="Handle delivery confirmation response">
388
+ <branch test="${user_response} == '确认' or ${user_response} == 'OK'" name="User Confirmed">
389
+ <block type="event" id="P6-E6" action="log" desc="Proceed to finalize"/>
390
+ </branch>
391
+ <branch test="${user_response} == '取消'" name="User Cancelled">
392
+ <block type="event" id="P6-E7" action="abort" desc="Keep current status"/>
393
+ </branch>
394
+ <branch default="true" name="User Requests Modification">
395
+ <block type="event" id="P6-E8" action="log" desc="Address issues before finalizing"/>
396
+ </branch>
397
+ </block>
398
+
399
+ <!-- Step 6.7: User Confirmation and Checkpoint Update -->
400
+ <block type="task" id="P6-B2" action="run-script" status="pending"
401
+ desc="Write delivery_report checkpoint">
402
+ <field name="command">node ${update_progress_script} write-checkpoint --file ${iterations_dir}/${current_iteration}/04.development/.checkpoints.json --stage 04_development --checkpoint delivery_report --passed true --description "Final delivery report"</field>
403
+ </block>
404
+
405
+ <block type="task" id="P6-B3" action="run-script" status="pending"
406
+ desc="Update WORKFLOW-PROGRESS.json to confirmed">
407
+ <field name="command">node ${update_progress_script} update-workflow --file ${iterations_dir}/${current_iteration}/WORKFLOW-PROGRESS.json --stage 04_development --status confirmed --output "04.development/{platform_id}/{module}/"</field>
408
+ </block>
409
+
410
+ <block type="checkpoint" id="P6-CP1" name="delivery_report" desc="Delivery report confirmed">
411
+ <field name="passed" value="true"/>
412
+ </block>
413
+ </sequence>
414
+
415
+ <block type="output" id="O1" desc="System Developer execution result">
416
+ <field name="status" from="${execution.status}" type="string" desc="success / partial / failed"/>
417
+ <field name="output_files" from="${execution.output_files}" type="array" desc="Generated source files and task records"/>
418
+ <field name="summary" from="${execution.summary}" type="string" desc="Execution summary"/>
419
+ <field name="next_steps" from="${execution.next_steps}" type="array" desc="Suggested next actions"/>
420
+ </block>
421
+
422
+ </workflow>
@@ -0,0 +1,106 @@
1
+ ---
2
+ name: speccrew-task-worker-execution
3
+ version: 1.0.0
4
+ description: Task Worker 的通用任务执行技能,负责接收任务参数、加载 Skill 定义、读取 AgentFlow 规范、逐 Block 执行工作流并输出结构化完成报告。
5
+ tools: Read, Grep, Glob, Write, Bash, Edit, WebFetch, WebSearch
6
+ ---
7
+
8
+ > **⚠️ MANDATORY EXECUTION PROTOCOL — READ BEFORE EXECUTING ANY BLOCK**
9
+ >
10
+ > **Step 1**: Load XML workflow specification: `speccrew-workspace/docs/rules/agentflow-spec.md` — this defines all block types and action-to-tool mappings
11
+ >
12
+ > **Step 2**: Execute this SKILL.md's XML workflow **block by block in document order**. For EVERY block, you MUST follow this 3-step cycle:
13
+ >
14
+ > ```
15
+ > 📋 Block [ID] (type=[type], action=[action]) — [desc]
16
+ > 🔧 Tool: [which IDE tool to call]
17
+ > ✅ Result: [output or status]
18
+ > ```
19
+ >
20
+ > Action-to-tool mapping:
21
+ > - `action="run-skill"` → Invoke via **Skill tool** (pass the `<field name="skill">` value EXACTLY)
22
+ > - `action="run-script"` → Execute via **Terminal tool** (pass the `<field name="command">` value EXACTLY)
23
+ > - `action="dispatch-to-worker"` → Create **Task** via **Task tool** for `speccrew-task-worker`
24
+ > - `action="read-file"` → Read via **Read tool**
25
+ > - `action="log"` → Output message directly
26
+ > - `action="confirm"` → Present to user and wait for response
27
+ >
28
+ > **Step 3**: Execute ALL blocks sequentially without pausing (only stop at explicit `<event action="confirm">` blocks)
29
+
30
+ # Task Worker Execution
31
+
32
+ 通用任务执行 Worker 的核心执行技能,负责:
33
+
34
+ 1. **Task Reception** - 接收来自调用 Agent 的任务参数
35
+ 2. **Skill Discovery** - 解析技能路径,定位 SKILL.md 文件
36
+ 3. **Workflow Execution** - 加载 AgentFlow 规范,逐 Block 执行工作流
37
+ 4. **Result Reporting** - 输出结构化完成报告
38
+
39
+ ## Invocation Method
40
+
41
+ **CRITICAL**: This skill is loaded directly by Task Worker Agent — invoked when `skill_path` or `skill_name` is provided.
42
+
43
+ ```xml
44
+ <block type="task" action="run-skill" desc="Execute task worker workflow">
45
+ <field name="skill">speccrew-task-worker-execution</field>
46
+ </block>
47
+ ```
48
+
49
+ ## Input Parameters
50
+
51
+ | Parameter | Type | Required | Description |
52
+ |-----------|------|----------|-------------|
53
+ | `skill_path` | string | No | Full relative path to SKILL.md file (priority over skill_name) |
54
+ | `skill_name` | string | No | Skill name identifier for discovery (backward compatibility) |
55
+ | `context` | object | Yes | Task context parameters (task_id, module, input_path, output_path, etc.) |
56
+ | `workspace_root` | string | Yes | Workspace root directory path |
57
+
58
+ ## Output
59
+
60
+ - `status` - Execution status (success / failed)
61
+ - `task_id` - Task identifier from dispatch context
62
+ - `output_files` - List of generated/modified files
63
+ - `summary` - Execution summary
64
+ - `error` - Error description (if failed)
65
+ - `error_category` - Error category (DEPENDENCY_MISSING | BUILD_FAILURE | VALIDATION_ERROR | RUNTIME_ERROR | BLOCKED)
66
+
67
+ ---
68
+
69
+ ## AgentFlow Definition
70
+
71
+ <!-- @agentflow: workflow.agentflow.xml -->
72
+
73
+ ---
74
+
75
+ ## CONTINUOUS EXECUTION RULES
76
+
77
+ This skill MUST execute tasks continuously without unnecessary interruptions.
78
+
79
+ ### FORBIDDEN Interruptions
80
+
81
+ 1. DO NOT ask user "Should I continue?" after completing a subtask
82
+ 2. DO NOT suggest "Let me split this into batches" or "Let's do this in parts"
83
+ 3. DO NOT pause to list what you plan to do next — just do it
84
+ 4. DO NOT ask for confirmation before generating output files
85
+ 5. DO NOT warn about "large number of files" — proceed with generation
86
+ 6. DO NOT offer "Should I proceed with the remaining items?"
87
+
88
+ ### When to Pause (ONLY these cases)
89
+
90
+ 1. CHECKPOINT gates defined in workflow (user confirmation required by design)
91
+ 2. Ambiguous requirements that genuinely need clarification
92
+ 3. Unrecoverable errors that prevent further progress
93
+ 4. Security-sensitive operations (e.g., deleting existing files)
94
+
95
+ ### Batch Execution Behavior
96
+
97
+ - When multiple items need processing, process ALL of them sequentially without asking
98
+ - Use DISPATCH-PROGRESS.json to track progress, enabling resumption if interrupted
99
+ - NEVER voluntarily stop mid-batch to ask if user wants to continue
100
+
101
+ ### Worker Completion Protocol
102
+
103
+ - After completing assigned skill execution, report results immediately
104
+ - DO NOT ask the dispatching agent for further instructions
105
+ - DO NOT wait for confirmation before writing output files
106
+ - If skill execution fails, report failure with details — do not ask user what to do