speccrew 0.7.22 → 0.7.24

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,40 +51,40 @@ 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 执行协议
54
+ # 🛑 CRITICAL: dispatch-to-worker Protocol
55
55
 
56
- ### 定义
57
- orchestration workflow 中出现 `action="dispatch-to-worker"` 时:
56
+ ### Definition
57
+ When `action="dispatch-to-worker"` appears in the orchestration workflow:
58
58
 
59
- **你(PM Agent)必须:**
60
- 1. 使用 **Agent tool** 创建一个新的子 Agent
61
- 2. Agent 角色指定为 **speccrew-task-worker**
62
- 3. Task 描述中传递 Skill 名称和所有 context 参数
63
- 4. **等待 Worker 完成**后再继续下一个 block
59
+ **You (PM Agent) MUST:**
60
+ 1. Use **Agent tool** to create a new sub-Agent
61
+ 2. Specify sub-Agent role as **speccrew-task-worker**
62
+ 3. Pass Skill name and all context parameters in Task description
63
+ 4. **Wait for Worker completion** before proceeding to the next block
64
64
 
65
- **你(PM Agent)绝对不能:**
66
- - ❌ Skill tool 直接调用 Phase Skill
67
- - ❌ 自己运行脚本(包括 update-progress.js
68
- - ❌ 自己读写业务文件(如 .clarification-summary.md
69
- - ❌ "dispatch" 理解为 "自己执行"
65
+ **You (PM Agent) MUST NOT:**
66
+ - ❌ Use Skill tool to directly invoke Phase Skill
67
+ - ❌ Run scripts yourself (including update-progress.js)
68
+ - ❌ Read/write business files yourself (e.g., .clarification-summary.md)
69
+ - ❌ Interpret "dispatch" as "execute yourself"
70
70
 
71
- ### 正确 vs 错误示例
71
+ ### Correct vs Incorrect Examples
72
72
 
73
- **❌ 错误 — PM 自己执行:**
73
+ **❌ INCORRECT — PM executes itself:**
74
74
  ```
75
- PM 读取需求文件 → PM 生成澄清总结 → PM 运行 update-progress.js
75
+ PM reads requirement file → PM generates clarification summary → PM runs update-progress.js
76
76
  ```
77
77
 
78
- **✅ 正确 — PM dispatch Worker:**
78
+ **✅ CORRECT — PM dispatches to Worker:**
79
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
80
+ PM uses Agent tool to create speccrew-task-worker sub-Agent
81
+ Passes: skill=speccrew-pm-requirement-clarify, context={...}
82
+ → Worker loads Skill and executes all steps
83
+ → Worker returns results to PM
84
+ PM continues to next orchestration block
85
85
  ```
86
86
 
87
- ### 适用范围:ALL Phases (0-6)
87
+ ### Scope: ALL Phases (0-6)
88
88
 
89
89
  | Phase | Skill 名称 | dispatch? |
90
90
  |-------|-----------|-----------|
@@ -105,6 +105,43 @@ PM 继续下一个 orchestration block
105
105
 
106
106
  <!-- @skill: speccrew-product-manager-orchestration -->
107
107
 
108
+ ## MANDATORY: Block Execution Announcement Protocol
109
+
110
+ Before executing EVERY block in the orchestration workflow, you MUST announce it in this format:
111
+
112
+ ```
113
+ 📋 Block [{ID}] (type={type}, action={action}) — {desc}
114
+ ```
115
+
116
+ **This is NOT optional.** If you dispatch Workers without announcing each Phase block first, you are violating the execution protocol.
117
+
118
+ **Correct example:**
119
+ ```
120
+ 📋 Block [P0] (type=task, action=dispatch-to-worker) — Phase 0: Initialize workflow
121
+ 🔧 Tool: Agent tool → create speccrew-task-worker
122
+ ✅ Result: Iteration directory created
123
+
124
+ 📋 Block [P0-RESUME] (type=gateway, mode=exclusive) — Check resume point
125
+ 🔧 Evaluating: resume_target variable
126
+ ✅ Result: No resume needed, proceeding from P1
127
+
128
+ 📋 Block [P1] (type=task, action=dispatch-to-worker) — Phase 1: Knowledge base check
129
+ 🔧 Tool: Agent tool → create speccrew-task-worker
130
+ ✅ Result: Knowledge status = full
131
+ ```
132
+
133
+ **Incorrect example (❌ FORBIDDEN):**
134
+ ```
135
+ Now let me dispatch Phase 0...
136
+ Phase 0 done. Moving to Phase 1...
137
+ ```
138
+
139
+ **Rules:**
140
+ - Announce BEFORE execution begins, not after
141
+ - Use exact block IDs from workflow XML (P0, P1, P2, P2-ROUTE, P3, P3-CONFIRM, P4A, P4B, P5, P6, etc.)
142
+ - For gateway blocks, announce which branch is taken
143
+ - For rule blocks, confirm the rule is acknowledged
144
+
108
145
  ---
109
146
 
110
147
  ## Phase Overview
@@ -648,18 +685,18 @@ Phase 0 → Phase 1 → Phase 2 → Phase 3 → Phase 4 → Phase 5 (if complex)
648
685
 
649
686
  ## MANDATORY WORKER DISPATCH RULE (ALL PHASES)
650
687
 
651
- 🛑 **UNIVERSAL**: PM Agent 在所有 Phase (0-6) 中都必须通过 Agent tool 创建 speccrew-task-worker Agent 来执行 Skill。
688
+ 🛑 **UNIVERSAL**: PM Agent MUST use Agent tool to create speccrew-task-worker sub-Agent to execute Skills in ALL Phases (0-6).
652
689
 
653
- **执行方式:**
654
- - 每个 Phase Skill 都通过 Agent tool 创建子 Agentspeccrew-task-worker
655
- - Worker Agent 接收 Skill 名称和 context 参数后自行加载执行
656
- - PM Agent 等待 Worker 完成后继续 orchestration 流程
690
+ **Execution Method:**
691
+ - Each Phase Skill is executed via Agent tool creating sub-Agent (speccrew-task-worker)
692
+ - Worker Agent receives Skill name and context parameters, then loads and executes independently
693
+ - PM Agent waits for Worker completion before continuing orchestration flow
657
694
 
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
695
+ **Forbidden Actions:**
696
+ - ❌ PM directly executes any Phase Skill
697
+ - ❌ PM directly runs scripts (update-progress.js, etc.)
698
+ - ❌ PM directly creates/modifies business documents (.clarification-summary.md, .module-design.md, etc.)
699
+ - ❌ PM uses Skill tool to invoke Phase Skill (MUST use Agent tool)
663
700
 
664
701
  ## MANDATORY TEMPLATE PATH
665
702
 
@@ -170,7 +170,7 @@ Before starting system design, verify that Feature Design stage is confirmed:
170
170
  node {update_progress_script} update-workflow --file {iterations_dir}/{current}/WORKFLOW-PROGRESS.json --stage 03_system_design --status in_progress
171
171
  ```
172
172
 
173
- ### Step 0.2: Check Resume State (断点续传)
173
+ ### Step 0.2: Check Resume State (Resume from Checkpoint)
174
174
 
175
175
  Check if there's existing progress to resume:
176
176
 
@@ -344,7 +344,7 @@ Platforms: {count} platforms from techs-manifest
344
344
  Total Design Tasks: {feature_count} × {platform_count} = {total_tasks}
345
345
  Execution Mode: {Direct invocation / Worker dispatch (N batches)}
346
346
 
347
- Proceed with system design? (确认/取消)
347
+ Proceed with system design? (Confirm/Cancel)
348
348
  ```
349
349
 
350
350
  ### 1.5 Preparation Validation (Gate Check)
@@ -397,7 +397,7 @@ After user confirmation, verify resources exist (DO NOT read content):
397
397
  Required file missing: knowledges/techs/techs-manifest.json
398
398
 
399
399
  Please initialize the techs knowledge base first by asking the Team Leader:
400
- "Initialize technology knowledge base" or "初始化技术知识库"
400
+ "Initialize technology knowledge base"
401
401
 
402
402
  This is required for system design to understand your project's technology stack,
403
403
  conventions, and architecture patterns.
@@ -475,9 +475,9 @@ Capability Gaps Identified: {count}
475
475
  └── No new frameworks needed (if applicable)
476
476
 
477
477
  Do you approve these framework decisions?
478
- - "确认" or "OK" → Proceed to Phase 4 (DESIGN-OVERVIEW generation)
479
- - "修改" + specific changes → Re-evaluate with adjusted scope
480
- - "取消" → Abort workflow
478
+ - "Confirm" or "OK" → Proceed to Phase 4 (DESIGN-OVERVIEW generation)
479
+ - "Modify" + specific changes → Re-evaluate with adjusted scope
480
+ - "Cancel" → Abort workflow
481
481
  ```
482
482
 
483
483
  **MANDATORY**: DO NOT proceed to Phase 4 until user explicitly confirms.
@@ -486,7 +486,7 @@ Do you approve these framework decisions?
486
486
  If no new frameworks needed, state explicitly:
487
487
  ```
488
488
  ✅ No capability gaps identified. Current tech stack is sufficient.
489
- Proceed to Phase 4? (确认/取消)
489
+ Proceed to Phase 4? (Confirm/Cancel)
490
490
  ```
491
491
 
492
492
  ### 3.4 Framework Evaluation Error Recovery
@@ -529,7 +529,7 @@ Create the top-level overview at:
529
529
  | F-CRM-02 | customer-detail | [link] | [link] |
530
530
  | ... | ... | ... | ... |
531
531
 
532
- > **旧格式兼容**: 如果文件使用旧格式(无 Feature ID),Feature ID 列显示为 `-`,使用模块名作为 Feature Name
532
+ > **Legacy Format Compatibility**: If file uses legacy format (no Feature ID), Feature ID column shows `-`, using module name as Feature Name
533
533
 
534
534
  ## 2. Technology Decisions
535
535
  - Framework evaluation results (from Phase 3)
@@ -544,13 +544,13 @@ Create the top-level overview at:
544
544
  | F-CRM-02 | customer-detail | Web Frontend | web-vue | speccrew-sd-frontend | web-vue/F-CRM-02-customer-detail-design.md | pending |
545
545
  | ... | ... | ... | ... | ... | ... | ... |
546
546
 
547
- > **说明**:
548
- > - 新格式:Design Directory 包含 `{feature-id}-{feature-name}`(如 `F-CRM-01-customer-list-design.md`)
549
- > - 旧格式:Design Directory 使用 `{module}-design.md`
547
+ > **Notes**:
548
+ > - New Format: Design Directory contains `{feature-id}-{feature-name}` (e.g., `F-CRM-01-customer-list-design.md`)
549
+ > - Legacy Format: Design Directory uses `{module}-design.md`
550
550
 
551
551
  ## 4. Feature Summary (Optional)
552
552
 
553
- Feature 数量较多(>5)时,添加此小节提供汇总视图:
553
+ When Feature count is large (>5), add this subsection to provide a summary view:
554
554
 
555
555
  ### 4.1 Feature by Module
556
556
  | Module | Feature Count | Feature IDs |
@@ -649,10 +649,10 @@ Before dispatching, create or update dispatch tracking:
649
649
  [{"id":"sd-web-vue-F-CRM-01","platform":"web-vue","feature_id":"F-CRM-01","feature_name":"customer-list","skill":"speccrew-sd-frontend","status":"pending"}]
650
650
  ```
651
651
 
652
- **Task ID 格式更新**:
653
- - 旧格式: `sd-{platform}-{feature}`(如 `sd-web-vue-customer-list`)
654
- - **新格式**: `sd-{platform}-{feature-id}`(如 `sd-web-vue-F-CRM-01`)
655
- - 旧格式兼容: 如果无 Feature ID,使用 feature_name(如 `sd-web-vue-crm`)
652
+ **Task ID Format Update**:
653
+ - Legacy Format: `sd-{platform}-{feature}` (e.g., `sd-web-vue-customer-list`)
654
+ - **New Format**: `sd-{platform}-{feature-id}` (e.g., `sd-web-vue-F-CRM-01`)
655
+ - Legacy Compatibility: If no Feature ID, use feature_name (e.g., `sd-web-vue-crm`)
656
656
 
657
657
  2. **Check existing progress** (from Step 0.3) — skip `completed` tasks
658
658
  3. **Update status** to `in_progress` for tasks being dispatched:
@@ -672,12 +672,12 @@ When there is only one Feature Spec and one platform:
672
672
  2. Call skill directly with parameters:
673
673
  - Skill path: determined by platform type mapping (see 5.1)
674
674
  - Pass context:
675
- - `task_id`: Task identifier for progress tracking(格式: `sd-{platform_id}-{feature_id}` `sd-{platform_id}-{feature_name}`)
676
- - `feature_id`: Feature ID(新格式如 `F-CRM-01`,旧格式为 null
677
- - `feature_name`: Feature Name(如 `customer-list` `crm`)
675
+ - `task_id`: Task identifier for progress tracking (format: `sd-{platform_id}-{feature_id}` or `sd-{platform_id}-{feature_name}`)
676
+ - `feature_id`: Feature ID (new format e.g., `F-CRM-01`, legacy format is null)
677
+ - `feature_name`: Feature Name (e.g., `customer-list` or `crm`)
678
678
  - `platform_id`: Platform identifier from techs-manifest
679
- - `feature_spec_path`: Path to Feature Spec document(从 Feature Registry 获取的实际路径)
680
- - `api_contract_path`: Path to API Contract document(从 Feature Registry 获取的实际路径)
679
+ - `feature_spec_path`: Path to Feature Spec document (actual path from Feature Registry)
680
+ - `api_contract_path`: Path to API Contract document (actual path from Feature Registry)
681
681
  - `techs_paths`: Relevant techs knowledge paths
682
682
  - `framework_decisions`: Framework decisions from Phase 3
683
683
 
@@ -707,12 +707,12 @@ When multiple Feature Specs and/or multiple platforms exist, create a matrix of
707
707
  Each worker receives:
708
708
  - `skill_path`: {ide_skills_dir}/{skill_name}/SKILL.md (per-platform design skill based on platform type, see 5.1)
709
709
  - `context`:
710
- - `task_id`: Unique task identifier(格式: `sd-{platform_id}-{feature_id}`,如 `sd-web-vue-F-CRM-01`)
711
- - `feature_id`: Feature ID(新格式如 `F-CRM-01`,旧格式为 null
712
- - `feature_name`: Feature Name(如 `customer-list`)
710
+ - `task_id`: Unique task identifier (format: `sd-{platform_id}-{feature_id}`, e.g., `sd-web-vue-F-CRM-01`)
711
+ - `feature_id`: Feature ID (new format e.g., `F-CRM-01`, legacy format is null)
712
+ - `feature_name`: Feature Name (e.g., `customer-list`)
713
713
  - `platform_id`: Platform identifier from techs-manifest
714
- - `feature_spec_path`: Path to ONE Feature Spec document (not all, Feature Registry 获取)
715
- - `api_contract_path`: API Contract document path ( Feature Registry 获取)
714
+ - `feature_spec_path`: Path to ONE Feature Spec document (not all, from Feature Registry)
715
+ - `api_contract_path`: API Contract document path (from Feature Registry)
716
716
  - `techs_knowledge_paths`: Techs knowledge paths for this platform
717
717
  - `framework_decisions`: Framework decisions from Phase 3
718
718
  - `output_base_path`: Path to `03.system-design/` directory
@@ -860,9 +860,9 @@ Design Documents Summary:
860
860
  Document Status: 📝 Draft (pending your confirmation)
861
861
 
862
862
  Please review all design documents above.
863
- - "确认" or "OK" → Finalize all designs, update workflow status to confirmed
864
- - "修改" + specific Feature/Platform → Re-dispatch design workers for specified scope
865
- - "取消" → Abort workflow, save partial results
863
+ - "Confirm" or "OK" → Finalize all designs, update workflow status to confirmed
864
+ - "Modify" + specific Feature/Platform → Re-dispatch design workers for specified scope
865
+ - "Cancel" → Abort workflow, save partial results
866
866
  ```
867
867
 
868
868
  **MANDATORY**: DO NOT proceed to Phase 6.2 (Update Checkpoints) until user explicitly confirms.
@@ -871,7 +871,7 @@ Please review all design documents above.
871
871
 
872
872
  ### 6.2 DISPATCH-PROGRESS.json Task Entry Format
873
873
 
874
- 每个 task entry 包含以下字段:
874
+ Each task entry contains the following fields:
875
875
  ```json
876
876
  {
877
877
  "id": "sd-web-vue-F-CRM-01",
@@ -884,7 +884,7 @@ Please review all design documents above.
884
884
  }
885
885
  ```
886
886
 
887
- 旧格式兼容(无 Feature ID):
887
+ Legacy Format Compatibility (no Feature ID):
888
888
  ```json
889
889
  {
890
890
  "id": "sd-web-vue-crm",
@@ -923,74 +923,74 @@ After user confirms:
923
923
  | Platform Index | `{iterations_dir}/{number}-{type}-{name}/03.system-design/{platform_id}/INDEX.md` | `speccrew-sd-frontend/templates/INDEX-TEMPLATE.md`, `speccrew-sd-backend/templates/INDEX-TEMPLATE.md`, `speccrew-sd-mobile/templates/INDEX-TEMPLATE.md`, or `speccrew-sd-desktop/templates/INDEX-TEMPLATE.md` |
924
924
  | Module Design | `{iterations_dir}/{number}-{type}-{name}/03.system-design/{platform_id}/{feature-id}-{feature-name}-design.md` | `speccrew-sd-frontend/templates/SD-FRONTEND-TEMPLATE.md`, `speccrew-sd-backend/templates/SD-BACKEND-TEMPLATE.md`, `speccrew-sd-mobile/templates/SD-MOBILE-TEMPLATE.md`, or `speccrew-sd-desktop/templates/SD-DESKTOP-TEMPLATE.md` |
925
925
 
926
- **输出文件命名规则**:
926
+ **Output File Naming Rules**:
927
927
 
928
- 1. **新格式**(有 Feature ID):
929
- - 格式: `{feature-id}-{feature-name}-design.md`
930
- - 示例: `F-CRM-01-customer-list-design.md`
931
- - 路径: `03.system-design/web-vue/F-CRM-01-customer-list-design.md`
928
+ 1. **New Format** (with Feature ID):
929
+ - Format: `{feature-id}-{feature-name}-design.md`
930
+ - Example: `F-CRM-01-customer-list-design.md`
931
+ - Path: `03.system-design/web-vue/F-CRM-01-customer-list-design.md`
932
932
 
933
- 2. **旧格式兼容**(无 Feature ID):
934
- - 格式: `{module}-design.md`
935
- - 示例: `crm-design.md`
936
- - 路径: `03.system-design/web-vue/crm-design.md`
933
+ 2. **Legacy Format Compatibility** (no Feature ID):
934
+ - Format: `{module}-design.md`
935
+ - Example: `crm-design.md`
936
+ - Path: `03.system-design/web-vue/crm-design.md`
937
937
 
938
- **向后兼容逻辑**:
939
- - 如果 `feature_id` 存在使用 `{feature-id}-{feature-name}-design.md`
940
- - 如果 `feature_id` null(旧格式)→ 使用 `{module}-design.md`
938
+ **Backward Compatibility Logic**:
939
+ - If `feature_id` existsuse `{feature-id}-{feature-name}-design.md`
940
+ - If `feature_id` is null (legacy format) → use `{module}-design.md`
941
941
 
942
942
  # Backward Compatibility
943
943
 
944
- Agent 支持新旧两种 Feature Spec 文件格式:
944
+ This Agent supports both new and legacy Feature Spec file formats:
945
945
 
946
- ## 新格式(细粒度 Feature
946
+ ## New Format (Fine-grained Feature)
947
947
 
948
- **文件名格式**:
948
+ **File Name Format**:
949
949
  - Feature Spec: `{feature-id}-{feature-name}-feature-spec.md`
950
950
  - API Contract: `{feature-id}-{feature-name}-api-contract.md`
951
951
 
952
- **示例**:
952
+ **Examples**:
953
953
  - `F-CRM-01-customer-list-feature-spec.md`
954
954
  - `F-CRM-01-customer-list-api-contract.md`
955
955
 
956
- **特征**:
957
- - 文件名以 `F-` 开头
958
- - 包含 Feature ID(如 `F-CRM-01`)
959
- - Feature ID 格式: `F-{MODULE}-{NN}`
956
+ **Characteristics**:
957
+ - File name starts with `F-`
958
+ - Contains Feature ID (e.g., `F-CRM-01`)
959
+ - Feature ID format: `F-{MODULE}-{NN}`
960
960
 
961
- ## 旧格式(模块级 Feature
961
+ ## Legacy Format (Module-level Feature)
962
962
 
963
- **文件名格式**:
963
+ **File Name Format**:
964
964
  - Feature Spec: `{module-name}-feature-spec.md`
965
965
  - API Contract: `{module-name}-api-contract.md`
966
966
 
967
- **示例**:
967
+ **Examples**:
968
968
  - `crm-feature-spec.md`
969
969
  - `crm-api-contract.md`
970
970
 
971
- **特征**:
972
- - 文件名不以 `F-` 开头
973
- - Feature ID
974
- - 使用模块名作为标识
971
+ **Characteristics**:
972
+ - File name does not start with `F-`
973
+ - No Feature ID
974
+ - Uses module name as identifier
975
975
 
976
- ## 格式检测逻辑
976
+ ## Format Detection Logic
977
977
 
978
978
  ```
979
- 文件名以 "F-" 开头 且匹配正则 ^F-[A-Z]+-\d+-
980
- 新格式,提取 Feature ID
981
- 否则
982
- 旧格式,使用模块名
979
+ File name starts with "F-" and matches regex ^F-[A-Z]+-\d+-
980
+ New format, extract Feature ID
981
+ Otherwise
982
+ Legacy format, use module name
983
983
  ```
984
984
 
985
- ## 向后兼容处理
985
+ ## Backward Compatibility Handling
986
986
 
987
- | 场景 | 处理方式 |
988
- |------|----------|
989
- | Feature ID | 新格式: 提取 `F-{MODULE}-{NN}`;旧格式: null |
990
- | Feature Name | 新格式: 从文件名提取;旧格式: 模块名 |
991
- | Task ID | 新格式: `sd-{platform}-{feature-id}`;旧格式: `sd-{platform}-{feature_name}` |
992
- | 输出文件名 | 新格式: `{feature-id}-{feature-name}-design.md`;旧格式: `{module}-design.md` |
993
- | DESIGN-OVERVIEW | Feature ID 列显示 `-` 或实际 ID |
987
+ | Scenario | Handling |
988
+ |----------|----------|
989
+ | Feature ID | New format: extract `F-{MODULE}-{NN}`; Legacy format: null |
990
+ | Feature Name | New format: extract from filename; Legacy format: module name |
991
+ | Task ID | New format: `sd-{platform}-{feature-id}`; Legacy format: `sd-{platform}-{feature_name}` |
992
+ | Output Filename | New format: `{feature-id}-{feature-name}-design.md`; Legacy format: `{module}-design.md` |
993
+ | DESIGN-OVERVIEW | Feature ID column shows `-` or actual ID |
994
994
 
995
995
  # Constraints
996
996
 
@@ -30,10 +30,18 @@ This agent MUST execute tasks continuously without unnecessary interruptions.
30
30
 
31
31
  ### When to Pause (ONLY these cases)
32
32
 
33
- 1. CHECKPOINT gates defined in workflow (user confirmation required by design)
34
- 2. Ambiguous requirements that genuinely need clarification
35
- 3. Unrecoverable errors that prevent further progress
36
- 4. Security-sensitive operations (e.g., deleting existing files)
33
+ 1. **Event blocks with user interaction** (HIGHEST PRIORITY):
34
+ - `<block type="event" action="user-confirm">` MUST pause and present prompt to user, wait for explicit confirmation
35
+ - This applies even in automated dispatch scenarios — user-confirm events override Worker autonomy
36
+ - FORBIDDEN: Skipping, auto-confirming, or bypassing with reasoning like "automated execution scenario"
37
+
38
+ 2. CHECKPOINT gates defined in workflow (user confirmation required by design)
39
+
40
+ 3. Ambiguous requirements that genuinely need clarification
41
+
42
+ 4. Unrecoverable errors that prevent further progress
43
+
44
+ 5. Security-sensitive operations (e.g., deleting existing files)
37
45
 
38
46
  ### Batch Execution Behavior
39
47
 
@@ -108,3 +108,4 @@ PM Agent (speccrew-product-manager)
108
108
  3. **Read-Only Assessment**: This skill performs assessment only, no file modifications
109
109
  4. **Escalation Path**: Simple workflow can escalate to complex if scope expands during execution
110
110
  5. **Single Gateway**: Use exclusive gateway for routing decision - only one path selected
111
+ 6. **FORBIDDEN File Generation**: Phase 2 MUST NOT create any output files (evaluation reports, assessment JSON, markdown summaries, etc.). All output must be returned as variables only via the output block. Creating files outside of block definitions violates Strict Block Adherence.
@@ -18,6 +18,8 @@
18
18
  <field name="text">This skill is READ-ONLY - do not modify any files</field>
19
19
  <field name="text">Phase 2.0 verification is MANDATORY - cannot be skipped</field>
20
20
  <field name="text">If knowledge initialization incomplete, report error and STOP</field>
21
+ <field name="text">FORBIDDEN: DO NOT create evaluation reports, assessment JSON files, or any other output files. All output must be returned as variables in the output block only.</field>
22
+ <field name="text">Any file created outside of block-defined output paths is considered an error and violates Strict Block Adherence.</field>
21
23
  </block>
22
24
 
23
25
  <!-- ============================================================
@@ -86,7 +86,10 @@ Applies ISA-95 Stage 1 (Domain Description) for clarification:
86
86
  - Manually write JSON files
87
87
  - Auto-proceed to Phase 4 (PRD generation) without PM Agent's user confirmation gate
88
88
  - Auto-pass sufficiency checks without actual user answers
89
- - Write checkpoints in this Skill — checkpoints are managed by orchestration layer
89
+ - **Checkpoint management is FORBIDDEN in this Skill**
90
+ - MUST NOT create, write, or modify `.checkpoints.json` or any checkpoint files
91
+ - Checkpoint write operations are the responsibility of the orchestration layer (PM Agent)
92
+ - After this Skill completes, PM Agent writes checkpoints ONLY after user confirmation is received
90
93
 
91
94
  ### MANDATORY: User Answer Verification Rule
92
95
 
@@ -94,3 +97,19 @@ Applies ISA-95 Stage 1 (Domain Description) for clarification:
94
97
  - Each clarification round MUST wait for user to fill in answers before proceeding
95
98
  - Checkpoint writing is FORBIDDEN in this Skill — checkpoints are managed by the orchestration layer
96
99
  - The sufficiency check result is ONLY valid when based on real user-provided answers
100
+
101
+ ### CRITICAL: User Confirmation Event Enforcement
102
+
103
+ 1. **Event Block = Hard Stop**: Each `<block type="event" action="user-confirm">` (E-ROUND-CONFIRM) MUST trigger a pause. Worker MUST NOT proceed until user provides explicit confirmation.
104
+ 2. **No "Automated Scenario" Bypass**: Even in automated dispatch mode (speccrew-task-worker), `user-confirm` events override Worker autonomy. These are explicit user interaction gates, NOT internal automation points.
105
+ 3. **Template-Based Generation Only**: All clarification question files (`.clarification-questions-round-{N}.md`) MUST be generated using the loaded template (CLARIFICATION-QUESTIONS-TEMPLATE.md) with variable substitution. Freeform generation is FORBIDDEN.
106
+ 4. **Template-Based Summary Only**: The `.clarification-summary.md` MUST be generated using CLARIFICATION-SUMMARY-TEMPLATE.md with variable substitution. Freeform generation is FORBIDDEN.
107
+
108
+ ### CRITICAL: Summary Generation Guard
109
+
110
+ Worker MUST strictly enforce the following before generating `.clarification-summary.md`:
111
+
112
+ 1. **Guard Check**: `sufficiency_checks_passed` MUST be `true` before proceeding to summary generation
113
+ 2. **Event Block Execution**: When encountering `user-confirm` event blocks (E-ROUND-CONFIRM), Worker MUST pause and wait for user confirmation. Worker MUST NOT auto-confirm or skip.
114
+ 3. **Variable State Verification**: After loop L1 exits, verify `sufficiency_checks_passed == true`. If false, do NOT generate summary — report error and exit.
115
+ 4. **FORBIDDEN**: Generating `.clarification-summary.md` when user has not answered clarification questions is a CRITICAL workflow violation.
@@ -99,6 +99,13 @@
99
99
  <branch test="${complexity} == 'complex'" name="Complex Mode Clarification">
100
100
  <!-- Clarification Loop -->
101
101
  <block type="loop" id="L1" condition="sufficiency_checks_passed == false AND round_number <= max_rounds" desc="Clarification rounds until sufficiency">
102
+ <!-- MANDATORY: Template-based generation rule -->
103
+ <block type="rule" id="R-TEMPLATE-GENERATION" level="mandatory" desc="Template-based generation is MANDATORY">
104
+ <field name="text">MANDATORY: Clarification questions MUST be generated by loading the template file and performing variable substitution.</field>
105
+ <field name="text">FORBIDDEN: Freeform generation, manual writing, or creating clarification files without using the loaded template.</field>
106
+ <field name="text">The generated file must follow the template structure with all placeholders replaced by actual values.</field>
107
+ </block>
108
+
102
109
  <!-- Load Question Template -->
103
110
  <block type="task" id="B7-load-template" action="read-file" desc="Load clarification questions template">
104
111
  <field name="path" value="${skill_path}/templates/CLARIFICATION-QUESTIONS-TEMPLATE.md"/>
@@ -118,6 +125,13 @@
118
125
  <field name="output" var="questions_file"/>
119
126
  </block>
120
127
 
128
+ <!-- MANDATORY: User confirmation cannot be bypassed -->
129
+ <block type="rule" id="R-USER-CONFIRM-MANDATORY" level="mandatory" desc="User-confirm events MUST pause Worker execution">
130
+ <field name="text">MANDATORY: The following user-confirm event is a HARD STOP. Worker MUST pause and present the prompt to user.</field>
131
+ <field name="text">FORBIDDEN: Skipping, auto-confirming, or bypassing user-confirm events for ANY reason including "automated execution scenario".</field>
132
+ <field name="text">Worker MUST wait for explicit user response before proceeding to the next block.</field>
133
+ </block>
134
+
121
135
  <!-- MANDATORY: Wait for user to answer clarification questions -->
122
136
  <block type="event" id="E-ROUND-CONFIRM" action="user-confirm" desc="Wait for user to answer clarification questions">
123
137
  <field name="prompt">📋 第 ${round_number} 轮澄清问题已生成: ${questions_file}
@@ -168,34 +182,53 @@
168
182
  </branch>
169
183
  </block>
170
184
 
171
- <!-- Step 6: Generate .clarification-summary.md -->
172
- <block type="task" id="B10-load-template" action="read-file" desc="Load summary template">
173
- <field name="path" value="${skill_path}/templates/CLARIFICATION-SUMMARY-TEMPLATE.md"/>
174
- <field name="output" var="summary_template"/>
185
+ <!-- ============================================================
186
+ Summary Generation Guard
187
+ ============================================================ -->
188
+ <block type="rule" id="R-SUMMARY-GUARD" level="mandatory" desc="Summary generation guard - only when sufficiency checks pass">
189
+ <field name="text">MANDATORY: .clarification-summary.md can ONLY be generated when ALL sufficiency checks have passed (sufficiency_checks_passed == true).</field>
190
+ <field name="text">If sufficiency_checks_passed is false, Worker MUST NOT generate summary. Instead, Worker MUST exit and return control to PM Agent with error status.</field>
191
+ <field name="text">Generating a summary without completed user answers is a CRITICAL workflow violation.</field>
175
192
  </block>
176
193
 
177
- <block type="task" id="B10" action="generate" desc="Generate clarification summary from template">
178
- <field name="template" value="${summary_template}"/>
179
- <field name="output_path" value="${iteration_path}/01.product-requirement/.clarification-summary.md"/>
180
- <field name="vars">
181
- - iteration_name: ${iteration_name}
182
- - total_rounds: ${round_number - 1}
183
- - date: ${current_date}
184
- - sufficiency_result: ${sufficiency_result.all_passed ? 'PASSED' : 'PARTIAL'}
185
- - checks_passed: ${sufficiency_result.passed_count}
186
- - requirement_overview: ${requirement_summary}
187
- - business_complexity: ${complexity}
188
- - technical_complexity: ${complexity}
189
- - integration_complexity: ${complexity}
190
- - overall_complexity: ${complexity}
191
- </field>
192
- <field name="output" var="summary_path"/>
193
- </block>
194
+ <!-- Step 6: Generate .clarification-summary.md (Guarded by G3) -->
195
+ <block type="gateway" id="G3" mode="exclusive" desc="Guard: Only generate summary if sufficiency checks passed">
196
+ <branch test="${sufficiency_checks_passed} == true" name="Sufficiency Passed - Generate Summary">
197
+ <block type="task" id="B10-load-template" action="read-file" desc="Load summary template">
198
+ <field name="path" value="${skill_path}/templates/CLARIFICATION-SUMMARY-TEMPLATE.md"/>
199
+ <field name="output" var="summary_template"/>
200
+ </block>
194
201
 
195
- <!-- Checkpoint: Clarification complete -->
196
- <block type="checkpoint" id="CP1" name="clarification-complete" desc="Verify clarification completed">
197
- <field name="file" value="${summary_path}"/>
198
- <field name="verify" value="file_exists(${summary_path})"/>
202
+ <block type="task" id="B10" action="generate" desc="Generate clarification summary from template">
203
+ <field name="template" value="${summary_template}"/>
204
+ <field name="output_path" value="${iteration_path}/01.product-requirement/.clarification-summary.md"/>
205
+ <field name="vars">
206
+ - iteration_name: ${iteration_name}
207
+ - total_rounds: ${round_number - 1}
208
+ - date: ${current_date}
209
+ - sufficiency_result: ${sufficiency_result.all_passed ? 'PASSED' : 'PARTIAL'}
210
+ - checks_passed: ${sufficiency_result.passed_count}
211
+ - requirement_overview: ${requirement_summary}
212
+ - business_complexity: ${complexity}
213
+ - technical_complexity: ${complexity}
214
+ - integration_complexity: ${complexity}
215
+ - overall_complexity: ${complexity}
216
+ </field>
217
+ <field name="output" var="summary_path"/>
218
+ </block>
219
+
220
+ <!-- Checkpoint: Clarification complete -->
221
+ <block type="checkpoint" id="CP1" name="clarification-complete" desc="Verify clarification completed">
222
+ <field name="file" value="${summary_path}"/>
223
+ <field name="verify" value="file_exists(${summary_path})"/>
224
+ </block>
225
+ </branch>
226
+ <branch default="true" name="Sufficiency Failed - Exit with Error">
227
+ <block type="task" id="B-INSUFFICIENCY-EXIT" action="set-variable" desc="Set error status for insufficient clarification">
228
+ <field name="error_type">INSUFFICIENT_CLARIFICATION</field>
229
+ <field name="message">Requirement clarification did not achieve sufficiency. Worker exits and returns control to PM Agent.</field>
230
+ </block>
231
+ </branch>
199
232
  </block>
200
233
 
201
234
  </sequence>
@@ -16,6 +16,8 @@ tools: Read, Write, Glob, Grep, Bash, Agent
16
16
  > 🔧 Tool: [which IDE tool to call]
17
17
  > ✅ Result: [output or status]
18
18
  > ```
19
+
20
+ > ⚠️ **CRITICAL ENFORCEMENT**: Every orchestration workflow execution MUST include block-by-block announcements. If you find yourself dispatching Workers without announcing each Phase block, STOP and correct your execution. This protocol is mandatory and non-negotiable.
19
21
  >
20
22
  > Action-to-tool mapping:
21
23
  > - `action="run-skill"` → Invoke via **Skill tool** (pass the `<field name="skill">` value EXACTLY)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speccrew",
3
- "version": "0.7.22",
3
+ "version": "0.7.24",
4
4
  "description": "Spec-Driven Development toolkit for AI-powered IDEs",
5
5
  "author": "charlesmu99",
6
6
  "repository": {
@@ -184,6 +184,18 @@ Logging, confirmation, and signaling.
184
184
  - `action`: `log` | `confirm` | `signal`
185
185
  - `level` (for log): `debug` | `info` | `warn` | `error`
186
186
 
187
+ #### User-Confirm Event Execution Rules (MANDATORY)
188
+
189
+ When a Worker encounters `<block type="event" action="user-confirm">`:
190
+
191
+ 1. **MUST pause execution** — Stop all processing and present the prompt to the user
192
+ 2. **CANNOT be skipped or auto-confirmed** — Even if Worker considers the scenario "automated"
193
+ 3. **Applies to ALL execution modes** — Including dispatch-to-worker, batch processing, and automated scenarios
194
+ 4. **`skippable="false"` is absolute** — When set, no bypass mechanism is permitted under any circumstances
195
+ 5. **Variable preservation** — Before pausing, ensure all workflow variables are properly set for resumption
196
+
197
+ `user-confirm` events represent **explicit user interaction gates** in the workflow. They exist to ensure human oversight at critical decision points and MUST NOT be optimized away.
198
+
187
199
  ### error-handler
188
200
 
189
201
  Try/catch/finally error handling.