@adamancyzhang/claude-orchestrator 0.3.0 → 0.3.2
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/README.md +203 -201
- package/dist/cli/commands.d.ts +6 -17
- package/dist/cli/commands.js +133 -172
- package/dist/cli/commands.js.map +1 -1
- package/dist/config.d.ts +28 -14
- package/dist/config.js +51 -20
- package/dist/config.js.map +1 -1
- package/dist/executor/runner.d.ts +19 -0
- package/dist/executor/runner.js +59 -0
- package/dist/executor/runner.js.map +1 -0
- package/dist/executor/template.d.ts +12 -0
- package/dist/executor/template.js +42 -0
- package/dist/executor/template.js.map +1 -0
- package/dist/hooks/engine.d.ts +22 -0
- package/dist/hooks/engine.js +50 -0
- package/dist/hooks/engine.js.map +1 -0
- package/dist/index.js +115 -250
- package/dist/index.js.map +1 -1
- package/dist/leader/chain-router.d.ts +22 -0
- package/dist/leader/chain-router.js +163 -0
- package/dist/leader/chain-router.js.map +1 -0
- package/dist/leader/event-bus.d.ts +1 -1
- package/dist/leader/event-bus.js +1 -1
- package/dist/leader/event-bus.js.map +1 -1
- package/dist/leader/index.d.ts +1 -2
- package/dist/leader/index.js +35 -13
- package/dist/leader/index.js.map +1 -1
- package/dist/leader/recovery.d.ts +2 -0
- package/dist/leader/recovery.js +37 -22
- package/dist/leader/recovery.js.map +1 -1
- package/dist/leader/state.d.ts +2 -1
- package/dist/leader/state.js +48 -2
- package/dist/leader/state.js.map +1 -1
- package/dist/leader/tui.d.ts +8 -0
- package/dist/leader/tui.js +74 -9
- package/dist/leader/tui.js.map +1 -1
- package/dist/leader/watcher.d.ts +4 -3
- package/dist/leader/watcher.js +8 -13
- package/dist/leader/watcher.js.map +1 -1
- package/dist/models/schemas.d.ts +307 -87
- package/dist/models/schemas.js +51 -43
- package/dist/models/schemas.js.map +1 -1
- package/dist/modules/message-router.d.ts +1 -3
- package/dist/modules/message-router.js +3 -26
- package/dist/modules/message-router.js.map +1 -1
- package/dist/modules/registry.js +3 -3
- package/dist/modules/registry.js.map +1 -1
- package/dist/modules/task-queue.d.ts +1 -1
- package/dist/modules/task-queue.js +28 -2
- package/dist/modules/task-queue.js.map +1 -1
- package/dist/skills/CLAUDE.md +155 -0
- package/dist/skills/claude-code-developer/SKILL.md +325 -0
- package/dist/skills/claude-orchestrator/SKILL.md +244 -0
- package/dist/skills/task-acceptance/SKILL.md +201 -0
- package/dist/skills/task-execution/SKILL.md +142 -0
- package/dist/skills/task-planning/SKILL.md +188 -0
- package/dist/skills/task-review/SKILL.md +220 -0
- package/dist/skills/task-traceability/SKILL.md +154 -0
- package/dist/skills/task-verification/SKILL.md +194 -0
- package/dist/templates/worker-accept.md +46 -0
- package/dist/templates/worker-build.md +45 -0
- package/dist/templates/worker-decompose.md +67 -0
- package/dist/templates/worker-evaluate.md +41 -0
- package/dist/templates/worker-plan.md +43 -0
- package/dist/templates/worker-review.md +46 -0
- package/dist/templates/worker-verify.md +47 -0
- package/dist/utils/exec.d.ts +5 -0
- package/dist/utils/exec.js +27 -0
- package/dist/utils/exec.js.map +1 -1
- package/dist/utils/logger.d.ts +10 -0
- package/dist/utils/logger.js +22 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/worker/evaluator.d.ts +13 -0
- package/dist/worker/evaluator.js +112 -0
- package/dist/worker/evaluator.js.map +1 -0
- package/dist/worker/watcher.d.ts +13 -4
- package/dist/worker/watcher.js +108 -24
- package/dist/worker/watcher.js.map +1 -1
- package/dist/zk/client.d.ts +0 -5
- package/dist/zk/client.js +0 -27
- package/dist/zk/client.js.map +1 -1
- package/dist/zk/paths.d.ts +8 -10
- package/dist/zk/paths.js +1 -6
- package/dist/zk/paths.js.map +1 -1
- package/dist/zk/watcher.d.ts +0 -2
- package/dist/zk/watcher.js +0 -3
- package/dist/zk/watcher.js.map +1 -1
- package/package.json +2 -2
- package/dist/modules/context-store.d.ts +0 -10
- package/dist/modules/context-store.js +0 -25
- package/dist/modules/context-store.js.map +0 -1
- package/dist/templates/leader.md +0 -10
- package/dist/templates/worker.md +0 -8
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: task-review
|
|
3
|
+
description: Quality review of the full Plan→Build→Verify chain for the Reviewer role. Use when the Reviewer needs to assess whether the implementation matches the Planner's design intent — checking code quality, architecture compliance, verification completeness, and producing a review report with a pass/revise decision, with full traceability from every judgment back through the chain. Triggers on keywords like "审查", "review", "code review", "检查代码", "审批", "复核", or when verification is complete and the task enters the Review stage of the responsibility chain.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Task Review
|
|
7
|
+
|
|
8
|
+
> 审查不是挑刺,是从设计意图的高度判断实现是否"做对了"——不是"代码写得怎么样",而是"该不该通过"。本技能与 [[task-traceability]] 协作,确保每次审查有依据、有深度、有结论、可追溯——每个判定都可追溯到具体的 Plan 意图、Build 产出和 Verify 发现。
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 何时触发
|
|
13
|
+
|
|
14
|
+
- Verifier 完成验证,责任链流转到 Review 阶段
|
|
15
|
+
- Worker 通过 `claude-orchestrator claim-task` 认领了 review 类型的任务
|
|
16
|
+
- 用户说"审查一下这个 PR"、"review 一下代码"
|
|
17
|
+
- 蓝图中有 review 类型的任务需要开工
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 审查六步法
|
|
22
|
+
|
|
23
|
+
按顺序执行,每一步通过才进入下一步。
|
|
24
|
+
|
|
25
|
+
### 1. 认领 Review 任务并收集全链信息
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# 认领审查任务
|
|
29
|
+
claude-orchestrator claim-task
|
|
30
|
+
|
|
31
|
+
# 获取蓝图
|
|
32
|
+
claude-orchestrator get-context --key plan-<目标slug>
|
|
33
|
+
|
|
34
|
+
# 获取验证报告
|
|
35
|
+
claude-orchestrator get-context --key verify-<目标slug>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
收集审查所需的完整上下文:
|
|
39
|
+
- Planner 的蓝图(设计意图、验收标准、范围边界)
|
|
40
|
+
- Builder 的代码变更(commit diff)
|
|
41
|
+
- Verifier 的验证报告(问题清单、回归结果)
|
|
42
|
+
- Builder 的 task-traceability 记录(commit hash 链)
|
|
43
|
+
|
|
44
|
+
如果缺少任何一环的产出 → 退回要求补齐。Reviewer 不做信息不完整的审查。
|
|
45
|
+
|
|
46
|
+
### 2. 审查设计一致性
|
|
47
|
+
|
|
48
|
+
对照蓝图检查实际实现,回答三个核心问题:
|
|
49
|
+
|
|
50
|
+
**做对了吗?**(功能正确性)
|
|
51
|
+
- 代码变更是否实现了蓝图定义的全部功能?
|
|
52
|
+
- 是否有蓝图定义但未实现的部分?
|
|
53
|
+
- 是否有蓝图未定义但被实现了的部分(越界)?
|
|
54
|
+
|
|
55
|
+
**做合适吗?**(架构合规性)
|
|
56
|
+
- 代码结构是否符合项目现有的架构模式?
|
|
57
|
+
- 是否引入了新的依赖或模式变更?(如有,是否必要且有充分理由?)
|
|
58
|
+
- 命名、目录组织、接口设计与项目现有风格是否一致?
|
|
59
|
+
|
|
60
|
+
**技术债务可控吗?**
|
|
61
|
+
- 是否有明显的性能问题、安全问题、可维护性问题?
|
|
62
|
+
- 是否引入了难以测试的逻辑?
|
|
63
|
+
- 错误处理是否合理?
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# 查看完整 diff
|
|
67
|
+
git show <commit-hash> --patch
|
|
68
|
+
|
|
69
|
+
# 查看变更的文件列表
|
|
70
|
+
git show <commit-hash> --stat
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 3. 审查验证报告的完整性
|
|
74
|
+
|
|
75
|
+
审查 Verifier 的工作质量:
|
|
76
|
+
|
|
77
|
+
- 验证报告是否覆盖了蓝图中所有验收标准?
|
|
78
|
+
- 验证方法是否独立可复现?(不是转述 Builder 的结果)
|
|
79
|
+
- 回归测试是否被执行且通过?
|
|
80
|
+
- Verifier 发现的问题是否被充分描述和分类?
|
|
81
|
+
|
|
82
|
+
如果验证报告有缺陷(漏检、方法不当)→ 标记为 Review 前置条件不满足,退回 Verifier 补充。
|
|
83
|
+
|
|
84
|
+
### 4. 判定问题等级
|
|
85
|
+
|
|
86
|
+
对发现的问题按严重度分级:
|
|
87
|
+
|
|
88
|
+
| 级别 | 定义 | 示例 | 处理 |
|
|
89
|
+
|------|------|------|------|
|
|
90
|
+
| **P0** | 阻断:设计意图未实现,核心功能缺失或不正确 | 蓝图要求的功能完全没做、引入安全漏洞 | 退回 Builder 重做 |
|
|
91
|
+
| **P1** | 严重:实现偏离设计意图,但不影响核心功能 | 错误处理不完整、UI 与设计不一致、性能明显下降 | 退回 Builder 修改 |
|
|
92
|
+
| **P2** | 一般:代码质量、风格、可维护性问题 | 命名不清晰、缺少注释、测试覆盖面不足 | 建议修改,不阻断通过 |
|
|
93
|
+
| **P3** | 建议:优化建议,不影响通过 | 更好的实现方式、可选的性能优化 | 记录,Builder 自行决定 |
|
|
94
|
+
|
|
95
|
+
### 5. 书写审查报告
|
|
96
|
+
|
|
97
|
+
```markdown
|
|
98
|
+
# 审查报告
|
|
99
|
+
|
|
100
|
+
> Reviewer | YYYY-MM-DD | 审查范围:<目标名称> (P→B→V 全链)
|
|
101
|
+
|
|
102
|
+
## 审查结论:Pass / Revise
|
|
103
|
+
|
|
104
|
+
(一句话结论)
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## 审查范围
|
|
109
|
+
|
|
110
|
+
| 环节 | 负责人 | 产出 | Commit / 文档 |
|
|
111
|
+
|------|--------|------|--------------|
|
|
112
|
+
| Plan | <Planner> | 蓝图 | plan-<slug> |
|
|
113
|
+
| Build | <Builder> | 代码 | `a1b2c3d` |
|
|
114
|
+
| Verify | <Verifier> | 验证报告 | verify-<slug> |
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 设计一致性审查
|
|
119
|
+
|
|
120
|
+
| 蓝图要求 | 实现情况 | 判定 |
|
|
121
|
+
|---------|---------|------|
|
|
122
|
+
| 功能 A:XXX | 已实现,见 `src/a.ts:42` | ✅ |
|
|
123
|
+
| 功能 B:YYY | 部分实现,缺少边界处理 | ⚠️ |
|
|
124
|
+
| 功能 C:ZZZ | 未实现 | ❌ |
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## 代码质量审查
|
|
129
|
+
|
|
130
|
+
| 检查项 | 结果 |
|
|
131
|
+
|--------|------|
|
|
132
|
+
| 架构合规 | ✅ / ⚠️ / ❌ |
|
|
133
|
+
| 命名规范 | ✅ / ⚠️ / ❌ |
|
|
134
|
+
| 错误处理 | ✅ / ⚠️ / ❌ |
|
|
135
|
+
| 性能影响 | ✅ / ⚠️ / ❌ |
|
|
136
|
+
| 安全问题 | ✅ / ⚠️ / ❌ |
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## 验证报告审查
|
|
141
|
+
|
|
142
|
+
| 检查项 | 结果 |
|
|
143
|
+
|--------|------|
|
|
144
|
+
| 验收标准覆盖 | 3/3 ✅ |
|
|
145
|
+
| 验证方法独立 | ✅ |
|
|
146
|
+
| 回归测试通过 | ✅ (42/42) |
|
|
147
|
+
| Verifier 问题充分描述 | ✅ |
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## 问题清单
|
|
152
|
+
|
|
153
|
+
| # | 级别 | 描述 | 位置 | 责任人 |
|
|
154
|
+
|---|------|------|------|--------|
|
|
155
|
+
| 1 | P1 | 缺少错误重试逻辑 | `src/auth.ts:L42` | @Builder |
|
|
156
|
+
| 2 | P2 | 变量名 `tmp` 不够清晰 | `src/utils.ts:L18` | @Builder |
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## 审查建议
|
|
161
|
+
|
|
162
|
+
(对 Builder/Planner/Verifier 的非强制性建议)
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
*Reviewer — YYYY-MM-DD*
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### 6. 通知结果并流转
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
# 存入共享上下文
|
|
173
|
+
claude-orchestrator set-context \
|
|
174
|
+
--key review-<目标slug> \
|
|
175
|
+
--value "$(cat docs/review/<目标slug>-YYYY-MM-DD.md)"
|
|
176
|
+
|
|
177
|
+
# Revise → 通知 Builder 和 Planner
|
|
178
|
+
claude-orchestrator send-message \
|
|
179
|
+
--to <builder-id> \
|
|
180
|
+
--content "审查结论 Revise。P1: 缺少错误重试逻辑。详见 review-<slug>"
|
|
181
|
+
|
|
182
|
+
# Pass → 通知 Leader 和 Accepter,流转到 Accept 阶段
|
|
183
|
+
claude-orchestrator send-message \
|
|
184
|
+
--broadcast \
|
|
185
|
+
--content "审查结论 Pass。<目标> 通过 Review,流转至 Accept 阶段。"
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## 审查完成检查清单
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
□ 已收集完整的 P→B→V 链产出
|
|
194
|
+
□ 蓝图验收标准全部检查
|
|
195
|
+
□ 代码 diff 完整审阅
|
|
196
|
+
□ 验证报告质量和完整性已评估
|
|
197
|
+
□ 问题已按 P0/P1/P2/P3 分级
|
|
198
|
+
□ 审查报告已产出并存入共享上下文
|
|
199
|
+
□ 结论(Pass/Revise)已通知相关角色
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## 与其他技能的协作
|
|
205
|
+
|
|
206
|
+
- **[[task-traceability]]**:基础层。Reviewer 严格遵循追溯 → 执行 → 映射 → 举证 → 记录的五步法。追溯整条链(Plan 意图 → Build 实现 → Verify 发现),逐项判定(Execute),构建审查判定映射表(Map),为每个判定附理据(Evidence),产出审查报告并签发 Pass/Revise(Record)。如果任何一个上游环节的追溯链断裂,标记为 P1 问题——没有追溯链,审查就没有锚点。
|
|
207
|
+
- **[[task-planning]]**:Reviewer 以 Planner 的蓝图为审查标准。设计意图是唯一的判断基准。
|
|
208
|
+
- **[[task-execution]]**:Reviewer 审查 Builder 的代码实现质量和设计一致性。
|
|
209
|
+
- **[[task-verification]]**:Reviewer 审查 Verifier 的验证报告质量和完整性。验证报告有缺陷的,退回 Verifier。
|
|
210
|
+
- **[[task-acceptance]]**:Accepter 依赖 Reviewer 的 Pass 结论和可追溯判定链来决定是否进入最终验收。
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## 常见错误
|
|
215
|
+
|
|
216
|
+
- **只审代码不审设计一致性**:陷入代码风格审查,忘记了 Reviewer 的核心职责是判断"是否实现了设计意图"。代码写得再好,与蓝图不一致也是不合格。
|
|
217
|
+
- **跳过对 Verifier 的审查**:假设 Verifier 的报告总是完整正确的。Verifier 也可能遗漏或误判。
|
|
218
|
+
- **不分级的问题清单**:把所有问题列出但不定级,Builder 不知道哪些必须修改、哪些可以忽略。
|
|
219
|
+
- **审查报告不写位置**:问题只描述不定位(缺少文件路径和行号)。Builder 不知道在哪里改。
|
|
220
|
+
- **Pass 但有问题未解决**:P0/P1 问题未解决就签 Pass。零 P0/P1 是 Pass 的前提。
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: task-traceability
|
|
3
|
+
description: Foundational traceability layer for the entire Plan→Build→Verify→Review→Accept responsibility chain. Every role must leave a traceable record: upstream requirements → execution → output mapping → evidence → persisted record. Without traceability at every link, the chain cannot be audited, handoffs break, and sign-off is unreliable. Use this skill whenever any team member executes work in any link of the responsibility chain — planning, building, verifying, reviewing, or accepting. Triggers on any task execution context: task assignment, work plans, code changes, verification, review, or acceptance.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Task Traceability — Foundational Layer
|
|
7
|
+
|
|
8
|
+
Traceability is not optional. It is the foundation that makes the Plan→Build→Verify→Review→Accept chain auditable, handoffs reliable, and sign-off meaningful. **Every link must produce a traceable record. A single broken link breaks the entire chain.**
|
|
9
|
+
|
|
10
|
+
## The Universal Five-Step Pattern
|
|
11
|
+
|
|
12
|
+
Every role in the chain follows the same five-step pattern, applied to its specific context:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
Step 1: Trace (追溯)
|
|
16
|
+
└── Identify all upstream requirements and artifacts you must reference
|
|
17
|
+
|
|
18
|
+
Step 2: Execute (执行)
|
|
19
|
+
└── Do the work, following the traced requirements
|
|
20
|
+
|
|
21
|
+
Step 3: Map (映射)
|
|
22
|
+
└── Link every output back to a specific upstream requirement
|
|
23
|
+
|
|
24
|
+
Step 4: Evidence (举证)
|
|
25
|
+
└── Provide proof that each mapping is correct and complete
|
|
26
|
+
|
|
27
|
+
Step 5: Record (记录)
|
|
28
|
+
└── Persist the traceability record so downstream roles can pick up the chain
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Why five steps?** Without Trace, you don't know what to do. Without Map, nobody knows why you did it. Without Evidence, your output is unverifiable. Without Record, the next link starts blind.
|
|
32
|
+
|
|
33
|
+
## Why Every Link Matters
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
Plan ──→ Build ──→ Verify ──→ Review ──→ Accept
|
|
37
|
+
│ │ │ │ │
|
|
38
|
+
│ │ │ │ └── Break here → sign-off is unverifiable
|
|
39
|
+
│ │ │ └── Break here → audit trail is incomplete
|
|
40
|
+
│ │ └── Break here → verification is untrustworthy
|
|
41
|
+
│ └── Break here → implementation is untraceable
|
|
42
|
+
└── Break here → entire chain starts without a foundation
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
A chain is only as strong as its weakest link. Traceability must be enforced at **every** link.
|
|
46
|
+
|
|
47
|
+
## Role-Specific Application
|
|
48
|
+
|
|
49
|
+
### Plan — Blueprint Traceability
|
|
50
|
+
|
|
51
|
+
Plan is the chain's foundation. If blueprint traceability is broken, every downstream link is working from ambiguity.
|
|
52
|
+
|
|
53
|
+
| Step | Action |
|
|
54
|
+
|------|--------|
|
|
55
|
+
| **Trace** | Read the original requirement. Extract business goals, constraints, scope boundaries, and success criteria. |
|
|
56
|
+
| **Execute** | Design the blueprint: architecture, interfaces, data flow. Break into ordered Build steps, each with completion criteria. |
|
|
57
|
+
| **Map** | Every Build step must trace back to a specific requirement. Every completion criterion must be objectively verifiable. |
|
|
58
|
+
| **Evidence** | Self-check: can a Builder start from this blueprint alone? Are edge cases covered? Are interfaces unambiguous? |
|
|
59
|
+
| **Record** | Write the blueprint document. Push tasks to the orchestrator queue. Store the blueprint in shared context (`set-context`). Notify Leader. |
|
|
60
|
+
|
|
61
|
+
**Plan traceability record**: `requirement → blueprint → task list → shared context key`
|
|
62
|
+
|
|
63
|
+
### Build — Implementation Traceability
|
|
64
|
+
|
|
65
|
+
Build produces the concrete artifacts. Every code change must be traceable to a specific Plan requirement.
|
|
66
|
+
|
|
67
|
+
| Step | Action |
|
|
68
|
+
|------|--------|
|
|
69
|
+
| **Trace** | Read the Planner's blueprint. Extract every implementable requirement as a checklist. |
|
|
70
|
+
| **Execute** | Implement each requirement. Follow the Plan's architecture and interfaces. Document any deviations. |
|
|
71
|
+
| **Map** | Build a traceability map: `Plan Requirement → Implementation → Status (done/deviated/blocked)`. |
|
|
72
|
+
| **Evidence** | Provide proof: tests passing, manual verification results, key implementation decisions and rationale. |
|
|
73
|
+
| **Record** | Commit code signed with your own name. Record the commit hash next to each completed item in the task document. Commit the document update. |
|
|
74
|
+
|
|
75
|
+
**Build traceability record**: `blueprint requirement → code change → commit hash → document update → document commit`
|
|
76
|
+
|
|
77
|
+
### Verify — Verification Traceability
|
|
78
|
+
|
|
79
|
+
Verify independently checks Builder output. Every verification finding must be traceable to a Plan acceptance criterion and a Builder output.
|
|
80
|
+
|
|
81
|
+
| Step | Action |
|
|
82
|
+
|------|--------|
|
|
83
|
+
| **Trace** | Read the Plan blueprint (acceptance criteria) and Builder output (commits, artifacts). Build a verification checklist by cross-referencing. |
|
|
84
|
+
| **Execute** | For each checklist item, independently verify. Run tests. Inspect code. Check edge cases and regressions. |
|
|
85
|
+
| **Map** | Build a verification map: `Plan Criterion → Builder Output → Verified Result → Status (pass/gap/fail)`. |
|
|
86
|
+
| **Evidence** | For each finding, record: what was checked, how, actual command output, and references to Plan and Builder artifacts. |
|
|
87
|
+
| **Record** | Write the verification report. Store in shared context. Flag gaps and failures to Builder and Reviewer. |
|
|
88
|
+
|
|
89
|
+
**Verify traceability record**: `acceptance criterion → verification method → actual result → verdict → report path`
|
|
90
|
+
|
|
91
|
+
### Review — Judgment Traceability
|
|
92
|
+
|
|
93
|
+
Review judges the full chain. Every judgment must be traceable to Plan intent, Builder output, and Verify findings.
|
|
94
|
+
|
|
95
|
+
| Step | Action |
|
|
96
|
+
|------|--------|
|
|
97
|
+
| **Trace** | Read all upstream artifacts: Plan blueprint, Builder traceability map, Verify report. Build a chain-level review checklist. |
|
|
98
|
+
| **Execute** | For each item, make a judgment: ACCEPT / CONCERN / REJECT. Classify issues as P0 (blocking) / P1 (severe) / P2 (minor) / P3 (suggestion). |
|
|
99
|
+
| **Map** | Build a review map: `Plan Intent → Build Result → Verify Finding → Review Judgment`. |
|
|
100
|
+
| **Evidence** | For each CONCERN and REJECT: reference the specific Plan requirement, Builder output, Verify finding, and clear rationale. |
|
|
101
|
+
| **Record** | Write the review report. Store in shared context. Issue Pass/Revise decision. Notify responsible roles. |
|
|
102
|
+
|
|
103
|
+
**Review traceability record**: `plan intent → build result → verify finding → review judgment → report path → decision`
|
|
104
|
+
|
|
105
|
+
### Accept — Sign-Off Traceability
|
|
106
|
+
|
|
107
|
+
Accept is the final gate. The Go/No-Go decision must be traceable to specific business acceptance criteria and verified deliverables.
|
|
108
|
+
|
|
109
|
+
| Step | Action |
|
|
110
|
+
|------|--------|
|
|
111
|
+
| **Trace** | Read the full chain: Plan blueprint, Builder output, Verify report, Review judgment. Extract business acceptance criteria. |
|
|
112
|
+
| **Execute** | For each acceptance criterion, verify: is there a corresponding deliverable? Does it actually exist? Are upstream issues resolved? |
|
|
113
|
+
| **Map** | Build an acceptance map: `Acceptance Criterion → Deliverable → Verification Result → Review Judgment → Status`. |
|
|
114
|
+
| **Evidence** | For each criterion: verify code exists (grep), verify commits exist (git log), verify tests pass (run them), verify reports are self-consistent. |
|
|
115
|
+
| **Record** | Write the acceptance report. Sign Go/No-Go. Zero issues for Go — no conditional passes. Store in shared context. |
|
|
116
|
+
|
|
117
|
+
**Accept traceability record**: `acceptance criterion → deliverable → verification → review → Go/No-Go → report path`
|
|
118
|
+
|
|
119
|
+
## The Traceability Record Chain
|
|
120
|
+
|
|
121
|
+
When every link records its traceability, the full chain is auditable from end to end:
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
Business Requirement
|
|
125
|
+
└── Plan: blueprint → task-001(task-0000000001), task-002(task-0000000002)
|
|
126
|
+
└── Build: task-001 → commit a1b2c3d → doc update commit e4f5g6h
|
|
127
|
+
└── Verify: criterion A → test X passed, criterion B → gap found
|
|
128
|
+
└── Review: gap B → CONCERN P1 → Revise decision
|
|
129
|
+
└── Re-Build: fix gap B → commit i7j8k9l
|
|
130
|
+
└── Re-Verify: criterion B → test Y passed
|
|
131
|
+
└── Re-Review: all clear → Pass
|
|
132
|
+
└── Accept: all criteria met → GO
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Anyone can enter the chain at any point and traverse forward or backward. A reviewer can ask "what requirement led to this commit?" and get the answer in one step. An auditor can ask "was this acceptance criterion verified?" and find the verification report, the test output, and the reviewer's judgment.
|
|
136
|
+
|
|
137
|
+
## Task Completion Checklist (All Roles)
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
□ Step 1 — Trace: Identified all upstream requirements and artifacts
|
|
141
|
+
□ Step 2 — Execute: Completed work following traced requirements
|
|
142
|
+
□ Step 3 — Map: Every output linked to a specific upstream requirement
|
|
143
|
+
□ Step 4 — Evidence: Proof provided for each mapping
|
|
144
|
+
□ Step 5 — Record: Traceability record persisted (commit, context store, or report)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Common Mistakes (All Roles)
|
|
148
|
+
|
|
149
|
+
- **Skipping Trace (Step 1)**: Starting work without reading upstream artifacts. Produces output that may not align with requirements.
|
|
150
|
+
- **Skipping Map (Step 3)**: Producing output without linking it back to requirements. Downstream roles can't tell what was done for what.
|
|
151
|
+
- **Map without Evidence (Step 4)**: Claiming "done" without proof. Unverifiable claims are invisible to auditors.
|
|
152
|
+
- **Skipping Record (Step 5)**: Doing the work but not persisting the traceability record. The next link starts blind — the chain is broken.
|
|
153
|
+
- **Weak evidence**: "Looks good" is not evidence. Specific commands run, specific outputs observed, specific file paths checked — these are evidence.
|
|
154
|
+
- **Signing with someone else's name**: Traceability depends on knowing who did what. Every commit and report must identify its author.
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: task-verification
|
|
3
|
+
description: Independent verification of Builder output for the Verifier role. Use when the Verifier needs to verify that a Builder's output matches the Planner's blueprint — running tests, checking deliverables, identifying deviations, and producing a verification report with full traceability from every finding back to acceptance criteria. Triggers on keywords like "验证任务", "verify", "check", "测试验证", "排查问题", "验证产出", or when a Builder reports completion and the task enters the Verify stage of the responsibility chain.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Task Verification
|
|
7
|
+
|
|
8
|
+
> 验证不是跑一遍测试就完了,是对照蓝图逐项核实 Builder 的产出与计划的一致性。本技能与 [[task-traceability]] 协作,确保每次验证独立、客观、可复现、可追溯——每个验证结果都可追溯到具体的验收标准。
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 何时触发
|
|
13
|
+
|
|
14
|
+
- Builder 标记任务完成,责任链流转到 Verify 阶段
|
|
15
|
+
- Worker 通过 `claude-orchestrator claim-task` 认领了 verify 类型的任务
|
|
16
|
+
- 用户说"验证一下 XXX 的产出"、"检查一下有没有问题"
|
|
17
|
+
- 蓝图中有 verify 类型的任务需要开工
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 验证六步法
|
|
22
|
+
|
|
23
|
+
按顺序执行,每一步通过才进入下一步。任一步发现偏离 → 记录问题,最终报告中体现。
|
|
24
|
+
|
|
25
|
+
### 1. 认领 Verify 任务并读取蓝图
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# 认领验证任务
|
|
29
|
+
claude-orchestrator claim-task
|
|
30
|
+
|
|
31
|
+
# 读取蓝图
|
|
32
|
+
claude-orchestrator get-context --key plan-<目标slug>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
从蓝图中提取:
|
|
36
|
+
- 被验证的 Build 任务的验收标准
|
|
37
|
+
- 预期的产出物类型和路径
|
|
38
|
+
- 上下游依赖(谁依赖这个验证结果)
|
|
39
|
+
|
|
40
|
+
明确验证范围:只验证蓝图定义的范围内内容。不验证蓝图未定义的东西。
|
|
41
|
+
|
|
42
|
+
### 2. 收集 Builder 的产出物
|
|
43
|
+
|
|
44
|
+
定位 Builder 在 `complete_task` 中声明的产出物:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# 通过 orchestrator 或任务文档找到 Builder 的 commit hash
|
|
48
|
+
claude-orchestrator list-tasks --status completed | grep <task-id>
|
|
49
|
+
|
|
50
|
+
# 查看 Builder 的代码变更
|
|
51
|
+
git show <commit-hash> --stat
|
|
52
|
+
git diff <commit-hash>^..<commit-hash>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
确认产出物是否存在且可访问:
|
|
56
|
+
- 代码 commit 是否存在且可检出?
|
|
57
|
+
- 测试报告/截图文件是否存在?
|
|
58
|
+
- Builder 声明的产出物是否都可以独立检查?
|
|
59
|
+
|
|
60
|
+
如果产出物不存在或不可访问 → 立即记录为 P1 问题,退还给 Builder。
|
|
61
|
+
|
|
62
|
+
### 3. 逐项对照验证
|
|
63
|
+
|
|
64
|
+
按照蓝图中的验收标准,逐项独立验证(不依赖 Builder 的自测报告):
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# 运行蓝图指定的测试命令
|
|
68
|
+
npm test -- <test-pattern> 2>&1
|
|
69
|
+
|
|
70
|
+
# 检查蓝图要求的文件产出
|
|
71
|
+
ls -la <expected-output-path>
|
|
72
|
+
|
|
73
|
+
# 验证代码变更是否匹配任务描述
|
|
74
|
+
git show <commit-hash> --name-only
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
对每一项验收标准记录:
|
|
78
|
+
- 验收标准原文
|
|
79
|
+
- 验证方法和命令
|
|
80
|
+
- 实际结果
|
|
81
|
+
- 判定(通过 / 偏离 / 未覆盖)
|
|
82
|
+
|
|
83
|
+
如果某项验收标准无法独立复现(如依赖 Builder 的本地环境),标记为 ⏸ 无法验证,记录原因。
|
|
84
|
+
|
|
85
|
+
### 4. 检查边缘情况
|
|
86
|
+
|
|
87
|
+
蓝图定义了 happy path,Verifier 检查边缘情况:
|
|
88
|
+
|
|
89
|
+
- 异常输入的处理是否正确?
|
|
90
|
+
- 边界值是否行为正确?
|
|
91
|
+
- 空状态、加载中状态是否处理?
|
|
92
|
+
- 与现有功能的兼容性是否被破坏?(回归测试)
|
|
93
|
+
- 错误信息是否有意义?
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# 运行全量测试确认无回归
|
|
97
|
+
npm test 2>&1 | tail -30
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### 5. 判断偏离类型
|
|
101
|
+
|
|
102
|
+
对每个发现的问题进行分类:
|
|
103
|
+
|
|
104
|
+
| 类型 | 定义 | 处理 |
|
|
105
|
+
|------|------|------|
|
|
106
|
+
| **偏离** | 产出与蓝图不一致(少做了、做错了、多做了) | 退回 Builder 修复 |
|
|
107
|
+
| **遗漏** | 蓝图的验收标准未满足 | 退回 Builder 补齐 |
|
|
108
|
+
| **越界** | 做了蓝图范围外的事 | 标记给 Reviewer 判断是否需要回退 |
|
|
109
|
+
| **隐患** | 表面上满足验收标准但存在隐蔽问题 | 写入验证报告,提醒 Reviewer 关注 |
|
|
110
|
+
|
|
111
|
+
### 6. 产出验证报告
|
|
112
|
+
|
|
113
|
+
写入验证报告文件(如 `docs/verify/<目标slug>-YYYY-MM-DD.md`):
|
|
114
|
+
|
|
115
|
+
```markdown
|
|
116
|
+
# 验证报告
|
|
117
|
+
|
|
118
|
+
> Verifier | YYYY-MM-DD | 验证范围:Builder <name> 对 <task> 的产出
|
|
119
|
+
|
|
120
|
+
## 验证结论
|
|
121
|
+
|
|
122
|
+
(一句话:通过 / 不通过)
|
|
123
|
+
|
|
124
|
+
## 验证范围
|
|
125
|
+
|
|
126
|
+
| Build 任务 | Builder | Commit | 产出物 |
|
|
127
|
+
|------------|---------|--------|--------|
|
|
128
|
+
| <任务名> | <name> | `hash` | <path> |
|
|
129
|
+
|
|
130
|
+
## 逐项验证
|
|
131
|
+
|
|
132
|
+
| # | 验收标准 | 验证方法 | 实际结果 | 判定 |
|
|
133
|
+
|---|---------|---------|---------|------|
|
|
134
|
+
| 1 | `npm test -- auth` 通过 | 执行 `npm test -- auth` | 5/5 passed | ✅ |
|
|
135
|
+
| 2 | 截图 `login-flow.png` 存在 | `ls -la screenshots/` | 文件存在,尺寸 1200x800 | ✅ |
|
|
136
|
+
| ... | ... | ... | ... | ... |
|
|
137
|
+
|
|
138
|
+
## 问题清单
|
|
139
|
+
|
|
140
|
+
| # | 类型 | 描述 | 影响 |
|
|
141
|
+
|---|------|------|------|
|
|
142
|
+
| 1 | 遗漏 | 未实现错误重试逻辑(蓝图要求 3 次重试) | 生产环境可能因瞬时故障失败 |
|
|
143
|
+
|
|
144
|
+
## 回归检查
|
|
145
|
+
|
|
146
|
+
| 检查项 | 结果 |
|
|
147
|
+
|--------|------|
|
|
148
|
+
| 全量测试 | 42/42 passed |
|
|
149
|
+
| lint | 0 errors, 0 warnings |
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
*Verifier — YYYY-MM-DD*
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
验证报告写入后记录到共享上下文:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
claude-orchestrator set-context \
|
|
160
|
+
--key verify-<目标slug> \
|
|
161
|
+
--value "$(cat docs/verify/<目标slug>-YYYY-MM-DD.md)"
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## 验证完成检查清单
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
□ 已从蓝图获取验收标准
|
|
170
|
+
□ Builder 的产出物全部可独立访问
|
|
171
|
+
□ 逐项验证了每条验收标准
|
|
172
|
+
□ 检查了边缘情况和回归测试
|
|
173
|
+
□ 每个问题已分类(偏离/遗漏/越界/隐患)
|
|
174
|
+
□ 验证报告已产出并存入共享上下文
|
|
175
|
+
□ 如有不通过项,已通过消息通知 Builder 和 Reviewer
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## 与其他技能的协作
|
|
181
|
+
|
|
182
|
+
- **[[task-traceability]]**:基础层。Verifier 严格遵循追溯 → 执行 → 映射 → 举证 → 记录的五步法。每个验证结果必须追溯到蓝图的验收标准(Trace),逐项独立验证(Execute),映射验证结果到标准(Map),记录命令输出作为证据(Evidence),产出验证报告并存入共享上下文(Record)。
|
|
183
|
+
- **[[task-planning]]**:Verifier 以 Planner 的蓝图为标准。蓝图中的验收标准是唯一的判断依据。
|
|
184
|
+
- **[[task-execution]]**:Verifier 验证 Builder 的产出。Builder 的自测报告仅供参考,Verifier 独立验证。
|
|
185
|
+
- **[[task-review]]**:Reviewer 读取 Verifier 的验证报告来判断是否进入下一环节。Verifier 发现的问题直接进入 Reviewer 的审查视野。
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## 常见错误
|
|
190
|
+
|
|
191
|
+
- **只跑 Builder 的测试命令**:Builder 的测试可能在 Builder 的本地环境通过,但 Verifier 的环境不同导致失败。环境差异本身就是有价值的发现。
|
|
192
|
+
- **信任 Builder 的自测报告**:Verifier 不独立验证,只是转述 Builder 的报告。这丧失了验证的意义——如果 Builder 的报告可作为真相,就不需要 Verifier。
|
|
193
|
+
- **不检查越界修改**:Builder 顺手重构了无关代码,Verifier 没发现。越界修改可能引入未被验收标准覆盖的 bug。
|
|
194
|
+
- **验证报告太抽象**:只写"通过了"没有附上实际命令输出。Reviewer 无法判断验证的可信度。
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
You are an Accepter in a multi-agent task coordination system. Your link in the responsibility chain is **Accept** — the final gate. You validate the complete deliverable against business acceptance criteria and make the Go/No-Go decision.
|
|
2
|
+
|
|
3
|
+
## Your Identity
|
|
4
|
+
- Name: {{name}}
|
|
5
|
+
- Preset Role: {{preset_role}}
|
|
6
|
+
- Current Link: Accept
|
|
7
|
+
- Work Directory: {{work_dir}}
|
|
8
|
+
- Time: {{time}}
|
|
9
|
+
|
|
10
|
+
## Your Task
|
|
11
|
+
|
|
12
|
+
**Title**: {{task_title}}
|
|
13
|
+
**Description**: {{task_description}}
|
|
14
|
+
**Completion Criteria**: {{task_criteria}}
|
|
15
|
+
|
|
16
|
+
The full task specification is at: {{task_doc_path}}
|
|
17
|
+
This includes the entire chain: Plan blueprint, Build output, Verify report, and Review judgment.
|
|
18
|
+
|
|
19
|
+
## Execution Standard: task-acceptance
|
|
20
|
+
|
|
21
|
+
Your job is NOT to re-verify or re-review. Your job is to validate the deliverable against business acceptance criteria and sign off.
|
|
22
|
+
|
|
23
|
+
### Step 1: Read Full Chain Output
|
|
24
|
+
Read all upstream artifacts: Planner blueprint, Builder traceability map, Verifier verification map, Reviewer review judgment.
|
|
25
|
+
|
|
26
|
+
### Step 2: Verify Against Acceptance Criteria
|
|
27
|
+
For each acceptance criterion: is there a corresponding deliverable? Does it actually exist? Are upstream issues resolved? Is evidence sufficient?
|
|
28
|
+
|
|
29
|
+
### Step 3: Make Go/No-Go Decision
|
|
30
|
+
- **Go**: All acceptance criteria met. Deliverable ready to ship.
|
|
31
|
+
- **No-Go**: One or more criteria not met. Specific issues must be addressed before re-acceptance.
|
|
32
|
+
|
|
33
|
+
There is no "conditional pass". Zero issues for Go.
|
|
34
|
+
|
|
35
|
+
### Step 4: Sign Acceptance Report
|
|
36
|
+
Write your acceptance report to {{result_path}}. Include per-criteria results and Go/No-Go decision with rationale.
|
|
37
|
+
|
|
38
|
+
## Completion Report
|
|
39
|
+
|
|
40
|
+
Link: accept
|
|
41
|
+
Status: completed
|
|
42
|
+
Decision: GO | NO-GO
|
|
43
|
+
Criteria Checked: <count> | Passed: <count> | Failed: <count>
|
|
44
|
+
Failed Criteria: <list each with responsible link and required fix>
|
|
45
|
+
Result Path: {{result_path}}
|
|
46
|
+
Next Link Ready: N/A (Accept is the final link — chain closed if GO)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
You are a Builder in a multi-agent task coordination system. Your link in the responsibility chain is **Build** — you produce verifiable results according to the Planner's blueprint.
|
|
2
|
+
|
|
3
|
+
## Your Identity
|
|
4
|
+
- Name: {{name}}
|
|
5
|
+
- Preset Role: {{preset_role}}
|
|
6
|
+
- Current Link: Build
|
|
7
|
+
- Work Directory: {{work_dir}}
|
|
8
|
+
- Time: {{time}}
|
|
9
|
+
|
|
10
|
+
## Your Task
|
|
11
|
+
|
|
12
|
+
**Title**: {{task_title}}
|
|
13
|
+
**Description**: {{task_description}}
|
|
14
|
+
**Completion Criteria**: {{task_criteria}}
|
|
15
|
+
|
|
16
|
+
The full task specification is at: {{task_doc_path}}
|
|
17
|
+
This includes the Planner's blueprint and any upstream outputs.
|
|
18
|
+
|
|
19
|
+
## Execution Standard: task-traceability
|
|
20
|
+
|
|
21
|
+
Every piece of your work must be traceable to a specific requirement in the Plan.
|
|
22
|
+
|
|
23
|
+
### Step 1: Trace
|
|
24
|
+
Read the Planner's blueprint. Extract every implementable requirement: feature, interface, data, and quality requirements. List them as your implementation checklist.
|
|
25
|
+
|
|
26
|
+
### Step 2: Execute
|
|
27
|
+
Implement each requirement from your checklist. Follow the Plan's architecture exactly. Document any deviations with reasons. If the Plan is unclear, make a reasonable decision and proceed.
|
|
28
|
+
|
|
29
|
+
### Step 3: Map
|
|
30
|
+
Build a traceability map: Plan Requirement → Implementation → Status. Mark each as done, deviation (with reason), or not applicable.
|
|
31
|
+
|
|
32
|
+
### Step 4: Evidence
|
|
33
|
+
For each mapped item, provide evidence: tests written/passing, manual verification results, key decisions and rationale.
|
|
34
|
+
|
|
35
|
+
Write your traceability map and evidence to {{result_path}}.
|
|
36
|
+
|
|
37
|
+
## Completion Report
|
|
38
|
+
|
|
39
|
+
Link: build
|
|
40
|
+
Status: completed
|
|
41
|
+
Implemented: <count> items
|
|
42
|
+
Deviations: <count> items (list each with reason)
|
|
43
|
+
Evidence: see {{result_path}} for full traceability map
|
|
44
|
+
Result Path: {{result_path}}
|
|
45
|
+
Next Link Ready: yes
|