speccrew 0.7.15 → 0.7.16

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.
@@ -776,11 +776,11 @@ Based on the indicators above:
776
776
 
777
777
  ## Phase 3: Requirement Clarification
778
778
 
779
- Invoke `speccrew-pm-requirement-clarify` skill to perform requirement clarification.
779
+ **CRITICAL:** PM Agent MUST NOT perform requirement clarification directly. Instead, dispatch a Worker Agent with `speccrew-pm-requirement-clarify` skill.
780
780
 
781
781
  ### 3.1 Prepare Parameters
782
782
 
783
- Pass the following parameters to the skill:
783
+ Construct the context for the Worker Agent:
784
784
 
785
785
  | Parameter | Value | Description |
786
786
  |-----------|-------|-------------|
@@ -788,23 +788,32 @@ Pass the following parameters to the skill:
788
788
  | `iteration_path` | `{iterations_dir}/{iteration}` (absolute path from Phase 0.6) | Current iteration directory |
789
789
  | `complexity_hint` | `simple` or `complex` (from Phase 2 assessment) | Complexity assessment result |
790
790
  | `knowledge_status` | `full` / `lite` / `none` (from Phase 1) | Knowledge base availability for clarification strategy |
791
+ | `language` | User's language (e.g., `zh`, `en`) | Language for clarification output |
791
792
 
792
- ### 3.2 Invoke Clarification Skill
793
+ ### 3.2 Dispatch Clarification Worker
793
794
 
794
- **Action:** Invoke `speccrew-pm-requirement-clarify` skill with the parameters above.
795
+ **Action:** Create a Task for `speccrew-task-worker` with `speccrew-pm-requirement-clarify` skill.
795
796
 
796
- **Skill Location:** Search with glob `**/speccrew-pm-requirement-clarify/SKILL.md`
797
+ **FORBIDDEN:**
798
+ - DO NOT invoke `speccrew-pm-requirement-clarify` skill directly via Skill tool
799
+ - DO NOT perform clarification rounds yourself
800
+ - DO NOT generate `.clarification-summary.md` manually
797
801
 
798
- ### 3.3 Wait for Completion
802
+ **REQUIRED:**
803
+ - MUST use Task tool to dispatch Worker Agent
804
+ - MUST pass all context parameters to the Worker
805
+ - MUST wait for Worker to complete and return results
799
806
 
800
- The skill will:
807
+ ### 3.3 Worker Execution
808
+
809
+ The dispatched Worker Agent will:
801
810
  1. Load requirement document and system knowledge
802
811
  2. Execute clarification rounds (chat-based for simple, file-based for complex)
803
812
  3. Perform sufficiency checks (4 checks)
804
813
  4. Generate `.clarification-summary.md`
805
814
  5. Initialize `.checkpoints.json`
806
815
 
807
- **Wait for skill to complete and return.**
816
+ **Wait for Worker to complete and return.**
808
817
 
809
818
  ### 3.4 Validate Output
810
819
 
@@ -931,8 +940,9 @@ Clarification File: {iteration_path}/01.product-requirement/.clarification-summa
931
940
 
932
941
  > ⚠️ **PM AGENT ORCHESTRATION PRINCIPLE (Phase 4-6)**
933
942
  > You are the ORCHESTRATOR, NOT the WRITER:
934
- > - Phase 4a (Model): DO NOT do ISA-95 analysis yourself → Skill does it
935
- > - Phase 4b (Generate): DO NOT generate Master PRD yourselfSkill generates it
943
+ > - Phase 4a (Model): DO NOT do ISA-95 analysis yourself → Dispatch Worker with `speccrew-pm-requirement-model` skill
944
+ > - Phase 4a.5 (Confirm): MUST stop for user confirmation after module design Wait for explicit user approval
945
+ > - Phase 4b (Generate): DO NOT generate Master PRD yourself → Dispatch Worker with `speccrew-pm-requirement-analysis` skill
936
946
  > - Phase 5: DO NOT generate Sub-PRD yourself → Workers generate them
937
947
  > - Phase 6: DO NOT modify PRD content yourself → Only verify and present
938
948
  > - **If ANY Skill fails: STOP and report error to user. DO NOT generate content as fallback.**
@@ -947,19 +957,20 @@ Based on the complexity from `.clarification-summary.md`, invoke the appropriate
947
957
 
948
958
  **Flow:**
949
959
  ```
950
- Invoke speccrew-pm-requirement-simple
951
- → Pass: iteration_path, clarification_file
960
+ Dispatch Worker with speccrew-pm-requirement-simple
961
+ → Pass: iteration_path, clarification_file, language
952
962
  → Wait for: Single PRD file
953
963
  → Validate: PRD file exists and size > 2KB
954
964
  → IF fails → ABORT (ORCHESTRATOR rule)
955
965
  → IF succeeds → Skip Phase 5, go to Phase 6
956
966
  ```
957
967
 
958
- **Parameters:**
968
+ **Parameters (for Worker dispatch):**
959
969
  | Parameter | Value |
960
970
  |-----------|-------|
961
971
  | `iteration_path` | `{iterations_dir}/{iteration}` (absolute path from Phase 0.6) |
962
972
  | `clarification_file` | `{iteration_path}/01.product-requirement/.clarification-summary.md` |
973
+ | `language` | User's language (e.g., `zh`, `en`) |
963
974
 
964
975
  ---
965
976
 
@@ -969,32 +980,47 @@ Invoke speccrew-pm-requirement-simple
969
980
 
970
981
  **Flow:**
971
982
  ```
972
- Step 4a: Invoke speccrew-pm-requirement-model
973
- → Pass: iteration_path, clarification_file
983
+ Step 4a: Dispatch Worker with speccrew-pm-requirement-model
984
+ → Pass: iteration_path, clarification_file, language
974
985
  → Wait for: .module-design.md
975
986
  → Validate: .module-design.md exists + module count >= 2
976
987
  → IF fails → ABORT (ORCHESTRATOR rule: do NOT do module decomposition yourself)
977
988
 
978
- Step 4b: Invoke speccrew-pm-requirement-analysis
979
- Pass: iteration_path, clarification_file, module_design_file
989
+ Step 4a.5: User Confirmation Gate (MANDATORY)
990
+ Present: Module design summary to user
991
+ → Request: Explicit confirmation before proceeding
992
+ → Checkpoint: Update requirement_modeling_confirmed
993
+ → IF user requests changes → Return to Phase 3 with feedback
994
+ → IF user confirms → Proceed to Step 4b
995
+
996
+ Step 4b: Dispatch Worker with speccrew-pm-requirement-analysis
997
+ → Pass: iteration_path, clarification_file, module_design_file, language
980
998
  → Wait for: Master PRD + Dispatch Plan
981
999
  → Validate: Master PRD exists + Dispatch Plan has modules array
982
1000
  → IF fails → ABORT (ORCHESTRATOR rule: do NOT generate PRD yourself)
983
1001
  → IF succeeds → MANDATORY: Execute Phase 5 (Sub-PRD Worker Dispatch)
984
1002
  ```
985
1003
 
986
- **Step 4a Parameters:**
1004
+ **Step 4a Parameters (for Worker dispatch):**
987
1005
  | Parameter | Value |
988
1006
  |-----------|-------|
989
1007
  | `iteration_path` | `{iterations_dir}/{iteration}` (absolute path from Phase 0.6) |
990
1008
  | `clarification_file` | `{iteration_path}/01.product-requirement/.clarification-summary.md` |
1009
+ | `language` | User's language (e.g., `zh`, `en`) |
1010
+
1011
+ **Step 4a.5 User Confirmation:**
1012
+ | Checkpoint | Value |
1013
+ |------------|-------|
1014
+ | `checkpoint_name` | `requirement_modeling_confirmed` |
1015
+ | `description` | "User confirmed module design results" |
991
1016
 
992
- **Step 4b Parameters:**
1017
+ **Step 4b Parameters (for Worker dispatch):**
993
1018
  | Parameter | Value |
994
1019
  |-----------|-------|
995
1020
  | `iteration_path` | `{iterations_dir}/{iteration}` (absolute path from Phase 0.6) |
996
1021
  | `clarification_file` | `{iteration_path}/01.product-requirement/.clarification-summary.md` |
997
1022
  | `module_design_file` | `{iteration_path}/01.product-requirement/.module-design.md` |
1023
+ | `language` | User's language (e.g., `zh`, `en`) |
998
1024
 
999
1025
  ---
1000
1026
 
@@ -1086,9 +1112,10 @@ Step 4b: Invoke speccrew-pm-requirement-analysis
1086
1112
  >
1087
1113
  > | Phase | Skill | ORCHESTRATOR Rule |
1088
1114
  > |-------|-------|-------------------|
1089
- > | Phase 3 | `speccrew-pm-requirement-clarify` | DO NOT clarify requirements yourself — Skill handles all clarification rounds |
1090
- > | Phase 4a | `speccrew-pm-requirement-model` | DO NOT perform ISA-95 analysis or module decomposition yourself |
1091
- > | Phase 4b | `speccrew-pm-requirement-analysis` | DO NOT generate Master PRD or Dispatch Plan yourself |
1115
+ > | Phase 3 | `speccrew-pm-requirement-clarify` | DO NOT clarify requirements yourself — Dispatch Worker to handle all clarification rounds |
1116
+ > | Phase 4a | `speccrew-pm-requirement-model` | DO NOT perform ISA-95 analysis or module decomposition yourself — Dispatch Worker |
1117
+ > | Phase 4a.5 | N/A (User Gate) | MUST stop for user confirmation Wait for explicit approval before Phase 4b |
1118
+ > | Phase 4b | `speccrew-pm-requirement-analysis` | DO NOT generate Master PRD or Dispatch Plan yourself — Dispatch Worker |
1092
1119
  > | Phase 5 | `speccrew-pm-sub-prd-generate` (via workers) | DO NOT generate Sub-PRD content yourself |
1093
1120
  > | Phase 6 | PM Agent verification | DO NOT modify PRD content — only verify and present |
1094
1121
  >
@@ -21,6 +21,7 @@ Requirement clarification with dual-mode support. Produces `.clarification-summa
21
21
  | `requirement_file` | string | Yes | Path to requirement document |
22
22
  | `iteration_path` | string | Yes | Path to iteration directory |
23
23
  | `complexity_hint` | enum | No | `simple` or `complex`. Auto-detect if not provided |
24
+ | `max_clarification_rounds` | number | No | Maximum clarification rounds (default: 5) |
24
25
 
25
26
  ## Methodology Foundation
26
27
 
@@ -32,6 +33,13 @@ Applies ISA-95 Stage 1 (Domain Description) for clarification:
32
33
 
33
34
  > **DO NOT include:** API definitions, DB structures, code snippets, technical terminology. These belong to Feature Designer or System Designer.
34
35
 
36
+ ## Templates Used
37
+
38
+ | Template | Path | Purpose |
39
+ |----------|------|---------|
40
+ | Clarification Questions | `templates/CLARIFICATION-QUESTIONS-TEMPLATE.md` | Round-based questionnaire for user clarification |
41
+ | Clarification Summary | `templates/CLARIFICATION-SUMMARY-TEMPLATE.md` | Final summary document with all Q&A and decisions |
42
+
35
43
  ---
36
44
 
37
45
  # AgentFlow Definition
@@ -47,9 +55,13 @@ Applies ISA-95 Stage 1 (Domain Description) for clarification:
47
55
  - [ ] Requirement document loaded
48
56
  - [ ] System knowledge loaded (if exists)
49
57
  - [ ] Complexity mode determined
58
+ - [ ] Loop variables initialized (`sufficiency_checks_passed`, `round_number`)
50
59
  - [ ] Clarification conducted (appropriate mode)
51
- - [ ] All 4 Sufficiency Checks passed
52
- - [ ] `.clarification-summary.md` created
60
+ - [ ] Multi-round clarification executed until ALL 4 Sufficiency Checks pass
61
+ - [ ] Each round generates `.clarification-questions-round-{N}.md`
62
+ - [ ] Round counter incremented after each iteration
63
+ - [ ] Maximum 5 rounds enforced (safety valve)
64
+ - [ ] `.clarification-summary.md` created from template
53
65
  - [ ] `.checkpoints.json` initialized via script
54
66
 
55
67
  ---
@@ -58,8 +70,13 @@ Applies ISA-95 Stage 1 (Domain Description) for clarification:
58
70
 
59
71
  **Must do:**
60
72
  - Always perform at least 1 clarification round
73
+ - **MANDATORY**: Execute multiple rounds until ALL 4 sufficiency checks pass
61
74
  - Use file-based for complex mode or 4+ questions
62
75
  - Pass all 4 Sufficiency Checks
76
+ - Generate `.clarification-questions-round-{N}.md` for each round
77
+ - Update `sufficiency_checks_passed` variable after each sufficiency check
78
+ - Increment `round_number` after each round
79
+ - Maximum 5 rounds allowed (safety valve)
63
80
  - Use `update-progress.js` for JSON files
64
81
  - After completion, return control to PM Agent for user confirmation — DO NOT auto-proceed to PRD generation
65
82
 
@@ -0,0 +1,49 @@
1
+ # 需求澄清问卷 - Round {round_number}
2
+
3
+ > **Iteration**: {iteration_name}
4
+ > **Date**: {date}
5
+ > **Complexity**: {complexity_level}
6
+
7
+ ## 澄清背景
8
+
9
+ 基于用户需求:"{requirement_summary}",以下问题需要进一步确认。
10
+
11
+ ## 待确认事项
12
+
13
+ ### 🎯 业务范围与边界
14
+
15
+ | # | 问题 | 优先级 | 用户回答 |
16
+ |---|------|--------|---------|
17
+ | 1 | {question} | {priority} | _待回答_ |
18
+
19
+ ### 👥 用户角色与权限
20
+
21
+ | # | 问题 | 优先级 | 用户回答 |
22
+ |---|------|--------|---------|
23
+ | 1 | {question} | {priority} | _待回答_ |
24
+
25
+ ### 🔄 业务规则与流程
26
+
27
+ | # | 问题 | 优先级 | 用户回答 |
28
+ |---|------|--------|---------|
29
+ | 1 | {question} | {priority} | _待回答_ |
30
+
31
+ ### 🔗 集成与依赖
32
+
33
+ | # | 问题 | 优先级 | 用户回答 |
34
+ |---|------|--------|---------|
35
+ | 1 | {question} | {priority} | _待回答_ |
36
+
37
+ ### ⚡ 性能与约束
38
+
39
+ | # | 问题 | 优先级 | 用户回答 |
40
+ |---|------|--------|---------|
41
+ | 1 | {question} | {priority} | _待回答_ |
42
+
43
+ ---
44
+
45
+ ## 填写说明
46
+
47
+ 1. 请在"用户回答"列直接填写您的回答
48
+ 2. 如果某个问题不适用,请填写"N/A"并简要说明原因
49
+ 3. 如需补充信息,可在回答后追加说明
@@ -0,0 +1,52 @@
1
+ # 需求澄清总结
2
+
3
+ > **Iteration**: {iteration_name}
4
+ > **Total Rounds**: {total_rounds}
5
+ > **Date**: {date}
6
+ > **Final Sufficiency**: {sufficiency_result} ({checks_passed}/4)
7
+
8
+ ## 1. 需求概述
9
+
10
+ {requirement_overview}
11
+
12
+ ## 2. 复杂度评估
13
+
14
+ | 维度 | 评估 | 理由 |
15
+ |------|------|------|
16
+ | 业务复杂度 | {business_complexity} | {reason} |
17
+ | 技术复杂度 | {technical_complexity} | {reason} |
18
+ | 集成复杂度 | {integration_complexity} | {reason} |
19
+ | **综合判定** | **{overall_complexity}** | |
20
+
21
+ ## 3. 关键决策记录
22
+
23
+ | # | 决策项 | 决策结果 | 确认轮次 |
24
+ |---|--------|---------|---------|
25
+ | 1 | {decision_item} | {decision_result} | Round {N} |
26
+
27
+ ## 4. 澄清 Q&A 汇总
28
+
29
+ ### Round {N}
30
+
31
+ | # | 问题 | 回答 | 分类 |
32
+ |---|------|------|------|
33
+ | 1 | {question} | {answer} | {category} |
34
+
35
+ ## 5. 充分性检查结果
36
+
37
+ | # | 检查项 | 状态 | 说明 |
38
+ |---|--------|------|------|
39
+ | 1 | 范围边界清晰 | {status} | {detail} |
40
+ | 2 | 关键业务规则已文档化 | {status} | {detail} |
41
+ | 3 | 优先级/分期决策已确定 | {status} | {detail} |
42
+ | 4 | 集成边界已识别 | {status} | {detail} |
43
+
44
+ ## 6. 遗留问题与风险
45
+
46
+ | # | 问题/风险 | 影响 | 建议处理方式 |
47
+ |---|----------|------|------------|
48
+ | 1 | {issue} | {impact} | {suggestion} |
49
+
50
+ ## 7. 下一步建议
51
+
52
+ {next_steps}
@@ -14,6 +14,13 @@
14
14
  <!-- ============================================================
15
15
  Global Constraints
16
16
  ============================================================ -->
17
+ <block type="rule" id="R-MULTIROUND" level="mandatory" desc="Multi-round clarification is MANDATORY">
18
+ <field name="text">MANDATORY: Clarification MUST execute multiple rounds until ALL 4 sufficiency checks pass.</field>
19
+ <field name="text">DO NOT terminate after a single round. Each round generates .clarification-questions-round-{N}.md</field>
20
+ <field name="text">After user answers, perform sufficiency check. If any check fails, generate next round questions.</field>
21
+ <field name="text">Maximum 5 rounds allowed. If max reached, proceed with warning.</field>
22
+ </block>
23
+
17
24
  <block type="rule" id="R1" level="mandatory" desc="Execution constraints">
18
25
  <field name="text">Always perform at least 1 clarification round</field>
19
26
  <field name="text">Use file-based for complex mode or 4+ questions</field>
@@ -69,7 +76,14 @@
69
76
  </branch>
70
77
  </block>
71
78
 
72
- <!-- Step 4: Execute Clarification -->
79
+ <!-- Step 4: Initialize Loop Variables -->
80
+ <block type="task" id="B6-init" action="set-var" desc="Initialize loop control variables">
81
+ <field name="sufficiency_checks_passed" value="false"/>
82
+ <field name="round_number" value="1"/>
83
+ <field name="max_rounds" value="5"/>
84
+ </block>
85
+
86
+ <!-- Step 5: Execute Clarification -->
73
87
  <block type="gateway" id="G2" mode="exclusive" desc="Execute clarification based on mode">
74
88
  <branch test="${complexity} == 'simple'" name="Simple Mode Clarification">
75
89
  <block type="task" id="B6" action="analyze" desc="Simple mode: 1-3 key questions">
@@ -84,19 +98,28 @@
84
98
  </branch>
85
99
  <branch test="${complexity} == 'complex'" name="Complex Mode Clarification">
86
100
  <!-- Clarification Loop -->
87
- <block type="loop" id="L1" condition="sufficiency_checks_passed == false" desc="Clarification rounds until sufficiency">
88
- <block type="task" id="B7" action="generate" desc="Create clarification questions file">
89
- <field name="output_path" value="${iteration_path}/01.product-requirement/.clarification-questions-round-{round}.md"/>
90
- <field name="sections">
91
- - Business Background & Goals
92
- - Target Users & Scenarios
93
- - System Scope & Boundaries
101
+ <block type="loop" id="L1" condition="sufficiency_checks_passed == false AND round_number <= max_rounds" desc="Clarification rounds until sufficiency">
102
+ <!-- Load Question Template -->
103
+ <block type="task" id="B7-load-template" action="read-file" desc="Load clarification questions template">
104
+ <field name="path" value="${skill_path}/templates/CLARIFICATION-QUESTIONS-TEMPLATE.md"/>
105
+ <field name="output" var="questions_template"/>
106
+ </block>
107
+
108
+ <block type="task" id="B7" action="generate" desc="Create clarification questions file from template">
109
+ <field name="template" value="${questions_template}"/>
110
+ <field name="output_path" value="${iteration_path}/01.product-requirement/.clarification-questions-round-${round_number}.md"/>
111
+ <field name="vars">
112
+ - round_number: ${round_number}
113
+ - iteration_name: ${iteration_name}
114
+ - date: ${current_date}
115
+ - complexity_level: ${complexity}
116
+ - requirement_summary: ${requirement_summary}
94
117
  </field>
95
118
  <field name="output" var="questions_file"/>
96
119
  </block>
97
120
 
98
- <block type="event" id="E1" action="confirm" title="Clarification Round {round}" type="wait" desc="Wait for user to answer questions">
99
- <field name="message">Round {round} questions written. Please fill answers and notify me.</field>
121
+ <block type="event" id="E1" action="confirm" title="Clarification Round ${round_number}" type="wait" desc="Wait for user to answer questions">
122
+ <field name="message">Round ${round_number} questions written. Please fill answers and notify me.</field>
100
123
  </block>
101
124
 
102
125
  <block type="task" id="B8" action="read-file" desc="Read answered questions">
@@ -106,6 +129,7 @@
106
129
 
107
130
  <!-- Sufficiency Check -->
108
131
  <block type="task" id="B9" action="analyze" desc="Perform sufficiency check">
132
+ <field name="input" value="${answered_questions}"/>
109
133
  <field name="checks">
110
134
  1. Scope boundaries are clear - Explicit in/out scope defined
111
135
  2. Key business rules are documented - At least 1 rule identified
@@ -114,24 +138,46 @@
114
138
  </field>
115
139
  <field name="output" var="sufficiency_result"/>
116
140
  </block>
141
+
142
+ <!-- Update sufficiency variable based on check result -->
143
+ <block type="task" id="B9-update" action="set-var" desc="Update sufficiency check status">
144
+ <field name="sufficiency_checks_passed" value="${sufficiency_result.all_passed}"/>
145
+ <field name="checks_passed_count" value="${sufficiency_result.passed_count}"/>
146
+ </block>
147
+
148
+ <!-- Increment round number for next iteration -->
149
+ <block type="task" id="B9-increment" action="set-var" desc="Increment round counter">
150
+ <field name="round_number" value="${round_number + 1}"/>
151
+ </block>
117
152
  </block>
118
153
  </branch>
119
154
  </block>
120
155
 
121
- <!-- Step 5: Generate .clarification-summary.md -->
122
- <block type="task" id="B10" action="generate" desc="Generate clarification summary">
156
+ <!-- Step 6: Generate .clarification-summary.md -->
157
+ <block type="task" id="B10-load-template" action="read-file" desc="Load summary template">
158
+ <field name="path" value="${skill_path}/templates/CLARIFICATION-SUMMARY-TEMPLATE.md"/>
159
+ <field name="output" var="summary_template"/>
160
+ </block>
161
+
162
+ <block type="task" id="B10" action="generate" desc="Generate clarification summary from template">
163
+ <field name="template" value="${summary_template}"/>
123
164
  <field name="output_path" value="${iteration_path}/01.product-requirement/.clarification-summary.md"/>
124
- <field name="sections">
125
- - Complexity level and rationale
126
- - Key decisions table
127
- - Clarification Q&A (all rounds)
128
- - Sufficiency checks results
129
- - Notes
165
+ <field name="vars">
166
+ - iteration_name: ${iteration_name}
167
+ - total_rounds: ${round_number - 1}
168
+ - date: ${current_date}
169
+ - sufficiency_result: ${sufficiency_result.all_passed ? 'PASSED' : 'PARTIAL'}
170
+ - checks_passed: ${sufficiency_result.passed_count}
171
+ - requirement_overview: ${requirement_summary}
172
+ - business_complexity: ${complexity}
173
+ - technical_complexity: ${complexity}
174
+ - integration_complexity: ${complexity}
175
+ - overall_complexity: ${complexity}
130
176
  </field>
131
177
  <field name="output" var="summary_path"/>
132
178
  </block>
133
179
 
134
- <!-- Step 6: Initialize .checkpoints.json -->
180
+ <!-- Step 7: Initialize .checkpoints.json -->
135
181
  <block type="task" id="B11" action="run-script" desc="Initialize checkpoints via script">
136
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>
137
183
  <field name="output" var="checkpoint_result"/>
@@ -25,6 +25,11 @@ tools: Read, Write, Glob, Grep, Bash, Agent
25
25
  > - `action="log"` → Output message directly
26
26
  > - `action="confirm"` → Present to user and wait for response
27
27
  >
28
+ > **CRITICAL DISPATCH RULE:**
29
+ > - PM Agent (Team Leader) MUST NOT execute Skills directly
30
+ > - ALL Skill executions MUST go through `dispatch-to-worker` action
31
+ > - Worker Agent (`speccrew-task-worker`) receives the Skill name and context, then executes the Skill
32
+ >
28
33
  > **Step 3**: Execute ALL blocks sequentially without pausing (only stop at explicit `<event action="confirm">` blocks)
29
34
 
30
35
  # Product Manager Orchestration
@@ -34,10 +39,26 @@ Product Manager 的核心编排技能,负责:
34
39
  1. **Pipeline Progress Management** - 创建/定位迭代目录,管理工作流进度
35
40
  2. **Knowledge Base Detection** - 检测知识库状态并按需初始化
36
41
  3. **Complexity Assessment** - 评估需求复杂度,决定简单/复杂路径
37
- 4. **Requirement Clarification** - 调用澄清技能,收集需求细节
38
- 5. **PRD Generation Orchestration** - 协调 PRD 生成(简单路径直接调用,复杂路径分发 Worker
42
+ 4. **Requirement Clarification** - 分发 Worker 执行澄清技能,收集需求细节
43
+ 5. **PRD Generation Orchestration** - 协调 PRD 生成(所有 Skill 通过 Worker 分发执行)
39
44
  6. **Verification & Confirmation** - 验证 PRD 完整性,等待用户确认
40
45
 
46
+ **DISPATCH-TO-WORKER ARCHITECTURE:**
47
+
48
+ PM Agent 作为 Team Leader,不直接执行任何 Skill。所有 Skill 调用都通过 `dispatch-to-worker` 模式:
49
+
50
+ | Phase | Action | Skill | Worker |
51
+ |-------|--------|-------|--------|
52
+ | Phase 1 | `dispatch-to-worker` | `speccrew-pm-knowledge-detector` | `speccrew-task-worker` |
53
+ | Phase 1 | `dispatch-to-worker` | `speccrew-pm-system-summary-reader` | `speccrew-task-worker` |
54
+ | Phase 1 | `dispatch-to-worker` | `speccrew-pm-module-matcher` | `speccrew-task-worker` |
55
+ | Phase 1 | `dispatch-to-worker` | `speccrew-knowledge-bizs-init-features` | `speccrew-task-worker` |
56
+ | Phase 3 | `dispatch-to-worker` | `speccrew-pm-requirement-clarify` | `speccrew-task-worker` |
57
+ | Phase 4a | `dispatch-to-worker` | `speccrew-pm-requirement-model` | `speccrew-task-worker` |
58
+ | Phase 4b | `dispatch-to-worker` | `speccrew-pm-requirement-analysis` | `speccrew-task-worker` |
59
+ | Phase 4 (Simple) | `dispatch-to-worker` | `speccrew-pm-requirement-simple` | `speccrew-task-worker` |
60
+ | Phase 5 | `dispatch-to-worker` | `speccrew-pm-sub-prd-generate` | `speccrew-task-worker` |
61
+
41
62
  ## Invocation Method
42
63
 
43
64
  **CRITICAL**: This skill is loaded directly by Product Manager Agent — do NOT invoke via Worker Agent.
@@ -99,12 +120,18 @@ This agent is an **orchestrator/dispatcher**. Key constraints:
99
120
 
100
121
  | Phase | Skill | ORCHESTRATOR Rule |
101
122
  |-------|-------|-------------------|
102
- | Phase 3 | `speccrew-pm-requirement-clarify` | DO NOT clarify requirements yourself — Skill handles all clarification rounds |
103
- | Phase 4a | `speccrew-pm-requirement-model` | DO NOT perform ISA-95 analysis or module decomposition yourself |
104
- | Phase 4b | `speccrew-pm-requirement-analysis` | DO NOT generate Master PRD or Dispatch Plan yourself |
105
- | Phase 5 | `speccrew-pm-sub-prd-generate` (via workers) | DO NOT generate Sub-PRD content yourself |
123
+ | Phase 3 | `speccrew-pm-requirement-clarify` | DO NOT clarify requirements yourself — Dispatch Worker to execute |
124
+ | Phase 4a | `speccrew-pm-requirement-model` | DO NOT perform ISA-95 analysis yourself Dispatch Worker to execute |
125
+ | Phase 4a.5 | User Confirmation Gate | MUST stop for user confirmation after module design |
126
+ | Phase 4b | `speccrew-pm-requirement-analysis` | DO NOT generate Master PRD yourself — Dispatch Worker to execute |
127
+ | Phase 5 | `speccrew-pm-sub-prd-generate` | DO NOT generate Sub-PRD yourself — Dispatch Workers to execute |
106
128
  | Phase 6 | PM Agent verification | DO NOT modify PRD content — only verify and present |
107
129
 
130
+ **UNIVERSAL DISPATCH RULE:**
131
+ - PM Agent NEVER invokes Skills directly via `action="run-skill"`
132
+ - ALL Skill invocations use `action="dispatch-to-worker"` with `speccrew-task-worker`
133
+ - Worker Agent receives the Skill name in context and executes it
134
+
108
135
  **UNIVERSAL ABORT RULE:**
109
136
  - IF ANY skill fails → STOP and report to user
110
137
  - DO NOT generate content as fallback
@@ -221,14 +221,16 @@
221
221
  <field name="text">IF clarification skill fails: ABORT - do NOT generate clarification yourself</field>
222
222
  </block>
223
223
 
224
- <!-- Phase 3.1-3.2: Prepare Parameters & Invoke Skill -->
225
- <block type="task" id="P3-B1" action="run-skill" status="pending" desc="Invoke clarification skill">
224
+ <!-- Phase 3.1-3.2: Prepare Parameters & Dispatch Worker -->
225
+ <block type="task" id="P3-B1" action="dispatch-to-worker" status="pending" desc="Dispatch requirement clarification worker">
226
+ <field name="agent">speccrew-task-worker</field>
226
227
  <field name="skill">speccrew-pm-requirement-clarify</field>
227
228
  <field name="context">
228
229
  requirement_file: ${user_requirement}
229
230
  iteration_path: ${iteration_path}
230
231
  complexity_hint: ${complexity}
231
232
  knowledge_status: ${knowledge_status.status}
233
+ language: ${language}
232
234
  </field>
233
235
  <field name="output" var="clarification_result"/>
234
236
  </block>
@@ -279,11 +281,13 @@
279
281
 
280
282
  <!-- Path A: Simple Requirements -->
281
283
  <branch test="${complexity} == 'simple'" name="Simple Path">
282
- <block type="task" id="P4-B1" action="run-skill" status="pending" desc="Invoke simple PRD skill">
284
+ <block type="task" id="P4-B1" action="dispatch-to-worker" status="pending" desc="Dispatch simple PRD worker">
285
+ <field name="agent">speccrew-task-worker</field>
283
286
  <field name="skill">speccrew-pm-requirement-simple</field>
284
287
  <field name="context">
285
288
  iteration_path: ${iteration_path}
286
289
  clarification_file: ${iteration_path}/01.product-requirement/.clarification-summary.md
290
+ language: ${language}
287
291
  </field>
288
292
  <field name="output" var="prd_output"/>
289
293
  </block>
@@ -302,11 +306,13 @@
302
306
  <branch test="${complexity} == 'complex'" name="Complex Path">
303
307
 
304
308
  <!-- Phase 4a: Module Modeling -->
305
- <block type="task" id="P4-B3" action="run-skill" status="pending" desc="Invoke requirement modeling skill">
309
+ <block type="task" id="P4-B3" action="dispatch-to-worker" status="pending" desc="Dispatch requirement modeling worker">
310
+ <field name="agent">speccrew-task-worker</field>
306
311
  <field name="skill">speccrew-pm-requirement-model</field>
307
312
  <field name="context">
308
313
  iteration_path: ${iteration_path}
309
314
  clarification_file: ${iteration_path}/01.product-requirement/.clarification-summary.md
315
+ language: ${language}
310
316
  </field>
311
317
  <field name="output" var="model_output"/>
312
318
  </block>
@@ -326,13 +332,30 @@
326
332
  <branch default="true" name="Model Passed"/>
327
333
  </block>
328
334
 
335
+ <!-- Phase 4a.5: User Confirmation Gate for Module Design -->
336
+ <block type="checkpoint" id="P4-CP1" name="requirement_modeling" desc="User confirmation gate for module design">
337
+ <field name="required" value="true"/>
338
+ </block>
339
+
340
+ <block type="event" id="P4-E1-CONFIRM" action="confirm" desc="Present module design for user confirmation">
341
+ <field name="prompt">📋 ISA-95 Module Design Complete. Please review .module-design.md before proceeding to PRD generation.</field>
342
+ <field name="template">module-design-summary</field>
343
+ <field name="data" value="${model_output}"/>
344
+ </block>
345
+
346
+ <block type="task" id="P4-B4-CHK" action="run-script" status="pending" desc="Update modeling confirmation checkpoint">
347
+ <field name="command">node ${update_progress_script} write-checkpoint --file ${iteration_path}/01.product-requirement/.checkpoints.json --stage 01_prd --checkpoint requirement_modeling_confirmed --passed true</field>
348
+ </block>
349
+
329
350
  <!-- Phase 4b: Master PRD Generation -->
330
- <block type="task" id="P4-B5" action="run-skill" status="pending" desc="Invoke requirement analysis skill">
351
+ <block type="task" id="P4-B5" action="dispatch-to-worker" status="pending" desc="Dispatch requirement analysis worker">
352
+ <field name="agent">speccrew-task-worker</field>
331
353
  <field name="skill">speccrew-pm-requirement-analysis</field>
332
354
  <field name="context">
333
355
  iteration_path: ${iteration_path}
334
356
  clarification_file: ${iteration_path}/01.product-requirement/.clarification-summary.md
335
357
  module_design_file: ${iteration_path}/01.product-requirement/.module-design.md
358
+ language: ${language}
336
359
  </field>
337
360
  <field name="output" var="prd_output"/>
338
361
  </block>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speccrew",
3
- "version": "0.7.15",
3
+ "version": "0.7.16",
4
4
  "description": "Spec-Driven Development toolkit for AI-powered IDEs",
5
5
  "author": "charlesmu99",
6
6
  "repository": {