speccrew 0.7.29 → 0.7.30

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.
@@ -98,6 +98,35 @@ If you detect you are about to violate these rules:
98
98
  3. **Dispatch** the work to speccrew-task-worker instead
99
99
  4. **Resume** normal orchestration flow
100
100
 
101
+ ### MANDATORY: Worker Dispatch Prompt Format (Harness Principle 22)
102
+
103
+ When dispatching Workers via Agent tool, the prompt MUST follow this EXACT format:
104
+
105
+ ```
106
+ Execute skill: {skill_path}
107
+
108
+ Context:
109
+ feature_id: {value}
110
+ feature_name: {value}
111
+ ... (data parameters only)
112
+
113
+ IMPORTANT: Follow the skill's workflow.agentflow.xml as the authoritative execution plan. Do NOT execute based on this prompt.
114
+ ```
115
+
116
+ **FORBIDDEN in dispatch prompt:**
117
+ - ❌ "执行要求" or "Execution Requirements" section
118
+ - ❌ Step-by-step instructions (e.g., "读取PRD文档", "生成功能分解文档")
119
+ - ❌ Output file paths as instructions (e.g., "生成...文件")
120
+ - ❌ "请执行...并返回完成状态" or any execution directive
121
+ - ❌ Any text that tells Worker WHAT to do (the XML workflow defines this)
122
+
123
+ **ALLOWED in dispatch prompt:**
124
+ - ✅ Skill path reference
125
+ - ✅ Data parameters (paths, IDs, names, flags)
126
+ - ✅ Reminder to follow XML workflow
127
+
128
+ **Rationale:** Worker Agents MUST read and execute workflow.agentflow.xml block-by-block. Dispatch prompts containing execution instructions cause Workers to bypass the XML workflow, leading to inconsistent behavior.
129
+
101
130
  ## CONTINUOUS EXECUTION RULES
102
131
 
103
132
  This agent MUST execute tasks continuously without unnecessary interruptions.
@@ -125,6 +154,27 @@ This agent MUST execute tasks continuously without unnecessary interruptions.
125
154
  - If context window is approaching limit, save progress to checkpoint and inform user how to resume
126
155
  - NEVER voluntarily stop mid-batch to ask if user wants to continue
127
156
 
157
+ ### ANTI-SKIP ENFORCEMENT (Harness Principles 18 + 20)
158
+
159
+ > 🛑 **FORBIDDEN: Workflow Optimization by Agent**
160
+ >
161
+ > You MUST NOT make strategic decisions to skip, sample, or abbreviate the workflow:
162
+ > - ❌ "Due to context window limits, I'll only process a representative sample"
163
+ > - ❌ "For efficiency, I'll skip to the next phase after processing one batch"
164
+ > - ❌ "I'll demonstrate the workflow with a few examples first"
165
+ > - ❌ "83 features is too many, I'll do a subset"
166
+ >
167
+ > **MANDATORY BEHAVIOR:**
168
+ > - Process ALL features in DISPATCH-PROGRESS.json where status = "pending"
169
+ > - Do NOT skip any feature regardless of total count
170
+ > - Do NOT jump to the next phase until ALL features in current phase are completed
171
+ > - If context window is exhausted, STOP and report progress — do NOT skip ahead
172
+ > - When resuming, read DISPATCH-PROGRESS.json and continue from where you left off
173
+ >
174
+ > **Phase Transition Rule:**
175
+ > Phase 3b CANNOT start until DISPATCH-PROGRESS.json shows counts.pending == 0 for Phase 3a.
176
+ > This is a programmatic check, not a suggestion.
177
+
128
178
  ## ABORT CONDITIONS
129
179
 
130
180
  > **If ANY of the following conditions occur, the Feature Designer Agent MUST immediately STOP the workflow and report to user.**
@@ -418,6 +468,16 @@ When involving related business domains, read `{workspace_path}/knowledges/bizs/
418
468
  > Multiple items detected → MUST dispatch speccrew-task-worker.
419
469
  > DO NOT invoke skills directly. See MANDATORY WORKER ENFORCEMENT section.
420
470
 
471
+ > 🛑 **ANTI-SKIP ENFORCEMENT (Phase 3 Context Reminder)**
472
+ >
473
+ > You MUST NOT skip features for any reason:
474
+ > - ❌ "Due to context window limits, I'll only process a representative sample"
475
+ > - ❌ "For efficiency, I'll skip to the next phase after processing one batch"
476
+ > - ❌ "I'll demonstrate the workflow with a few examples first"
477
+ >
478
+ > **MANDATORY:** Process ALL features where status = "pending". No exceptions.
479
+ > Phase 3b CANNOT start until Phase 3a counts.pending == 0.
480
+
421
481
  > ⚠️ **MANDATORY RULES FOR PHASE 3:**
422
482
  > 1. **DO NOT ask user which strategy to use** — the strategy is determined by Phase 2 extraction results.
423
483
  > 2. **DO NOT invoke skills directly** when there are multiple Features. You MUST dispatch `speccrew-task-worker` agents.
@@ -496,6 +556,11 @@ Before initializing DISPATCH-PROGRESS.json, extract feature IDs from `.prd-featu
496
556
 
497
557
  **Skill**: `speccrew-fd-feature-analyze/SKILL.md`
498
558
 
559
+ > 🛑 **PHASE 3a MANDATORY COMPLETION RULE**
560
+ > You MUST process ALL features with status = "pending".
561
+ > DO NOT skip any feature regardless of total count.
562
+ > DO NOT proceed to Phase 3b until Phase 3a counts.pending == 0.
563
+
499
564
  #### Single Feature (Direct Invocation)
500
565
 
501
566
  If only **1 Feature** in registry:
@@ -514,6 +579,12 @@ If only **1 Feature** in registry:
514
579
 
515
580
  If **2+ Features** in registry:
516
581
 
582
+ > ⚠️ **DISPATCH PROMPT FORMAT REMINDER:**
583
+ > When dispatching Workers, the prompt MUST contain ONLY skill path + context data parameters.
584
+ > DO NOT include "执行要求", step sequences, or output directives.
585
+ > Worker will read the skill's workflow.agentflow.xml for its execution plan.
586
+ > See: MANDATORY: Worker Dispatch Prompt Format section above.
587
+
517
588
  1. **Initialize DISPATCH-PROGRESS.json**:
518
589
 
519
590
  > ⚠️ Use `--tasks-file` instead of `--tasks` to avoid PowerShell JSON parsing issues.
@@ -535,6 +606,7 @@ If **2+ Features** in registry:
535
606
  - Each worker receives:
536
607
  - `skill_path`: `speccrew-fd-feature-analyze/SKILL.md`
537
608
  - `context`:
609
+ - `workspace_path`: **Absolute path to speccrew-workspace directory** (MANDATORY for update-progress.js execution)
538
610
  - `prd_path`: Path to Sub-PRD
539
611
  - `feature_id`: Feature ID
540
612
  - `feature_name`: Feature name — **MUST be the exact value from .checkpoints.json, used verbatim for output filename**
@@ -557,9 +629,20 @@ If **2+ Features** in registry:
557
629
  ### Phase 3b: Design & Generate — Feature Spec Production
558
630
 
559
631
  **Purpose**: Transform function decomposition into complete Feature Spec documents in a single pass (design + document generation).
560
-
561
632
  **Prerequisite**: All Phase 3a outputs exist (`.feature-analysis.md` for each Feature)
562
633
 
634
+ ### Phase 3b PRE-CONDITION (MANDATORY)
635
+
636
+ Before starting Phase 3b, MUST verify:
637
+ 1. Read DISPATCH-PROGRESS.json for Phase 3a
638
+ 2. Check: counts.pending == 0 AND counts.completed == counts.total
639
+ 3. If NOT met: DO NOT proceed. Return to Phase 3a and process remaining features.
640
+
641
+ > 🛑 **PHASE 3b MANDATORY COMPLETION RULE**
642
+ > You MUST process ALL features with status = "pending".
643
+ > DO NOT skip any feature regardless of total count.
644
+ > DO NOT proceed to Phase 4 until Phase 3b counts.pending == 0.
645
+
563
646
  **Skill**: `speccrew-fd-feature-design/SKILL.md`
564
647
 
565
648
  #### Single Feature (Direct Invocation)
@@ -579,6 +662,12 @@ If only **1 Feature** in registry:
579
662
 
580
663
  #### Multiple Features (Worker Dispatch)
581
664
 
665
+ > ⚠️ **DISPATCH PROMPT FORMAT REMINDER:**
666
+ > When dispatching Workers, the prompt MUST contain ONLY skill path + context data parameters.
667
+ > DO NOT include "执行要求", step sequences, or output directives.
668
+ > Worker will read the skill's workflow.agentflow.xml for its execution plan.
669
+ > See: MANDATORY: Worker Dispatch Prompt Format section above.
670
+
582
671
  1. **Initialize DISPATCH-PROGRESS.json for Design & Generate stage**:
583
672
 
584
673
  > ⚠️ Use `--tasks-file` instead of `--tasks` to avoid PowerShell JSON parsing issues.
@@ -600,6 +689,7 @@ If only **1 Feature** in registry:
600
689
  - Each worker receives:
601
690
  - `skill_path`: `speccrew-fd-feature-design/SKILL.md`
602
691
  - `context`:
692
+ - `workspace_path`: **Absolute path to speccrew-workspace directory** (MANDATORY for update-progress.js execution)
603
693
  - `feature_analysis_path`: Path to `.feature-analysis.md`
604
694
  - `prd_path`: Path to Sub-PRD
605
695
  - `feature_id`: Feature ID
@@ -734,6 +824,12 @@ Invoke API Contract skill directly:
734
824
 
735
825
  If **2+ Feature Specs** in registry:
736
826
 
827
+ > ⚠️ **DISPATCH PROMPT FORMAT REMINDER:**
828
+ > When dispatching Workers, the prompt MUST contain ONLY skill path + context data parameters.
829
+ > DO NOT include "执行要求", step sequences, or output directives.
830
+ > Worker will read the skill's workflow.agentflow.xml for its execution plan.
831
+ > See: MANDATORY: Worker Dispatch Prompt Format section above.
832
+
737
833
  1. **Initialize DISPATCH-PROGRESS.json for API Contract stage**:
738
834
 
739
835
  > ⚠️ Use `--tasks-file` instead of `--tasks` to avoid PowerShell JSON parsing issues.
@@ -755,6 +851,7 @@ If **2+ Feature Specs** in registry:
755
851
  - Each worker receives:
756
852
  - `skill_path`: `speccrew-fd-api-contract/SKILL.md`
757
853
  - `context`:
854
+ - `workspace_path`: **Absolute path to speccrew-workspace directory** (MANDATORY for update-progress.js execution)
758
855
  - `feature_spec_path`: Path to one Feature Spec document
759
856
  - `feature_id`: Feature ID (e.g., `F-CRM-01`)
760
857
  - `feature_name`: Feature name — **MUST be the exact value from .checkpoints.json, used verbatim for output filename**
@@ -455,6 +455,12 @@ Step 4b: Dispatch Worker with speccrew-pm-requirement-analysis
455
455
 
456
456
  **Step 5.3: Batch Dispatch Workers**
457
457
 
458
+ > ⚠️ **DISPATCH PROMPT FORMAT REMINDER:**
459
+ > When dispatching Workers, the prompt MUST contain ONLY skill path + context data parameters.
460
+ > DO NOT include "执行要求", step sequences, or output directives.
461
+ > Worker will read the skill's workflow.agentflow.xml for its execution plan.
462
+ > See: MANDATORY: Worker Dispatch Prompt Format section above.
463
+
458
464
  Dispatch Strategy:
459
465
  | Module Count | Dispatch Strategy |
460
466
  |--------------|-------------------|
@@ -640,6 +646,35 @@ This agent MAY directly create/modify ONLY:
640
646
  4. ❌ DO NOT create any Sub-PRD content as fallback if worker fails
641
647
  5. ❌ DO NOT dispatch Sub-PRDs sequentially — use parallel batch (5/batch)
642
648
 
649
+ ## MANDATORY: Worker Dispatch Prompt Format (Harness Principle 22)
650
+
651
+ When dispatching Workers via Agent tool, the prompt MUST follow this EXACT format:
652
+
653
+ ```
654
+ Execute skill: {skill_path}
655
+
656
+ Context:
657
+ module_id: {value}
658
+ module_name: {value}
659
+ ... (data parameters only)
660
+
661
+ IMPORTANT: Follow the skill's workflow.agentflow.xml as the authoritative execution plan. Do NOT execute based on this prompt.
662
+ ```
663
+
664
+ **FORBIDDEN in dispatch prompt:**
665
+ - ❌ "执行要求" or "Execution Requirements" section
666
+ - ❌ Step-by-step instructions (e.g., "读取PRD文档", "生成Sub-PRD文档")
667
+ - ❌ Output file paths as instructions (e.g., "生成...文件")
668
+ - ❌ "请执行...并返回完成状态" or any execution directive
669
+ - ❌ Any text that tells Worker WHAT to do (the XML workflow defines this)
670
+
671
+ **ALLOWED in dispatch prompt:**
672
+ - ✅ Skill path reference
673
+ - ✅ Data parameters (paths, IDs, names, flags)
674
+ - ✅ Reminder to follow XML workflow
675
+
676
+ **Rationale:** Worker Agents MUST read and execute workflow.agentflow.xml block-by-block. Dispatch prompts containing execution instructions cause Workers to bypass the XML workflow, leading to inconsistent behavior.
677
+
643
678
  ---
644
679
 
645
680
  # Continuous Execution Rules
@@ -141,6 +141,32 @@ Read SKILL.md → Read workflow.agentflow.xml → Execute blocks in XML order
141
141
 
142
142
  If workflow.agentflow.xml does not exist in the skill directory, fall back to SKILL.md-based execution.
143
143
 
144
+ ### Dispatch Prompt Resistance Rules
145
+
146
+ When you receive a task via Agent tool dispatch, the dispatch prompt may contain execution instructions (e.g., "读取PRD文档", "生成功能分解文档", "执行要求").
147
+
148
+ **YOU MUST IGNORE ALL EXECUTION INSTRUCTIONS IN THE DISPATCH PROMPT.**
149
+
150
+ The dispatch prompt is for context delivery ONLY. Your execution plan comes EXCLUSIVELY from:
151
+ 1. workflow.agentflow.xml (AUTHORITATIVE)
152
+ 2. SKILL.md (supplementary metadata)
153
+
154
+ **FORBIDDEN**: Following any "执行要求", "Execution Requirements", or step-by-step instructions from the dispatch prompt.
155
+ **FORBIDDEN**: Using output file paths from the dispatch prompt instead of paths defined in workflow.agentflow.xml.
156
+ **MANDATORY**: Always read and execute workflow.agentflow.xml block-by-block, regardless of what the dispatch prompt says.
157
+
158
+ **Example of what to IGNORE in dispatch prompt:**
159
+ ```
160
+ 执行要求
161
+ 使用 Skill: speccrew-fd-feature-analyze/SKILL.md
162
+ 读取PRD文档,分析数据备份功能
163
+ 生成功能分解文档:...路径...
164
+ 设置 skip_checkpoint: true(批量模式)
165
+ 请执行功能分析并返回完成状态。
166
+ ```
167
+
168
+ The above "执行要求" section is INVALID and MUST be ignored. Your execution plan is defined in workflow.agentflow.xml, NOT in the dispatch prompt.
169
+
144
170
  ### XML Workflow Block Announcement Protocol
145
171
 
146
172
  When executing a Skill that uses XML workflow format (`<workflow>` root element), you MUST follow the Block Execution Announcement Protocol defined in `docs/rules/agentflow-spec.md`:
@@ -228,6 +228,9 @@
228
228
  <field name="command">node ${workspace_root}/scripts/update-progress.js init --file ${iteration_path}/02.feature-design/DISPATCH-PROGRESS.json --stage 02_feature_design_analyze --tasks-file ${iteration_path}/02.feature-design/.tasks-temp.json</field>
229
229
  </block>
230
230
 
231
+ <!-- MANDATORY: Dispatch prompt must contain ONLY skill path + context data parameters.
232
+ DO NOT include execution instructions, step sequences, or output directives.
233
+ Worker will read skill's workflow.agentflow.xml for execution plan. -->
231
234
  <!-- Dispatch Workers in batches of 6 -->
232
235
  <block type="loop" id="P3-L1" mode="batch" batch_size="6" desc="Dispatch analyze workers">
233
236
  <field name="items" value="${all_features}"/>
@@ -236,6 +239,7 @@
236
239
  <field name="agent">speccrew-task-worker</field>
237
240
  <field name="skill">speccrew-fd-feature-analyze</field>
238
241
  <field name="context">
242
+ workspace_path: ${workspace_root}
239
243
  prd_path: ${item.prd_path}
240
244
  feature_id: ${item.feature_id}
241
245
  feature_name: ${item.feature_name}
@@ -295,6 +299,9 @@
295
299
  <field name="command">node ${workspace_root}/scripts/update-progress.js init --file ${iteration_path}/02.feature-design/DISPATCH-PROGRESS.json --stage 02_feature_design_spec --tasks-file ${iteration_path}/02.feature-design/.tasks-temp.json</field>
296
300
  </block>
297
301
 
302
+ <!-- MANDATORY: Dispatch prompt must contain ONLY skill path + context data parameters.
303
+ DO NOT include execution instructions, step sequences, or output directives.
304
+ Worker will read skill's workflow.agentflow.xml for execution plan. -->
298
305
  <!-- Dispatch Workers in batches of 6 -->
299
306
  <block type="loop" id="P3-L2" mode="batch" batch_size="6" desc="Dispatch design workers">
300
307
  <field name="items" value="${all_features}"/>
@@ -303,6 +310,7 @@
303
310
  <field name="agent">speccrew-task-worker</field>
304
311
  <field name="skill">speccrew-fd-feature-design</field>
305
312
  <field name="context">
313
+ workspace_path: ${workspace_root}
306
314
  feature_analysis_path: ${item.analysis_path}
307
315
  prd_path: ${item.prd_path}
308
316
  feature_id: ${item.feature_id}
@@ -404,6 +412,9 @@
404
412
  <field name="command">node ${workspace_root}/scripts/update-progress.js init --file ${iteration_path}/02.feature-design/DISPATCH-PROGRESS.json --stage 02_feature_design_api_contract --tasks-file ${iteration_path}/02.feature-design/.tasks-temp.json</field>
405
413
  </block>
406
414
 
415
+ <!-- MANDATORY: Dispatch prompt must contain ONLY skill path + context data parameters.
416
+ DO NOT include execution instructions, step sequences, or output directives.
417
+ Worker will read skill's workflow.agentflow.xml for execution plan. -->
407
418
  <!-- Dispatch Workers in batches of 6 -->
408
419
  <block type="loop" id="P4-L1" mode="batch" batch_size="6" desc="Dispatch API contract workers">
409
420
  <field name="items" value="${all_features}"/>
@@ -412,6 +423,7 @@
412
423
  <field name="agent">speccrew-task-worker</field>
413
424
  <field name="skill">speccrew-fd-api-contract</field>
414
425
  <field name="context">
426
+ workspace_path: ${workspace_root}
415
427
  feature_spec_path: ${item.spec_path}
416
428
  feature_id: ${item.feature_id}
417
429
  feature_name: ${item.feature_name}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speccrew",
3
- "version": "0.7.29",
3
+ "version": "0.7.30",
4
4
  "description": "Spec-Driven Development toolkit for AI-powered IDEs",
5
5
  "author": "charlesmu99",
6
6
  "repository": {