speccrew 0.7.17 → 0.7.19
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.
|
@@ -51,6 +51,54 @@ When involving related domains:
|
|
|
51
51
|
- `{workspace_path}/knowledge/domain/glossary/` → Business terminology glossary
|
|
52
52
|
- `{workspace_path}/knowledge/domain/qa/` → Common problem solutions
|
|
53
53
|
|
|
54
|
+
# 🛑 CRITICAL: dispatch-to-worker 执行协议
|
|
55
|
+
|
|
56
|
+
### 定义
|
|
57
|
+
当 orchestration workflow 中出现 `action="dispatch-to-worker"` 时:
|
|
58
|
+
|
|
59
|
+
**你(PM Agent)必须:**
|
|
60
|
+
1. 使用 **Agent tool** 创建一个新的子 Agent
|
|
61
|
+
2. 子 Agent 角色指定为 **speccrew-task-worker**
|
|
62
|
+
3. 在 Task 描述中传递 Skill 名称和所有 context 参数
|
|
63
|
+
4. **等待 Worker 完成**后再继续下一个 block
|
|
64
|
+
|
|
65
|
+
**你(PM Agent)绝对不能:**
|
|
66
|
+
- ❌ 用 Skill tool 直接调用 Phase Skill
|
|
67
|
+
- ❌ 自己运行脚本(包括 update-progress.js)
|
|
68
|
+
- ❌ 自己读写业务文件(如 .clarification-summary.md)
|
|
69
|
+
- ❌ 把 "dispatch" 理解为 "自己执行"
|
|
70
|
+
|
|
71
|
+
### 正确 vs 错误示例
|
|
72
|
+
|
|
73
|
+
**❌ 错误 — PM 自己执行:**
|
|
74
|
+
```
|
|
75
|
+
PM 读取需求文件 → PM 生成澄清总结 → PM 运行 update-progress.js
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**✅ 正确 — PM dispatch 给 Worker:**
|
|
79
|
+
```
|
|
80
|
+
PM 用 Agent tool 创建 speccrew-task-worker 子 Agent
|
|
81
|
+
→ 传递: skill=speccrew-pm-requirement-clarify, context={...}
|
|
82
|
+
→ Worker 加载 Skill 并执行所有步骤
|
|
83
|
+
→ Worker 返回结果给 PM
|
|
84
|
+
PM 继续下一个 orchestration block
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 适用范围:ALL Phases (0-6)
|
|
88
|
+
|
|
89
|
+
| Phase | Skill 名称 | dispatch? |
|
|
90
|
+
|-------|-----------|-----------|
|
|
91
|
+
| Phase 0 | speccrew-pm-phase0-init | ✅ dispatch-to-worker |
|
|
92
|
+
| Phase 1 | speccrew-pm-phase1-knowledge-check | ✅ dispatch-to-worker |
|
|
93
|
+
| Phase 2 | speccrew-pm-phase2-complexity-assess | ✅ dispatch-to-worker |
|
|
94
|
+
| Phase 3 | speccrew-pm-requirement-clarify | ✅ dispatch-to-worker |
|
|
95
|
+
| Phase 4a | speccrew-pm-requirement-model | ✅ dispatch-to-worker |
|
|
96
|
+
| Phase 4b | speccrew-pm-requirement-analysis | ✅ dispatch-to-worker |
|
|
97
|
+
| Phase 5 | speccrew-pm-phase5-subprd-dispatch | ✅ dispatch-to-worker |
|
|
98
|
+
| Phase 6 | speccrew-pm-phase6-verify-confirm | ✅ dispatch-to-worker |
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
54
102
|
# Workflow
|
|
55
103
|
|
|
56
104
|
## AgentFlow Definition
|
|
@@ -241,8 +289,9 @@ After Phase 1 completes, store:
|
|
|
241
289
|
|
|
242
290
|
## Phase 4: Invoke PRD Skill
|
|
243
291
|
|
|
244
|
-
> ⚠️ **PM AGENT ORCHESTRATION PRINCIPLE (
|
|
292
|
+
> ⚠️ **PM AGENT ORCHESTRATION PRINCIPLE (ALL PHASES 0-6)**
|
|
245
293
|
> You are the ORCHESTRATOR, NOT the WRITER:
|
|
294
|
+
> - Phase 0-3: DO NOT run scripts or create files yourself → Dispatch Worker
|
|
246
295
|
> - Phase 4a (Model): DO NOT do ISA-95 analysis yourself → Dispatch Worker
|
|
247
296
|
> - Phase 4a.5 (Confirm): MUST stop for user confirmation after module design
|
|
248
297
|
> - Phase 4b (Generate): DO NOT generate Master PRD yourself → Dispatch Worker
|
|
@@ -597,12 +646,20 @@ Phase 0 → Phase 1 → Phase 2 → Phase 3 → Phase 4 → Phase 5 (if complex)
|
|
|
597
646
|
- **NEVER assume requirement completeness** — clarification skill handles all verification
|
|
598
647
|
- **IF clarification skill fails: ABORT** — do NOT generate clarification yourself
|
|
599
648
|
|
|
600
|
-
## MANDATORY WORKER DISPATCH RULE
|
|
649
|
+
## MANDATORY WORKER DISPATCH RULE (ALL PHASES)
|
|
650
|
+
|
|
651
|
+
🛑 **UNIVERSAL**: PM Agent 在所有 Phase (0-6) 中都必须通过 Agent tool 创建 speccrew-task-worker 子 Agent 来执行 Skill。
|
|
652
|
+
|
|
653
|
+
**执行方式:**
|
|
654
|
+
- 每个 Phase Skill 都通过 Agent tool 创建子 Agent(speccrew-task-worker)
|
|
655
|
+
- Worker Agent 接收 Skill 名称和 context 参数后自行加载执行
|
|
656
|
+
- PM Agent 等待 Worker 完成后继续 orchestration 流程
|
|
601
657
|
|
|
602
|
-
|
|
603
|
-
-
|
|
604
|
-
-
|
|
605
|
-
-
|
|
658
|
+
**禁止行为:**
|
|
659
|
+
- ❌ PM 直接执行任何 Phase Skill
|
|
660
|
+
- ❌ PM 直接运行脚本(update-progress.js 等)
|
|
661
|
+
- ❌ PM 直接创建/修改业务文档(.clarification-summary.md、.module-design.md 等)
|
|
662
|
+
- ❌ PM 用 Skill tool 调用 Phase Skill(必须用 Agent tool)
|
|
606
663
|
|
|
607
664
|
## MANDATORY TEMPLATE PATH
|
|
608
665
|
|
|
@@ -85,3 +85,12 @@ Applies ISA-95 Stage 1 (Domain Description) for clarification:
|
|
|
85
85
|
- Use chat for complex requirements
|
|
86
86
|
- Manually write JSON files
|
|
87
87
|
- Auto-proceed to Phase 4 (PRD generation) without PM Agent's user confirmation gate
|
|
88
|
+
- Auto-pass sufficiency checks without actual user answers
|
|
89
|
+
- Write checkpoints in this Skill — checkpoints are managed by orchestration layer
|
|
90
|
+
|
|
91
|
+
### MANDATORY: User Answer Verification Rule
|
|
92
|
+
|
|
93
|
+
- Worker MUST NOT auto-pass sufficiency checks without actual user answers
|
|
94
|
+
- Each clarification round MUST wait for user to fill in answers before proceeding
|
|
95
|
+
- Checkpoint writing is FORBIDDEN in this Skill — checkpoints are managed by the orchestration layer
|
|
96
|
+
- The sufficiency check result is ONLY valid when based on real user-provided answers
|
|
@@ -118,8 +118,15 @@
|
|
|
118
118
|
<field name="output" var="questions_file"/>
|
|
119
119
|
</block>
|
|
120
120
|
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
<!-- MANDATORY: Wait for user to answer clarification questions -->
|
|
122
|
+
<block type="event" id="E-ROUND-CONFIRM" action="user-confirm" desc="Wait for user to answer clarification questions">
|
|
123
|
+
<field name="prompt">📋 第 ${round_number} 轮澄清问题已生成: ${questions_file}
|
|
124
|
+
|
|
125
|
+
请:
|
|
126
|
+
1. 查看澄清问题文件
|
|
127
|
+
2. 在文件中填写您的答案
|
|
128
|
+
3. 填写完成后确认继续</field>
|
|
129
|
+
<field name="skippable" value="false"/>
|
|
123
130
|
</block>
|
|
124
131
|
|
|
125
132
|
<block type="task" id="B8" action="read-file" desc="Read answered questions">
|
|
@@ -127,10 +134,18 @@
|
|
|
127
134
|
<field name="output" var="answered_questions"/>
|
|
128
135
|
</block>
|
|
129
136
|
|
|
137
|
+
<!-- MANDATORY: User answers are required for sufficiency check -->
|
|
138
|
+
<block type="rule" id="R-ANSWER-REQUIRED" level="mandatory" desc="User answers are required for sufficiency check">
|
|
139
|
+
<field name="text">MANDATORY: Sufficiency check can ONLY pass when the user has actually provided answers to the clarification questions.</field>
|
|
140
|
+
<field name="text">If the clarification questions file still contains only the original template without user answers, ALL checks MUST fail.</field>
|
|
141
|
+
<field name="text">Worker MUST NOT self-evaluate and auto-pass the sufficiency check without real user input.</field>
|
|
142
|
+
</block>
|
|
143
|
+
|
|
130
144
|
<!-- Sufficiency Check -->
|
|
131
145
|
<block type="task" id="B9" action="analyze" desc="Perform sufficiency check">
|
|
132
146
|
<field name="input" value="${answered_questions}"/>
|
|
133
147
|
<field name="checks">
|
|
148
|
+
0. User has actually provided answers - The answered_questions content contains real user responses, not just the original template
|
|
134
149
|
1. Scope boundaries are clear - Explicit in/out scope defined
|
|
135
150
|
2. Key business rules are documented - At least 1 rule identified
|
|
136
151
|
3. Priority/phasing decisions are made - Phase 1 scope is clear
|
|
@@ -177,12 +192,6 @@
|
|
|
177
192
|
<field name="output" var="summary_path"/>
|
|
178
193
|
</block>
|
|
179
194
|
|
|
180
|
-
<!-- Step 7: Initialize .checkpoints.json -->
|
|
181
|
-
<block type="task" id="B11" action="run-script" desc="Initialize checkpoints via script">
|
|
182
|
-
<field name="command">node "${workspace_path}/scripts/update-progress.js" write-checkpoint --file "${iteration_path}/01.product-requirement/.checkpoints.json" --checkpoint requirement_clarification --passed true</field>
|
|
183
|
-
<field name="output" var="checkpoint_result"/>
|
|
184
|
-
</block>
|
|
185
|
-
|
|
186
195
|
<!-- Checkpoint: Clarification complete -->
|
|
187
196
|
<block type="checkpoint" id="CP1" name="clarification-complete" desc="Verify clarification completed">
|
|
188
197
|
<field name="file" value="${summary_path}"/>
|