speccrew 0.7.4 → 0.7.5

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.
Files changed (22) hide show
  1. package/.speccrew/agents/speccrew-feature-designer.md +6 -0
  2. package/.speccrew/agents/speccrew-product-manager.md +6 -0
  3. package/.speccrew/agents/speccrew-system-deployer.md +6 -0
  4. package/.speccrew/agents/speccrew-system-designer.md +6 -0
  5. package/.speccrew/agents/speccrew-system-developer.md +6 -0
  6. package/.speccrew/agents/speccrew-task-worker.md +5 -0
  7. package/.speccrew/agents/speccrew-test-manager.md +6 -0
  8. package/.speccrew/skills/speccrew-feature-designer-orchestration/SKILL.md +117 -0
  9. package/.speccrew/skills/speccrew-feature-designer-orchestration/workflow.agentflow.xml +463 -0
  10. package/.speccrew/skills/speccrew-product-manager-orchestration/SKILL.md +111 -0
  11. package/.speccrew/skills/speccrew-product-manager-orchestration/workflow.agentflow.xml +534 -0
  12. package/.speccrew/skills/speccrew-system-deployer-orchestration/SKILL.md +91 -0
  13. package/.speccrew/skills/speccrew-system-deployer-orchestration/workflow.agentflow.xml +309 -0
  14. package/.speccrew/skills/speccrew-system-designer-orchestration/SKILL.md +102 -0
  15. package/.speccrew/skills/speccrew-system-designer-orchestration/workflow.agentflow.xml +375 -0
  16. package/.speccrew/skills/speccrew-system-developer-orchestration/SKILL.md +110 -0
  17. package/.speccrew/skills/speccrew-system-developer-orchestration/workflow.agentflow.xml +422 -0
  18. package/.speccrew/skills/speccrew-task-worker-execution/SKILL.md +106 -0
  19. package/.speccrew/skills/speccrew-task-worker-execution/workflow.agentflow.xml +177 -0
  20. package/.speccrew/skills/speccrew-test-manager-orchestration/SKILL.md +106 -0
  21. package/.speccrew/skills/speccrew-test-manager-orchestration/workflow.agentflow.xml +442 -0
  22. package/package.json +1 -1
@@ -0,0 +1,177 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <workflow id="task-worker-execution" status="pending" version="1.0" desc="Task Worker 通用执行工作流">
3
+ <!--
4
+ == Block Types ==
5
+ input : 工作流输入参数(required=必填, default=默认值)
6
+ output : 工作流输出结果(from=数据来源变量)
7
+ task : 执行动作(action: run-skill | run-script | read-file | log)
8
+ gateway : 条件分支/门禁(mode: exclusive | guard)
9
+ event : 日志/确认/信号
10
+ rule : 约束声明(level: forbidden | mandatory | note)
11
+ == Field ==
12
+ field : 参数/变量/输出
13
+ -->
14
+
15
+ <!-- === Phase 1: 接收任务参数 === -->
16
+ <block type="input" id="I1" desc="接收任务参数">
17
+ <field name="skill_path" required="false" type="string" desc="完整技能路径(优先)"/>
18
+ <field name="skill_name" required="false" type="string" desc="技能名称标识符(向后兼容)"/>
19
+ <field name="context" required="true" type="object" desc="任务上下文参数"/>
20
+ <field name="workspace_root" required="true" type="string" desc="工作空间根目录"/>
21
+ </block>
22
+
23
+ <!-- === Phase 2: 技能发现 === -->
24
+ <block type="event" id="E1" action="log" desc="开始技能发现">📋 Phase 2: Skill Discovery</block>
25
+
26
+ <block type="gateway" id="G1" mode="exclusive" desc="判断技能路径来源">
27
+ <branch test="${skill_path} != null" name="使用显式路径">
28
+ <block type="event" id="E2" action="log" desc="使用提供的 skill_path">✅ 使用显式路径: ${skill_path}</block>
29
+ <field name="resolved_skill_path" value="${skill_path}"/>
30
+ </branch>
31
+ <branch test="${skill_name} != null" name="技能名称发现">
32
+ <block type="task" id="T1" action="read-file" desc="确定 IDE 技能根目录">
33
+ <field name="path">${workspace_root}/.qoder/skills/${skill_name}/SKILL.md</field>
34
+ <field name="output" var="skill_file_qoder"/>
35
+ </block>
36
+ <block type="gateway" id="G2" mode="exclusive" desc="检查技能文件存在性">
37
+ <branch test="${skill_file_qoder}.exists == true" name="qoder目录">
38
+ <field name="resolved_skill_path" value="${workspace_root}/.qoder/skills/${skill_name}/SKILL.md"/>
39
+ </branch>
40
+ <branch test="true" name="继续检查其他目录">
41
+ <block type="task" id="T2" action="read-file" desc="检查 cursor 目录">
42
+ <field name="path">${workspace_root}/.cursor/skills/${skill_name}/SKILL.md</field>
43
+ <field name="output" var="skill_file_cursor"/>
44
+ </block>
45
+ <block type="gateway" id="G3" mode="exclusive" desc="检查 cursor 目录">
46
+ <branch test="${skill_file_cursor}.exists == true" name="cursor目录">
47
+ <field name="resolved_skill_path" value="${workspace_root}/.cursor/skills/${skill_name}/SKILL.md"/>
48
+ </branch>
49
+ <branch test="true" name="继续检查 claude 目录">
50
+ <block type="task" id="T3" action="read-file" desc="检查 claude 目录">
51
+ <field name="path">${workspace_root}/.claude/skills/${skill_name}/SKILL.md</field>
52
+ <field name="output" var="skill_file_claude"/>
53
+ </block>
54
+ <block type="gateway" id="G4" mode="exclusive" desc="检查 claude 目录">
55
+ <branch test="${skill_file_claude}.exists == true" name="claude目录">
56
+ <field name="resolved_skill_path" value="${workspace_root}/.claude/skills/${skill_name}/SKILL.md"/>
57
+ </branch>
58
+ <branch test="true" name="继续检查 speccrew 目录">
59
+ <block type="task" id="T4" action="read-file" desc="检查 speccrew 目录">
60
+ <field name="path">${workspace_root}/.speccrew/skills/${skill_name}/SKILL.md</field>
61
+ <field name="output" var="skill_file_speccrew"/>
62
+ </block>
63
+ <block type="gateway" id="G5" mode="exclusive" desc="检查 speccrew 目录">
64
+ <branch test="${skill_file_speccrew}.exists == true" name="speccrew目录">
65
+ <field name="resolved_skill_path" value="${workspace_root}/.speccrew/skills/${skill_name}/SKILL.md"/>
66
+ </branch>
67
+ <branch test="true" name="技能未找到">
68
+ <block type="event" id="E3" action="log" desc="技能未找到错误">❌ ERROR: Skill not found: ${skill_name}</block>
69
+ <field name="skill_not_found" value="true"/>
70
+ </branch>
71
+ </block>
72
+ </branch>
73
+ </block>
74
+ </branch>
75
+ </block>
76
+ </branch>
77
+ </block>
78
+ </branch>
79
+ <branch default="true" name="无技能参数">
80
+ <block type="event" id="E4" action="log" desc="直接执行模式">ℹ️ 无技能参数,基于 context 直接执行</block>
81
+ <field name="direct_execution" value="true"/>
82
+ </branch>
83
+ </block>
84
+
85
+ <!-- === Phase 3: 执行任务 === -->
86
+ <block type="event" id="E5" action="log" desc="开始执行任务">📋 Phase 3: Execute Task</block>
87
+
88
+ <block type="rule" id="R1" level="mandatory" desc="技能执行强制约束">
89
+ 如果技能指定通过 run_in_terminal 或 Bash 执行脚本 → 必须通过终端执行
90
+ 如果技能指定 --outputDir 或其他路径参数 → 必须按原样传递
91
+ 如果技能包含 MANDATORY/FORBIDDEN 约束 → 必须严格遵循
92
+ 禁止即兴替代执行路径,如步骤失败则报告错误
93
+ </block>
94
+
95
+ <block type="gateway" id="G6" mode="exclusive" desc="选择执行模式">
96
+ <branch test="${skill_not_found} == true" name="技能未找到">
97
+ <block type="event" id="E6" action="log" desc="报告技能未找到错误">
98
+ ❌ Failed: Skill file not found
99
+ Attempted paths:
100
+ - .qoder/skills/${skill_name}/SKILL.md
101
+ - .cursor/skills/${skill_name}/SKILL.md
102
+ - .claude/skills/${skill_name}/SKILL.md
103
+ - .speccrew/skills/${skill_name}/SKILL.md
104
+ </block>
105
+ <field name="execution_status" value="failed"/>
106
+ <field name="error_category" value="DEPENDENCY_MISSING"/>
107
+ </branch>
108
+ <branch test="${direct_execution} == true" name="直接执行">
109
+ <block type="event" id="E7" action="log" desc="基于 context 直接执行">🔧 直接执行任务: ${context.task_description}</block>
110
+ <block type="task" id="T5" action="log" desc="解析 context 并执行">
111
+ 根据 context 参数理解任务需求,直接执行并输出结果
112
+ </block>
113
+ <field name="execution_status" value="success"/>
114
+ </branch>
115
+ <branch test="${resolved_skill_path} != null" name="加载技能执行">
116
+ <block type="task" id="T6" action="read-file" desc="读取技能定义">
117
+ <field name="path">${resolved_skill_path}</field>
118
+ <field name="output" var="skill_definition"/>
119
+ </block>
120
+ <block type="event" id="E8" action="log" desc="加载技能">📄 Loaded skill: ${resolved_skill_path}</block>
121
+
122
+ <!-- 加载 AgentFlow 规范 -->
123
+ <block type="task" id="T7" action="read-file" desc="读取 AgentFlow 规范">
124
+ <field name="path">${workspace_root}/speccrew-workspace/docs/rules/agentflow-spec.md</field>
125
+ <field name="output" var="agentflow_spec"/>
126
+ </block>
127
+ <block type="event" id="E9" action="log" desc="加载规范">📖 Loaded AgentFlow specification</block>
128
+
129
+ <!-- 执行技能工作流 -->
130
+ <block type="task" id="T8" action="run-skill" desc="执行技能工作流">
131
+ <field name="skill">${resolved_skill_path}</field>
132
+ <field name="context">${context}</field>
133
+ </block>
134
+ <field name="execution_status" value="success"/>
135
+ </branch>
136
+ </block>
137
+
138
+ <!-- === Phase 4: 报告结果 === -->
139
+ <block type="event" id="E10" action="log" desc="开始报告结果">📋 Phase 4: Report Results</block>
140
+
141
+ <block type="gateway" id="G7" mode="exclusive" desc="选择报告格式">
142
+ <branch test="${execution_status} == success" name="成功报告">
143
+ <block type="output" id="O1" desc="成功完成报告">
144
+ <field name="status">SUCCESS</field>
145
+ <field name="task_id">${context.task_id}</field>
146
+ <field name="platform">${context.platform}</field>
147
+ <field name="module">${context.module}</field>
148
+ <field name="output_files">${generated_files}</field>
149
+ <field name="summary">${execution_summary}</field>
150
+ </block>
151
+ </branch>
152
+ <branch test="${execution_status} == failed" name="失败报告">
153
+ <block type="output" id="O2" desc="失败完成报告">
154
+ <field name="status">FAILED</field>
155
+ <field name="task_id">${context.task_id}</field>
156
+ <field name="platform">${context.platform}</field>
157
+ <field name="module">${context.module}</field>
158
+ <field name="error">${error_message}</field>
159
+ <field name="error_category">${error_category}</field>
160
+ <field name="partial_outputs">${partial_files}</field>
161
+ <field name="recovery_hint">${recovery_suggestion}</field>
162
+ </block>
163
+ </branch>
164
+ </block>
165
+
166
+ <!-- === Phase 5: 完成报告输出 === -->
167
+ <block type="event" id="E11" action="log" desc="输出结构化完成报告">
168
+ ## Task Completion Report
169
+ - **Status**: ${status}
170
+ - **Task ID**: ${task_id}
171
+ - **Platform**: ${platform}
172
+ - **Module**: ${module}
173
+ - **Output Files**: ${output_files}
174
+ - **Summary**: ${summary}
175
+ </block>
176
+
177
+ </workflow>
@@ -0,0 +1,106 @@
1
+ ---
2
+ name: speccrew-test-manager-orchestration
3
+ version: 1.0.0
4
+ description: Test Manager 的编排调度技能,负责执行三阶段测试工作流:测试用例设计 → 测试代码生成 → 测试执行与报告。支持单平台直接调用和多平台 Worker 并行调度。
5
+ tools: Read, Write, Glob, Grep, Bash, Agent
6
+ ---
7
+
8
+ > **⚠️ MANDATORY EXECUTION PROTOCOL — READ BEFORE EXECUTING ANY BLOCK**
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"` → Create **Task** via **Task tool** for `speccrew-task-worker`
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)
29
+
30
+ # Test Manager Orchestration
31
+
32
+ Test Manager 的核心编排技能,负责:
33
+
34
+ 1. **Stage Gate Verification** - 验证部署阶段已完成确认
35
+ 2. **IDE Directory Detection** - 检测 IDE 目录并验证测试技能存在
36
+ 3. **Preparation** - 识别迭代路径、定位输入文档、检查现有制品
37
+ 4. **Knowledge Loading** - 加载功能规格、API契约、系统设计
38
+ 5. **Test Case Design** - 测试用例设计(支持单平台/多平台模式)
39
+ 6. **Test Code Generation** - 测试代码生成(含代码审查)
40
+ 7. **Test Execution & Reporting** - 测试执行与缺陷报告
41
+ 8. **Delivery Summary** - 交付总结确认
42
+
43
+ ## Invocation Method
44
+
45
+ **CRITICAL**: This skill is loaded directly by Test Manager Agent — do NOT invoke via Worker Agent.
46
+
47
+ ```xml
48
+ <block type="task" action="run-skill" desc="Test Manager orchestration workflow">
49
+ <field name="skill">speccrew-test-manager-orchestration</field>
50
+ </block>
51
+ ```
52
+
53
+ ## Input Parameters
54
+
55
+ | Parameter | Type | Required | Description |
56
+ |-----------|------|----------|-------------|
57
+ | `workspace_path` | string | Yes | speccrew-workspace 根目录绝对路径 |
58
+ | `iteration_dir` | string | Yes | 当前迭代目录路径 |
59
+ | `update_progress_script` | string | Yes | update-progress.js 脚本路径 |
60
+
61
+ ## Output
62
+
63
+ - `status` - Execution status (success / partial / failed)
64
+ - `test_cases_designed` - Number of test cases designed
65
+ - `test_code_generated` - Number of test code files generated
66
+ - `tests_passed` - Number of tests passed
67
+ - `tests_failed` - Number of tests failed
68
+ - `bug_reports` - List of bug report paths
69
+ - `output_files` - List of generated/modified files
70
+ - `summary` - Execution summary
71
+ - `next_steps` - Suggested next actions
72
+
73
+ ---
74
+
75
+ ## AgentFlow Definition
76
+
77
+ <!-- @agentflow: workflow.agentflow.xml -->
78
+
79
+ ---
80
+
81
+ ## CONTINUOUS EXECUTION RULES
82
+
83
+ This skill MUST execute tasks continuously without unnecessary interruptions.
84
+
85
+ ### FORBIDDEN Interruptions
86
+
87
+ 1. DO NOT ask user "Should I continue?" after completing a subtask
88
+ 2. DO NOT suggest "Let me split this into batches" or "Let's do this in parts"
89
+ 3. DO NOT pause to list what you plan to do next — just do it
90
+ 4. DO NOT ask for confirmation before generating output files
91
+ 5. DO NOT warn about "large number of files" — proceed with generation
92
+ 6. DO NOT offer "Should I proceed with the remaining items?"
93
+
94
+ ### When to Pause (ONLY these cases)
95
+
96
+ 1. CHECKPOINT gates defined in workflow (user confirmation required by design)
97
+ 2. Ambiguous requirements that genuinely need clarification
98
+ 3. Unrecoverable errors that prevent further progress
99
+ 4. Security-sensitive operations (e.g., deleting existing files)
100
+
101
+ ### Batch Execution Behavior
102
+
103
+ - When multiple items need processing, process ALL of them sequentially without asking
104
+ - Use DISPATCH-PROGRESS.json to track progress, enabling resumption if interrupted by context limits
105
+ - If context window is approaching limit, save progress to checkpoint and inform user how to resume
106
+ - NEVER voluntarily stop mid-batch to ask if user wants to continue