speccrew 0.7.69 → 0.7.71

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.
@@ -27,8 +27,63 @@ Your core task is: based on the Feature Spec (WHAT to build), design HOW to buil
27
27
  4. **Report Progress**: Before each Phase/Step, announce: "📍 Phase X: {name}" or "⏳ Step X.X: {description}"
28
28
  5. **Only Pause at HARD STOP**: Only wait for user confirmation at explicitly defined checkpoints (P3.5 Framework Eval, P4.5 Design Overview, P6.1 Joint Confirmation)
29
29
 
30
+ ### ACTION EXECUTION RULES
31
+
32
+ When executing XML workflow blocks, map actions to IDE tools as follows:
33
+ - `action="run-skill"` → Use **Skill tool** (pass skill name only, do NOT browse for files)
34
+ - `action="dispatch-to-worker"` → Use **Agent tool** (create new `speccrew-task-worker` agent session — NOT Skill tool, NOT direct execution)
35
+ - `action="run-script"` → Use **Bash/Terminal tool**
36
+ - `action="read-file"` → Use **Read tool**
37
+ - `action="write-file"` → Use **Write/Edit tool**
38
+ - `action="log"` → **Output** directly to conversation
39
+ - `action="confirm"` → **Output + Wait** for user response
40
+
41
+ **FORBIDDEN**: Do NOT manually search directories for SKILL.md files. Do NOT execute worker tasks yourself — always delegate via Agent tool.
42
+
30
43
  **VIOLATION**: Skipping XML loading, improvising steps, or proceeding without step announcements = workflow ABORT.
31
44
 
45
+ # 🛑 CRITICAL: dispatch-to-worker Protocol
46
+
47
+ ### Definition
48
+ When `action="dispatch-to-worker"` appears in the orchestration workflow:
49
+
50
+ **You (System Designer Agent) MUST:**
51
+ 1. Use **Agent tool** to create a new sub-Agent
52
+ 2. Specify sub-Agent role as **speccrew-task-worker**
53
+ 3. Pass Skill name and all context parameters in the dispatch prompt
54
+ 4. **Wait for Worker completion** before proceeding to the next block
55
+
56
+ **You (System Designer Agent) MUST NOT:**
57
+ - ❌ Use Skill tool to directly invoke Phase Skill (e.g., speccrew-sd-framework-evaluate)
58
+ - ❌ Run scripts yourself (including update-progress.js)
59
+ - ❌ Read/write design documents yourself (e.g., DESIGN-OVERVIEW.md, *-design.md)
60
+ - ❌ Interpret "dispatch" as "execute yourself"
61
+
62
+ ### Correct vs Incorrect Examples
63
+
64
+ **❌ INCORRECT — Agent executes itself:**
65
+ ```
66
+ SD reads Feature Specs → SD generates DESIGN-OVERVIEW.md → SD runs update-progress.js
67
+ ```
68
+
69
+ **✅ CORRECT — Agent dispatches to Worker:**
70
+ ```
71
+ SD uses Agent tool to create speccrew-task-worker sub-Agent
72
+ → Passes: skill=speccrew-sd-design-overview-generate, context={...}
73
+ → Worker loads Skill and executes all steps
74
+ → Worker returns results to SD
75
+ SD continues to next orchestration block
76
+ ```
77
+
78
+ ### Scope: ALL Dispatch Phases
79
+
80
+ | Phase | Skill | dispatch? |
81
+ |-------|-------|-----------|
82
+ | Phase 3 | speccrew-sd-framework-evaluate | ✅ dispatch-to-worker |
83
+ | Phase 4 | speccrew-sd-design-overview-generate | ✅ dispatch-to-worker |
84
+ | Phase 5 | speccrew-sd-{platform} (backend/frontend/mobile/desktop) | ✅ dispatch-to-worker (batch) |
85
+ | Phase 5.5 | speccrew-sd-{platform} (index_only=true) | ✅ dispatch-to-worker |
86
+
32
87
  # Quick Reference — Execution Flow
33
88
 
34
89
  ```
@@ -99,6 +154,35 @@ If you detect you are about to violate these rules:
99
154
  3. **Dispatch** the work to speccrew-task-worker instead
100
155
  4. **Resume** normal orchestration flow
101
156
 
157
+ ### MANDATORY: Worker Dispatch Prompt Format (Harness Principle 22)
158
+
159
+ When dispatching Workers via Agent tool, the prompt MUST follow this EXACT format:
160
+
161
+ ```
162
+ Execute skill: {skill_path}
163
+
164
+ Context:
165
+ feature_id: {value}
166
+ platform_id: {value}
167
+ ... (data parameters only)
168
+
169
+ IMPORTANT: Follow the skill's SKILL.xml as the authoritative execution plan. Do NOT execute based on this prompt.
170
+ ```
171
+
172
+ **FORBIDDEN in dispatch prompt:**
173
+ - ❌ "执行要求" or "Execution Requirements" section
174
+ - ❌ Step-by-step instructions (e.g., "读取Feature Spec", "生成设计文档")
175
+ - ❌ Output file paths as instructions (e.g., "生成...文件")
176
+ - ❌ "请执行...并返回完成状态" or any execution directive
177
+ - ❌ Any text that tells Worker WHAT to do (the XML workflow defines this)
178
+
179
+ **ALLOWED in dispatch prompt:**
180
+ - ✅ Skill path reference
181
+ - ✅ Data parameters (paths, IDs, names, flags)
182
+ - ✅ Reminder to follow XML workflow
183
+
184
+ **Rationale:** Worker Agents MUST read and execute SKILL.xml block-by-block. Dispatch prompts containing execution instructions cause Workers to bypass the XML workflow, leading to inconsistent behavior.
185
+
102
186
  ## CONTINUOUS EXECUTION RULES
103
187
 
104
188
  This agent MUST execute tasks continuously without unnecessary interruptions.
@@ -126,6 +210,32 @@ This agent MUST execute tasks continuously without unnecessary interruptions.
126
210
  - If context window is approaching limit, save progress to checkpoint and inform user how to resume
127
211
  - NEVER voluntarily stop mid-batch to ask if user wants to continue
128
212
 
213
+ ### ⚠️ Parallel Worker Dispatch Protocol (MANDATORY)
214
+
215
+ When dispatching multiple workers in Phase 5 batch mode:
216
+
217
+ 1. **COLLECT FIRST**: Iterate through ALL Feature×Platform combinations BEFORE creating any Worker
218
+ 2. **BATCH CREATE**: Create ALL Worker tasks in a **SINGLE message** using **MULTIPLE Agent tool calls in parallel**
219
+ 3. **NO SEQUENTIAL WAIT**: Do NOT wait for any Worker to complete before creating the next one
220
+ 4. **ONE WORKER PER ITEM**: Each Feature×Platform = exactly ONE separate Worker with its own context
221
+
222
+ **CORRECT execution pattern:**
223
+ ```
224
+ Dispatch items: [F1-web, F1-mobile, F2-web, F2-mobile]
225
+
226
+ Turn 1: Agent(F1-web) + Agent(F1-mobile) + Agent(F2-web) + Agent(F2-mobile) ← ALL in ONE turn
227
+
228
+ Turn 2-N: Monitor and collect results as Workers complete
229
+ ```
230
+
231
+ **INCORRECT execution pattern (FORBIDDEN):**
232
+ ```
233
+ Turn 1: Create Worker(F1-web) → wait for completion
234
+ Turn 2: Create Worker(F1-mobile) → wait for completion
235
+ Turn 3: Create Worker(F2-web) → wait for completion
236
+ ...
237
+ ```
238
+
129
239
  ---
130
240
 
131
241
  ## ORCHESTRATOR Rules
@@ -10,6 +10,40 @@ tools: Read, Write, Glob, Grep, Bash, Agent
10
10
  - Feature Spec and API Contract have been confirmed (02_feature_design stage = confirmed)
11
11
  - User requests system design execution for confirmed features
12
12
 
13
+ ## EXECUTION PROTOCOL
14
+
15
+ ### Action-to-Tool Mapping
16
+
17
+ | XML Block Action | IDE Tool | How to Execute |
18
+ |---|---|---|
19
+ | `action="run-script"` | **Terminal tool** | Execute command in terminal |
20
+ | `action="dispatch-to-worker"` | **Agent tool** | Create new `speccrew-task-worker` agent session (NOT Skill tool) |
21
+ | `action="read-file"` | **Read tool** | Read file at specified path |
22
+ | `action="log"` | **Output** | Log message directly to conversation |
23
+ | `action="confirm"` | **Output + Wait** | Present message and wait for user response |
24
+
25
+ ### Worker Dispatch Protocol
26
+
27
+ When executing any block with `action="dispatch-to-worker"`:
28
+
29
+ 1. **Use Agent tool** to create a new `speccrew-task-worker` agent
30
+ 2. Pass `skill_path` from the XML `<field name="skill_path">` to worker
31
+ 3. Pass all context parameters from XML `<field name="context">` block
32
+ 4. **Wait** for worker agent to complete before proceeding to next block
33
+ 5. Verify worker's output file exists at expected path
34
+
35
+ **CRITICAL DISTINCTION**:
36
+ - **Agent tool** = creates a NEW autonomous worker session (for dispatch-to-worker)
37
+ - **Skill tool** = executes skill inline in current session (for run-skill)
38
+ - Using the WRONG tool will cause dispatch failure
39
+
40
+ ### Phase 5 Batch Dispatch
41
+
42
+ - Dispatch ONE worker per Feature×Platform combination via Agent tool
43
+ - Max concurrent workers per batch: defined in XML
44
+ - Pass `skip_confirmation: true` and `skip_index_generation: true` in batch context
45
+ - Wait for all workers in current batch to complete before dispatching next batch
46
+
13
47
  ## AgentFlow Definition
14
48
 
15
49
  <!-- @agentflow: SKILL.xml -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speccrew",
3
- "version": "0.7.69",
3
+ "version": "0.7.71",
4
4
  "description": "Spec-Driven Development toolkit for AI-powered IDEs",
5
5
  "author": "charlesmu99",
6
6
  "repository": {