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.
- package/.speccrew/agents/speccrew-product-manager.md +70 -33
- package/.speccrew/agents/speccrew-system-designer.md +71 -71
- package/.speccrew/agents/speccrew-task-worker.md +12 -4
- package/.speccrew/skills/speccrew-pm-phase2-complexity-assess/SKILL.md +1 -0
- package/.speccrew/skills/speccrew-pm-phase2-complexity-assess/workflow.agentflow.xml +2 -0
- package/.speccrew/skills/speccrew-pm-requirement-clarify/SKILL.md +20 -1
- package/.speccrew/skills/speccrew-pm-requirement-clarify/workflow.agentflow.xml +58 -25
- package/.speccrew/skills/speccrew-product-manager-orchestration/SKILL.md +2 -0
- package/package.json +1 -1
- package/workspace-template/docs/rules/agentflow-spec.md +12 -0
|
@@ -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
|
-
|
|
56
|
+
### Definition
|
|
57
|
+
When `action="dispatch-to-worker"` appears in the orchestration workflow:
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
1.
|
|
61
|
-
2.
|
|
62
|
-
3.
|
|
63
|
-
4.
|
|
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
|
-
|
|
66
|
-
- ❌
|
|
67
|
-
- ❌
|
|
68
|
-
- ❌
|
|
69
|
-
- ❌
|
|
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
|
-
###
|
|
71
|
+
### Correct vs Incorrect Examples
|
|
72
72
|
|
|
73
|
-
**❌
|
|
73
|
+
**❌ INCORRECT — PM executes itself:**
|
|
74
74
|
```
|
|
75
|
-
PM
|
|
75
|
+
PM reads requirement file → PM generates clarification summary → PM runs update-progress.js
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
**✅
|
|
78
|
+
**✅ CORRECT — PM dispatches to Worker:**
|
|
79
79
|
```
|
|
80
|
-
PM
|
|
81
|
-
→
|
|
82
|
-
→ Worker
|
|
83
|
-
→ Worker
|
|
84
|
-
PM
|
|
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
|
-
###
|
|
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
|
|
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
|
-
-
|
|
655
|
-
- Worker Agent
|
|
656
|
-
- PM Agent
|
|
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
|
|
660
|
-
- ❌ PM
|
|
661
|
-
- ❌ PM
|
|
662
|
-
- ❌ PM
|
|
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"
|
|
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
|
-
- "
|
|
479
|
-
- "
|
|
480
|
-
- "
|
|
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
|
-
>
|
|
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
|
-
> -
|
|
549
|
-
> -
|
|
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
|
-
|
|
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
|
-
-
|
|
654
|
-
-
|
|
655
|
-
-
|
|
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
|
|
676
|
-
- `feature_id`: Feature ID
|
|
677
|
-
- `feature_name`: Feature Name
|
|
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
|
|
680
|
-
- `api_contract_path`: Path to API Contract document
|
|
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
|
|
711
|
-
- `feature_id`: Feature ID
|
|
712
|
-
- `feature_name`: Feature Name
|
|
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,
|
|
715
|
-
- `api_contract_path`: API Contract document path (
|
|
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
|
-
- "
|
|
864
|
-
- "
|
|
865
|
-
- "
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
929
|
-
-
|
|
930
|
-
-
|
|
931
|
-
-
|
|
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.
|
|
934
|
-
-
|
|
935
|
-
-
|
|
936
|
-
-
|
|
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
|
-
-
|
|
940
|
-
-
|
|
938
|
+
**Backward Compatibility Logic**:
|
|
939
|
+
- If `feature_id` exists → use `{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
|
-
|
|
944
|
+
This Agent supports both new and legacy Feature Spec file formats:
|
|
945
945
|
|
|
946
|
-
##
|
|
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
|
-
-
|
|
958
|
-
-
|
|
959
|
-
- Feature ID
|
|
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
|
-
##
|
|
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
|
-
-
|
|
973
|
-
-
|
|
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
|
-
|
|
980
|
-
→
|
|
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 |
|
|
990
|
-
| Feature Name |
|
|
991
|
-
| Task ID |
|
|
992
|
-
|
|
|
993
|
-
| DESIGN-OVERVIEW | Feature 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.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
-
|
|
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
|
-
<!--
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
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
|
-
|
|
178
|
-
|
|
179
|
-
<
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
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
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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
|
@@ -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.
|