speccrew 0.7.64 → 0.7.65
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.
|
@@ -13,6 +13,18 @@ You are in the **third stage** of the complete engineering closed loop:
|
|
|
13
13
|
|
|
14
14
|
Your core task is: based on the Feature Spec (WHAT to build), design HOW to build it using the current technology stack, per platform.
|
|
15
15
|
|
|
16
|
+
## EXECUTION PROTOCOL
|
|
17
|
+
|
|
18
|
+
**Agent MUST follow this protocol when starting any skill execution:**
|
|
19
|
+
|
|
20
|
+
1. **Load XML First**: Before any business logic, read the skill's SKILL.xml file content completely
|
|
21
|
+
2. **Announce Workflow**: Log the workflow phases/steps overview from XML structure
|
|
22
|
+
3. **Execute Blocks Sequentially**: Follow SKILL.xml block order strictly — do NOT improvise or skip blocks
|
|
23
|
+
4. **Report Progress**: Before each Phase/Step, announce: "📍 Phase X: {name}" or "⏳ Step X.X: {description}"
|
|
24
|
+
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)
|
|
25
|
+
|
|
26
|
+
**VIOLATION**: Skipping XML loading, improvising steps, or proceeding without step announcements = workflow ABORT.
|
|
27
|
+
|
|
16
28
|
# Quick Reference — Execution Flow
|
|
17
29
|
|
|
18
30
|
```
|
|
@@ -1,209 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: speccrew-system-designer-orchestration
|
|
3
|
-
|
|
4
|
-
description: System Designer 的核心编排技能,负责读取已确认的 Feature Spec 和 API Contract 文档,加载技术知识库,评估框架需求,调度各平台详细设计技能生成系统设计文档。支持 web、mobile、desktop 平台。
|
|
3
|
+
description: System Designer orchestration skill. Manages the complete system design workflow from stage gate checking through platform dispatch to joint confirmation. Coordinates framework evaluation, design overview generation, and parallel platform-specific design tasks across web, mobile, desktop platforms.
|
|
5
4
|
tools: Read, Write, Glob, Grep, Bash, Agent
|
|
6
5
|
---
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
>
|
|
10
|
-
> **Step 1**: Load XML workflow specification: `speccrew-workspace/docs/rules/agentflow-spec.md` — this defines all block types and action-to-tool mappings
|
|
11
|
-
>
|
|
12
|
-
> **Step 2**: Execute this SKILL.md's XML workflow **block by block in document order**. For EVERY block, you MUST follow this 3-step cycle:
|
|
13
|
-
>
|
|
14
|
-
> ```
|
|
15
|
-
> 📋 Block [ID] (action=[action]) — [desc]
|
|
16
|
-
> 🔧 Tool: [which IDE tool to call]
|
|
17
|
-
> ✅ Result: [output or status]
|
|
18
|
-
> ```
|
|
19
|
-
>
|
|
20
|
-
> Action-to-tool mapping:
|
|
21
|
-
> - `action="run-skill"` → Invoke via **Skill tool** (pass the `<field name="skill">` value EXACTLY)
|
|
22
|
-
> - `action="run-script"` → Execute via **Terminal tool** (pass the `<field name="command">` value EXACTLY)
|
|
23
|
-
> - `action="dispatch-to-worker"` → Use **Agent tool** to create a new `speccrew-task-worker` agent, passing skill_path and context
|
|
24
|
-
> - `action="read-file"` → Read via **Read tool**
|
|
25
|
-
> - `action="log"` → Output message directly
|
|
26
|
-
> - `action="confirm"` → Present to user and wait for response
|
|
27
|
-
>
|
|
28
|
-
> **Step 3**: Execute ALL blocks sequentially without pausing (only stop at explicit `<event action="confirm">` blocks)
|
|
7
|
+
# Trigger Scenarios
|
|
29
8
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
1. **Stage Gate** - 验证 Feature Design 阶段已确认
|
|
35
|
-
2. **Preparation** - 加载 Feature Registry,验证文件存在性
|
|
36
|
-
3. **Resource Verification** - 验证技术知识库可用性
|
|
37
|
-
4. **Framework Evaluation** - 派发单个 worker agent 执行框架评估技能,等待 worker 完成并验证 framework-evaluation.md 生成后进入下一阶段(HARD STOP 等待用户确认)
|
|
38
|
-
5. **Design Overview** - 派发 worker agent 执行 speccrew-sd-design-overview-generate 技能生成 DESIGN-OVERVIEW.md,等待 worker 完成并验证输出
|
|
39
|
-
6. **Platform Dispatch** - 分发各平台设计任务给 Worker
|
|
40
|
-
7. **Joint Confirmation** - 联合确认所有设计文档
|
|
41
|
-
|
|
42
|
-
## Invocation Method
|
|
43
|
-
|
|
44
|
-
**CRITICAL**: This skill is loaded directly by System Designer Agent — do NOT invoke via Worker Agent.
|
|
45
|
-
|
|
46
|
-
```xml
|
|
47
|
-
<block type="task" action="run-skill" desc="System Designer orchestration workflow">
|
|
48
|
-
<field name="skill">speccrew-system-designer-orchestration</field>
|
|
49
|
-
</block>
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Input Parameters
|
|
53
|
-
|
|
54
|
-
| Parameter | Type | Required | Description |
|
|
55
|
-
|-----------|------|----------|-------------|
|
|
56
|
-
| `workspace_path` | string | Yes | speccrew-workspace root directory path |
|
|
57
|
-
| `iterations_dir` | string | Yes | iterations directory path |
|
|
58
|
-
| `update_progress_script` | string | Yes | Path to update-progress.js script |
|
|
59
|
-
| `current_iteration` | string | No | Current active iteration identifier |
|
|
60
|
-
|
|
61
|
-
## Output
|
|
62
|
-
|
|
63
|
-
- `status` - Execution status (success / partial / failed)
|
|
64
|
-
- `output_files` - List of generated design documents
|
|
65
|
-
- `summary` - Execution summary
|
|
66
|
-
- `next_steps` - Suggested next actions
|
|
67
|
-
|
|
68
|
-
---
|
|
9
|
+
- System Designer Agent starts system design workflow
|
|
10
|
+
- Feature Spec and API Contract have been confirmed (02_feature_design stage = confirmed)
|
|
11
|
+
- User requests system design execution for confirmed features
|
|
69
12
|
|
|
70
13
|
## AgentFlow Definition
|
|
71
14
|
|
|
72
15
|
<!-- @agentflow: SKILL.xml -->
|
|
73
16
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
## CONTINUOUS EXECUTION RULES
|
|
77
|
-
|
|
78
|
-
This skill MUST execute tasks continuously without unnecessary interruptions.
|
|
79
|
-
|
|
80
|
-
### FORBIDDEN Interruptions
|
|
81
|
-
|
|
82
|
-
1. DO NOT ask user "Should I continue?" after completing a subtask
|
|
83
|
-
2. DO NOT suggest "Let me split this into batches" or "Let's do this in parts"
|
|
84
|
-
3. DO NOT pause to list what you plan to do next — just do it
|
|
85
|
-
4. DO NOT ask for confirmation before generating output files
|
|
86
|
-
5. DO NOT warn about "large number of files" — proceed with generation
|
|
87
|
-
6. DO NOT offer "Should I proceed with the remaining items?"
|
|
88
|
-
|
|
89
|
-
### When to Pause (ONLY these cases)
|
|
90
|
-
|
|
91
|
-
1. CHECKPOINT gates defined in workflow (user confirmation required by design)
|
|
92
|
-
2. Ambiguous requirements that genuinely need clarification
|
|
93
|
-
3. Unrecoverable errors that prevent further progress
|
|
94
|
-
4. Security-sensitive operations (e.g., deleting existing files)
|
|
95
|
-
|
|
96
|
-
### Phase 3 Execution Method — Worker Agent Dispatch
|
|
97
|
-
|
|
98
|
-
**HOW TO DISPATCH**: When executing Phase 3 block P3-B1 (action="dispatch-to-worker"):
|
|
99
|
-
1. Use the **Agent tool** to create a new `speccrew-task-worker` agent
|
|
100
|
-
2. Pass `skill_path` to the worker: `${workspace_path}/.speccrew/skills/speccrew-sd-framework-evaluate/SKILL.md`
|
|
101
|
-
3. Pass context parameters: workspace_path, iteration_path, feature_spec_paths, api_contract_paths, techs_knowledge_paths, output_path
|
|
102
|
-
4. **Wait** for the worker agent to complete and return results
|
|
103
|
-
5. After worker completes, verify framework-evaluation.md exists at output_path
|
|
104
|
-
6. Then proceed to Phase 3.5 HARD STOP for user confirmation
|
|
105
|
-
|
|
106
|
-
**CRITICAL**: The `Agent tool` creates a NEW agent session — this is completely different from the `Skill tool` which executes inline.
|
|
107
|
-
|
|
108
|
-
### Phase 4 Execution Method — Worker Agent Dispatch
|
|
109
|
-
|
|
110
|
-
**HOW TO DISPATCH**: When executing Phase 4 block P4-B1 (action="dispatch-to-worker"):
|
|
111
|
-
1. Use the **Agent tool** to create a new `speccrew-task-worker` agent
|
|
112
|
-
2. Pass `skill_path` to the worker: `${workspace_path}/.speccrew/skills/speccrew-sd-design-overview-generate/SKILL.md`
|
|
113
|
-
3. Pass context parameters: workspace_path, iteration_path, feature_registry_path (.prd-feature-list.json path), techs_manifest_path (techs-manifest.json path), framework_evaluation_path (framework-evaluation.md path), output_path
|
|
114
|
-
4. **Wait** for the worker agent to complete and return results
|
|
115
|
-
5. After worker completes, verify DESIGN-OVERVIEW.md exists at output_path
|
|
116
|
-
6. Then proceed to Phase 4 checkpoint validation (P4-CP1)
|
|
117
|
-
7. Present DESIGN-OVERVIEW.md summary to user (feature count, platform count, matrix entries)
|
|
118
|
-
8. **⚠️ HARD STOP** — Wait for user explicit confirmation before proceeding to Phase 5
|
|
119
|
-
|
|
120
|
-
**CRITICAL**: The `Agent tool` creates a NEW agent session — this is completely different from the `Skill tool` which executes inline.
|
|
121
|
-
|
|
122
|
-
### Phase 5 Execution Method — Feature×Platform Worker Dispatch
|
|
123
|
-
|
|
124
|
-
**DISPATCH GRANULARITY**: ONE Worker per Feature×Platform combination — NO EXCEPTIONS.
|
|
125
|
-
|
|
126
|
-
**HOW TO DISPATCH**: When executing Phase 5 dispatch blocks (action="dispatch-to-worker"):
|
|
127
|
-
1. Build Feature×Platform matrix from DESIGN-OVERVIEW.md Platform Design Index
|
|
128
|
-
2. Create `.tasks-temp.json` with one entry per Feature×Platform combination
|
|
129
|
-
3. Initialize DISPATCH-PROGRESS.json via `update-progress.js init`
|
|
130
|
-
4. Compute batch plan (batch size = 6)
|
|
131
|
-
5. For each batch:
|
|
132
|
-
a. Use **Agent tool** to create `speccrew-task-worker` agents for ALL tasks in the batch **SIMULTANEOUSLY**
|
|
133
|
-
b. Each Worker receives: `skill_path` (platform-specific skill), `task_id`, `feature_id`, `feature_name`, `platform_id`, `feature_spec_path`, `api_contract_path`, `techs_knowledge_paths`, `framework_decisions`, `output_base_path`, `skip_confirmation: true`, `skip_index_generation: true`, `dispatch_progress_file`, `update_progress_script`
|
|
134
|
-
c. **Wait** for ALL Workers in the batch to complete
|
|
135
|
-
d. Update DISPATCH-PROGRESS.json for each completed Worker
|
|
136
|
-
e. Log batch progress
|
|
137
|
-
6. After all batches complete, read final progress summary
|
|
138
|
-
7. Dispatch worker per platform with `index_only: true` to generate INDEX.md (see Phase 5.5)
|
|
139
|
-
|
|
140
|
-
**CRITICAL**: Each Worker handles exactly ONE feature on ONE platform. DO NOT group multiple features or platforms into a single Worker.
|
|
141
|
-
|
|
142
|
-
**Batch Dispatch Context Parameters**: When dispatching Workers in batch mode, the following parameters MUST be included in each Worker's context:
|
|
143
|
-
- `skip_confirmation: true` — Workers skip Checkpoint A user confirmation (not feasible in batch mode)
|
|
144
|
-
- `skip_index_generation: true` — Workers skip Step 5 INDEX.md generation (INDEX.md will be generated by orchestrator after all workers complete)
|
|
145
|
-
- `dispatch_progress_file` — Path to DISPATCH-PROGRESS.json, enables Worker to self-update its task status on completion
|
|
146
|
-
- `update_progress_script` — Path to update-progress.js script, used by Worker to execute status updates
|
|
147
|
-
- `task_id` — Task identifier in DISPATCH-PROGRESS.json (already part of dispatch context, listed here for completeness)
|
|
148
|
-
|
|
149
|
-
> **Worker Self-Update**: When `dispatch_progress_file` and `task_id` are provided, the Worker is responsible for updating its own task status in DISPATCH-PROGRESS.json upon completion (Step 7 of platform skills). The orchestrator's P5-B4-POST block serves as a fallback, but the Worker self-update is the primary mechanism.
|
|
150
|
-
|
|
151
|
-
### Phase 5.5: INDEX.md Generation (WORKER-DISPATCH)
|
|
152
|
-
|
|
153
|
-
After ALL Feature×Platform workers complete successfully, dispatch ONE worker per platform to generate INDEX.md. Each worker receives `index_only: true` and `skip_index_generation: false`, executing ONLY Step 5 of the platform skill.
|
|
154
|
-
|
|
155
|
-
**Dispatch parameters per platform**:
|
|
156
|
-
- `agent`: speccrew-task-worker
|
|
157
|
-
- `skill`: speccrew-sd-${platform.type}
|
|
158
|
-
- `skill_path`: ${ide_skills_dir}/speccrew-sd-${platform.type}/SKILL.md
|
|
159
|
-
- `context`:
|
|
160
|
-
- `index_only: true`
|
|
161
|
-
- `skip_index_generation: false`
|
|
162
|
-
- `platform_id`: ${platform.id}
|
|
163
|
-
- `output_dir`: ${iterations_dir}/${current_iteration}/03.system-design/${platform.id}
|
|
164
|
-
- `completed_documents`: ${platform.completed_documents}
|
|
165
|
-
- `techs_knowledge_dir`: ${techs_knowledge_dir}
|
|
166
|
-
- `workspace_path`: ${workspace_path}
|
|
167
|
-
- `task_id`: idx-${platform.id}
|
|
168
|
-
- `dispatch_progress_file`: ${iterations_dir}/${current_iteration}/03.system-design/DISPATCH-PROGRESS.json
|
|
169
|
-
- `update_progress_script`: ${update_progress_script}
|
|
170
|
-
|
|
171
|
-
**FORBIDDEN**: Orchestrator generating INDEX.md directly. INDEX.md MUST be generated by worker.
|
|
172
|
-
|
|
173
|
-
**Example** (5 features × 3 platforms = 15 workers, 3 batches of 6/6/3):
|
|
174
|
-
- Batch 1: Workers 1-6 (parallel)
|
|
175
|
-
- Batch 2: Workers 7-12 (parallel, after batch 1 completes)
|
|
176
|
-
- Batch 3: Workers 13-15 (parallel, after batch 2 completes)
|
|
177
|
-
|
|
178
|
-
### HARD STOP Checkpoints
|
|
179
|
-
|
|
180
|
-
This workflow has **mandatory HARD STOP** checkpoints at:
|
|
181
|
-
- **Phase 3.5**: Framework evaluation confirmation (user MUST approve framework decisions)
|
|
182
|
-
- **Phase 4.5**: Design overview confirmation (user MUST approve DESIGN-OVERVIEW.md before Phase 5 dispatch)
|
|
183
|
-
- **Phase 5.5**: (No HARD STOP — INDEX.md generation is automatic after all workers complete)
|
|
184
|
-
- **Phase 6.1**: Joint design confirmation (user MUST approve all designs)
|
|
185
|
-
|
|
186
|
-
DO NOT proceed past these checkpoints without explicit user confirmation.
|
|
187
|
-
|
|
188
|
-
## Must Do
|
|
189
|
-
|
|
190
|
-
- **READ SKILL.xml FIRST** — Execute blocks in document order
|
|
191
|
-
- **Use Agent tool for dispatch-to-worker blocks** — Agent tool creates a new speccrew-task-worker agent session
|
|
192
|
-
- **Pass skill_path explicitly to worker** — Worker cannot find skills via glob on first run
|
|
193
|
-
- **Wait for worker completion before verifying output** — Do not proceed until worker returns
|
|
194
|
-
- **Update progress via update-progress.js script** — Use run-script commands exactly as defined in XML
|
|
195
|
-
|
|
196
|
-
## Must Not Do
|
|
197
|
-
|
|
198
|
-
- **DO NOT use Skill tool for Phase 3 framework evaluation** — Skill tool executes inline, Agent tool creates a worker
|
|
199
|
-
- **DO NOT read feature spec files yourself** — Workers read them
|
|
200
|
-
- **DO NOT read tech knowledge files yourself** — Workers read them
|
|
201
|
-
- **DO NOT generate framework-evaluation.md yourself** — Only workers generate it
|
|
202
|
-
- **DO NOT create scripts for batch analysis** — Workers handle this via their own skill
|
|
203
|
-
- **DO NOT fallback to inline execution if worker fails** — ABORT instead
|
|
204
|
-
- **DO NOT let individual workers generate INDEX.md in batch mode** — `skip_index_generation: true` must be set; INDEX.md is generated in Phase 5.5 by separate worker with `index_only: true`
|
|
205
|
-
- **DO NOT skip reading SKILL.xml** — XML is the execution authority
|
|
206
|
-
- **DO NOT generate DESIGN-OVERVIEW.md yourself** — Dispatch speccrew-task-worker with speccrew-sd-design-overview-generate skill
|
|
207
|
-
- **DO NOT use Skill tool for Phase 4 design overview generation** — Skill tool executes inline, Agent tool creates a worker
|
|
208
|
-
- **DO NOT group multiple features into a single Worker** — Each Worker handles exactly ONE feature on ONE platform
|
|
209
|
-
- **DO NOT dispatch Workers sequentially** — ALL Workers in the same batch MUST be dispatched simultaneously
|
|
17
|
+
> **REQUIRED**: Read and execute the XML workflow above. The XML contains the complete workflow definition including all phases (Stage Gate → Preparation → Resource Verification → Framework Evaluation → Design Overview → Platform Dispatch → Joint Confirmation), rules, conditions, and checklist.
|
package/package.json
CHANGED
|
@@ -1502,26 +1502,30 @@ function cmdInitTasks(args) {
|
|
|
1502
1502
|
outputError(`Features directory not found: ${featuresDir}`);
|
|
1503
1503
|
}
|
|
1504
1504
|
|
|
1505
|
-
// Scan
|
|
1505
|
+
// Scan feature-spec.md files (support both new and old filename formats)
|
|
1506
|
+
// New format: *.feature-spec.md (dot separator before feature-spec)
|
|
1507
|
+
// Old format: *-feature-spec.md (hyphen separator before feature-spec)
|
|
1506
1508
|
const featureFiles = [];
|
|
1507
1509
|
const files = fs.readdirSync(featuresDir);
|
|
1508
1510
|
for (const file of files) {
|
|
1509
|
-
if (file.endsWith('.feature-spec.md')) {
|
|
1511
|
+
if (file.endsWith('.feature-spec.md') || file.endsWith('-feature-spec.md')) {
|
|
1510
1512
|
featureFiles.push(file);
|
|
1511
1513
|
}
|
|
1512
1514
|
}
|
|
1513
1515
|
|
|
1514
1516
|
if (featureFiles.length === 0) {
|
|
1515
|
-
outputError(`No
|
|
1517
|
+
outputError(`No feature-spec files found in: ${featuresDir}. Supported formats:\n New: F-{MODULE}-{NNN}-{feature-name}.feature-spec.md (e.g. F-APPT-001-appointment-crud.feature-spec.md)\n Old: F-{MODULE}-{NNN}-{feature-name}-feature-spec.md (e.g. F-M01-01-member-level-history-feature-spec.md)`);
|
|
1516
1518
|
}
|
|
1517
1519
|
|
|
1518
1520
|
// Extract feature info from filenames
|
|
1519
|
-
//
|
|
1520
|
-
|
|
1521
|
+
// New format: F-{MODULE}-{NNN}-{feature-name}.feature-spec.md (module: uppercase letters, e.g. APPT)
|
|
1522
|
+
// Old format: F-{MODULE}-{NNN}-{feature-name}-feature-spec.md (module: M+digits, e.g. M01)
|
|
1523
|
+
const newFormatPattern = /^(F-([A-Z]+)-\d+)-(.+)\.feature-spec\.md$/;
|
|
1524
|
+
const oldFormatPattern = /^(F-(M\d+)-\d+)-(.+)-feature-spec\.md$/;
|
|
1521
1525
|
const features = [];
|
|
1522
1526
|
|
|
1523
1527
|
for (const file of featureFiles) {
|
|
1524
|
-
|
|
1528
|
+
let match = file.match(newFormatPattern);
|
|
1525
1529
|
if (match) {
|
|
1526
1530
|
features.push({
|
|
1527
1531
|
feature_id: match[1], // F-APPT-001
|
|
@@ -1529,11 +1533,22 @@ function cmdInitTasks(args) {
|
|
|
1529
1533
|
name: match[3], // appointment-crud
|
|
1530
1534
|
file: file
|
|
1531
1535
|
});
|
|
1536
|
+
continue;
|
|
1537
|
+
}
|
|
1538
|
+
match = file.match(oldFormatPattern);
|
|
1539
|
+
if (match) {
|
|
1540
|
+
features.push({
|
|
1541
|
+
feature_id: match[1], // F-M01-01
|
|
1542
|
+
module: match[2], // M01
|
|
1543
|
+
name: match[3], // member-level-history
|
|
1544
|
+
file: file
|
|
1545
|
+
});
|
|
1546
|
+
continue;
|
|
1532
1547
|
}
|
|
1533
1548
|
}
|
|
1534
1549
|
|
|
1535
1550
|
if (features.length === 0) {
|
|
1536
|
-
outputError('No valid feature files found.
|
|
1551
|
+
outputError('No valid feature files found. Supported formats:\n New: F-{MODULE}-{NNN}-{feature-name}.feature-spec.md (e.g. F-APPT-001-appointment-crud.feature-spec.md)\n Old: F-{MODULE}-{NNN}-{feature-name}-feature-spec.md (e.g. F-M01-01-member-level-history-feature-spec.md)');
|
|
1537
1552
|
}
|
|
1538
1553
|
|
|
1539
1554
|
// Sort by feature ID
|