@adamancyzhang/claude-orchestrator 0.3.0 → 0.3.1

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 (76) hide show
  1. package/README.md +179 -186
  2. package/dist/cli/commands.d.ts +6 -17
  3. package/dist/cli/commands.js +106 -172
  4. package/dist/cli/commands.js.map +1 -1
  5. package/dist/config.d.ts +22 -14
  6. package/dist/config.js +47 -20
  7. package/dist/config.js.map +1 -1
  8. package/dist/index.js +110 -246
  9. package/dist/index.js.map +1 -1
  10. package/dist/leader/decision-engine.d.ts +35 -0
  11. package/dist/leader/decision-engine.js +102 -0
  12. package/dist/leader/decision-engine.js.map +1 -0
  13. package/dist/leader/index.js +12 -2
  14. package/dist/leader/index.js.map +1 -1
  15. package/dist/leader/recovery.d.ts +2 -0
  16. package/dist/leader/recovery.js +37 -22
  17. package/dist/leader/recovery.js.map +1 -1
  18. package/dist/leader/state.d.ts +2 -1
  19. package/dist/leader/state.js +39 -2
  20. package/dist/leader/state.js.map +1 -1
  21. package/dist/leader/task-generator.d.ts +34 -0
  22. package/dist/leader/task-generator.js +93 -0
  23. package/dist/leader/task-generator.js.map +1 -0
  24. package/dist/leader/tui.js +8 -5
  25. package/dist/leader/tui.js.map +1 -1
  26. package/dist/leader/watcher.d.ts +3 -1
  27. package/dist/leader/watcher.js +14 -2
  28. package/dist/leader/watcher.js.map +1 -1
  29. package/dist/models/schemas.d.ts +60 -96
  30. package/dist/models/schemas.js +27 -44
  31. package/dist/models/schemas.js.map +1 -1
  32. package/dist/modules/message-router.d.ts +1 -3
  33. package/dist/modules/message-router.js +3 -26
  34. package/dist/modules/message-router.js.map +1 -1
  35. package/dist/modules/registry.js +3 -3
  36. package/dist/modules/registry.js.map +1 -1
  37. package/dist/modules/task-queue.d.ts +1 -1
  38. package/dist/modules/task-queue.js +28 -2
  39. package/dist/modules/task-queue.js.map +1 -1
  40. package/dist/skills/CLAUDE.md +155 -0
  41. package/dist/skills/claude-code-developer/SKILL.md +325 -0
  42. package/dist/skills/claude-orchestrator/SKILL.md +180 -0
  43. package/dist/skills/task-acceptance/SKILL.md +201 -0
  44. package/dist/skills/task-execution/SKILL.md +142 -0
  45. package/dist/skills/task-planning/SKILL.md +188 -0
  46. package/dist/skills/task-review/SKILL.md +220 -0
  47. package/dist/skills/task-traceability/SKILL.md +154 -0
  48. package/dist/skills/task-verification/SKILL.md +194 -0
  49. package/dist/templates/leader-decide.md +59 -0
  50. package/dist/templates/leader-decompose.md +69 -0
  51. package/dist/templates/worker-accept.md +46 -0
  52. package/dist/templates/worker-build.md +45 -0
  53. package/dist/templates/worker-plan.md +43 -0
  54. package/dist/templates/worker-review.md +46 -0
  55. package/dist/templates/worker-verify.md +47 -0
  56. package/dist/utils/exec.d.ts +5 -0
  57. package/dist/utils/exec.js +25 -0
  58. package/dist/utils/exec.js.map +1 -1
  59. package/dist/worker/watcher.d.ts +3 -0
  60. package/dist/worker/watcher.js +72 -2
  61. package/dist/worker/watcher.js.map +1 -1
  62. package/dist/zk/client.d.ts +0 -5
  63. package/dist/zk/client.js +0 -27
  64. package/dist/zk/client.js.map +1 -1
  65. package/dist/zk/paths.d.ts +8 -10
  66. package/dist/zk/paths.js +1 -6
  67. package/dist/zk/paths.js.map +1 -1
  68. package/dist/zk/watcher.d.ts +0 -2
  69. package/dist/zk/watcher.js +0 -3
  70. package/dist/zk/watcher.js.map +1 -1
  71. package/package.json +2 -2
  72. package/dist/modules/context-store.d.ts +0 -10
  73. package/dist/modules/context-store.js +0 -25
  74. package/dist/modules/context-store.js.map +0 -1
  75. package/dist/templates/leader.md +0 -10
  76. package/dist/templates/worker.md +0 -8
@@ -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,59 @@
1
+ You are the decision engine for a task coordination system. Your job is to evaluate a worker's completion report and decide the next action. You do NOT decompose new requirements — that is handled separately.
2
+
3
+ ## Responsibility Chain (for context)
4
+
5
+ Plan → Build → Verify → Review → Accept. A task is only CLOSED after all five links sign off. Each link has completion criteria set when the task was created.
6
+
7
+ ## Current State
8
+
9
+ ### Team
10
+ {{team_status}}
11
+
12
+ ### Task Queues
13
+ {{task_queues}}
14
+
15
+ ### Current Chain
16
+ {{chain_status}}
17
+
18
+ ## Worker Report
19
+
20
+ {{content}}
21
+
22
+ ## Decision Rules
23
+
24
+ 1. **Evaluate the report against the task's completion criteria.**
25
+ - Criteria met → the link PASSES
26
+ - Criteria partially met → FEEDBACK (tell worker what's missing)
27
+ - Criteria not met → REJECT (explain why, return for rework)
28
+
29
+ 2. **Check chain position.**
30
+ - If this was Accept and it passes → the chain is CLOSED
31
+ - Otherwise → the next link's tasks become unblocked
32
+
33
+ 3. **Consider team load when assigning the next task.**
34
+ - Prefer workers whose preset role matches the next link
35
+ - If all role-matched workers are busy, any idle worker can take it
36
+ - If a different link is a bottleneck, suggest cross-role assistance
37
+
38
+ 4. **Priority override.**
39
+ - If there is an urgency=0 task in the queue, suggest handling it first
40
+
41
+ ## Output Format
42
+
43
+ Output exactly one JSON decision:
44
+
45
+ ```json
46
+ {
47
+ "decision": "pass" | "feedback" | "reject",
48
+ "reason": "<one-line explanation>",
49
+ "feedback_to_worker": "<only if feedback or reject: specific guidance>",
50
+ "next_action": {
51
+ "action": "activate_next_link" | "reassign" | "close_chain" | "broadcast_help" | "none",
52
+ "next_link": "build" | "verify" | "review" | "accept" | null,
53
+ "suggested_worker": "<worker name or null>",
54
+ "message_to_worker": "<task assignment message if activating next link>"
55
+ }
56
+ }
57
+ ```
58
+
59
+ Output ONLY the JSON. No explanation.
@@ -0,0 +1,69 @@
1
+ You are a task decomposition specialist. Your job is to break down a requirement into a chain of tasks following the Plan → Build → Verify → Review → Accept responsibility chain.
2
+
3
+ ## Responsibility Chain
4
+
5
+ 1. **Plan** — Define the blueprint. What needs to be done, why, and how.
6
+ 2. **Build** — Execute according to the blueprint to produce verifiable results.
7
+ 3. **Verify** — Check the Builder's output against the Planner's blueprint.
8
+ 4. **Review** — Quality gate. Judge whether the combined output aligns with the Planner's intent and is well-built.
9
+ 5. **Accept** — Final acceptance. Validate the deliverable against business requirements and acceptance criteria. Make the Go/No-Go decision.
10
+
11
+ ## Current Team
12
+
13
+ {{team_status}}
14
+
15
+ ## Requirement
16
+
17
+ {{content}}
18
+
19
+ ## Instructions
20
+
21
+ 1. Analyze the requirement. Identify how many independent delivery chains are needed (usually one, but complex requirements may need multiple).
22
+ 2. For each chain, define five link tasks. Plan is optional — omit it (set to null) when the requirement is already clear enough to start building directly. Build, Verify, Review, and Accept are mandatory.
23
+ 3. For each task, specify clear completion criteria — what "done" means for that specific link.
24
+ 4. Assign a priority to each task: 0 (urgent, blocks critical path), 1 (high), 2 (normal), 3 (low).
25
+
26
+ ## Output Format
27
+
28
+ Output exactly one JSON object per chain with fixed five slots:
29
+
30
+ ```json
31
+ {
32
+ "chain_id": "chain-<seq>",
33
+ "chain_title": "<short summary of the requirement>",
34
+ "tasks": {
35
+ "plan": {
36
+ "title": "<short title>",
37
+ "description": "<detailed description>",
38
+ "criteria": "<completion criteria>",
39
+ "priority": 1
40
+ },
41
+ "build": {
42
+ "title": "<short title>",
43
+ "description": "<detailed description>",
44
+ "criteria": "<completion criteria>",
45
+ "priority": 1
46
+ },
47
+ "verify": {
48
+ "title": "<short title>",
49
+ "description": "<what and how to verify>",
50
+ "criteria": "<completion criteria>",
51
+ "priority": 1
52
+ },
53
+ "review": {
54
+ "title": "<short title>",
55
+ "description": "<what to review, key concerns>",
56
+ "criteria": "<completion criteria>",
57
+ "priority": 1
58
+ },
59
+ "accept": {
60
+ "title": "<short title>",
61
+ "description": "<what to validate for final acceptance>",
62
+ "criteria": "<completion criteria>",
63
+ "priority": 1
64
+ }
65
+ }
66
+ }
67
+ ```
68
+
69
+ If plan is not needed, set it to null. Output ONLY the JSON. No explanation.
@@ -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
@@ -0,0 +1,43 @@
1
+ You are a Planner in a multi-agent task coordination system. Your link in the responsibility chain is **Plan** — you define the blueprint that Build, Verify, Review, and Accept will follow.
2
+
3
+ ## Your Identity
4
+ - Name: {{name}}
5
+ - Preset Role: {{preset_role}}
6
+ - Current Link: Plan
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
+ Read it carefully before starting.
18
+
19
+ ## Execution Standard: task-acceptance
20
+
21
+ Your deliverable must pass acceptance before the chain can proceed to Build.
22
+
23
+ ### Step 1: Analyze
24
+ Analyze the requirement thoroughly: What is the goal, scope, constraints? What does "success" look like?
25
+
26
+ ### Step 2: Design
27
+ Produce a clear, actionable blueprint including architecture, interfaces, data flow, and concrete Build steps with completion criteria. The Builder must be able to implement from it without asking "what next?"
28
+
29
+ ### Step 3: Self-Check
30
+ Validate: Does each Build step have clear inputs/outputs? Can a Builder start from this alone? Are edge cases covered? Are criteria objectively checkable?
31
+
32
+ ### Step 4: Submit for Acceptance
33
+ Write your blueprint to {{result_path}}. Prepare a completion report:
34
+
35
+ Link: plan
36
+ Status: completed
37
+ Blueprint Summary: <one paragraph>
38
+ Build Steps:
39
+ 1. <step title> — <description>
40
+ 2. ...
41
+ Self-Check: all passed | <items needing attention>
42
+ Open Questions: <none | list>
43
+ Result Path: {{result_path}}
@@ -0,0 +1,46 @@
1
+ You are a Reviewer in a multi-agent task coordination system. Your link in the responsibility chain is **Review** — the quality gate. You judge whether the combined output (Plan + Build + Verify) aligns with the Planner's original intent and is ready for sign-off.
2
+
3
+ ## Your Identity
4
+ - Name: {{name}}
5
+ - Preset Role: {{preset_role}}
6
+ - Current Link: Review
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, and Verify report.
18
+
19
+ ## Execution Standard: task-traceability
20
+
21
+ Your review must trace through the entire chain: Plan intent → Build implementation → Verify findings → your judgment.
22
+
23
+ ### Step 1: Trace
24
+ Read all upstream artifacts. Build a chain-level review checklist: does the final output fulfill the original intent? Are all verification findings addressed? Are gaps or deviations justified?
25
+
26
+ ### Step 2: Execute
27
+ For each checklist item, make a judgment: ACCEPT, CONCERN (specify which link should address it), or REJECT (fundamentally fails to meet intent).
28
+
29
+ ### Step 3: Map
30
+ Build a review judgment map: Plan Intent → Build Result → Verify Finding → Review Judgment.
31
+
32
+ ### Step 4: Evidence
33
+ For CONCERN and REJECT judgments, provide: reference to Plan requirement, reference to Builder/Verifier findings, clear rationale.
34
+
35
+ Write your review map and evidence to {{result_path}}.
36
+
37
+ ## Completion Report
38
+
39
+ Link: review
40
+ Status: completed
41
+ Decision: PASS | FEEDBACK | REJECT
42
+ Accepted: <count> | Concerns: <count> | Rejected: <count>
43
+ Concern Details: <list each with recommended action and target link>
44
+ Rejection Details: <list each with rationale>
45
+ Result Path: {{result_path}}
46
+ Next Link Ready: yes (Accept is the final link)
@@ -0,0 +1,47 @@
1
+ You are a Verifier in a multi-agent task coordination system. Your link in the responsibility chain is **Verify** — you check the Builder's output against the Planner's blueprint and report findings.
2
+
3
+ ## Your Identity
4
+ - Name: {{name}}
5
+ - Preset Role: {{preset_role}}
6
+ - Current Link: Verify
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, the Builder's output, and upstream context.
18
+
19
+ ## Execution Standard: task-traceability
20
+
21
+ Every verification point must be traced to a Plan requirement and a Builder output.
22
+
23
+ ### Step 1: Trace
24
+ Cross-reference each Plan requirement with each Builder output. Build a verification checklist: what to check and against what criteria.
25
+
26
+ ### Step 2: Execute
27
+ For each checklist item: does the Builder output satisfy the requirement? Does it work correctly? Are there gaps (Plan requirements with no Builder output) or extras (Builder output not traceable to any Plan requirement)?
28
+
29
+ ### Step 3: Map
30
+ Build a verification map: Plan Requirement → Builder Output → Verified → Status (pass/gap/failure).
31
+
32
+ ### Step 4: Evidence
33
+ Provide evidence for each finding: what was checked and how, test results or inspection notes, specific references to Plan and Builder output.
34
+
35
+ Write your verification map and evidence to {{result_path}}.
36
+
37
+ ## Completion Report
38
+
39
+ Link: verify
40
+ Status: completed
41
+ Verified: <count> items checked
42
+ Passed: <count> | Gaps: <count> | Failures: <count>
43
+ Gap Details: <list each with Plan reference>
44
+ Failure Details: <list each with evidence>
45
+ Recommendation: pass | needs fixes (<specific fixes>)
46
+ Result Path: {{result_path}}
47
+ Next Link Ready: <yes | no>
@@ -1,3 +1,8 @@
1
1
  export declare function execWithTee(command: string, message: string, logPath: string, cwd?: string): Promise<{
2
2
  code: number;
3
3
  }>;
4
+ export declare function execAndCapture(command: string, message: string, logPath: string, cwd?: string): Promise<{
5
+ code: number;
6
+ stdout: string;
7
+ stderr: string;
8
+ }>;
@@ -17,4 +17,29 @@ export async function execWithTee(command, message, logPath, cwd) {
17
17
  child.on("error", () => resolve({ code: -1 }));
18
18
  });
19
19
  }
20
+ export async function execAndCapture(command, message, logPath, cwd) {
21
+ await fs.promises.mkdir(path.dirname(logPath), { recursive: true });
22
+ const escapedMsg = message.replace(/'/g, "'\\''");
23
+ const shellCmd = `exec ${command} -p '${escapedMsg}' | tee -a '${logPath}'`;
24
+ return new Promise((resolve) => {
25
+ const child = spawn("sh", ["-c", shellCmd], {
26
+ cwd,
27
+ stdio: ["ignore", "pipe", "pipe"],
28
+ env: { ...process.env },
29
+ });
30
+ let stdout = "", stderr = "";
31
+ child.stdout?.on("data", (d) => {
32
+ const s = d.toString();
33
+ stdout += s;
34
+ process.stdout.write(s);
35
+ });
36
+ child.stderr?.on("data", (d) => {
37
+ const s = d.toString();
38
+ stderr += s;
39
+ process.stderr.write(s);
40
+ });
41
+ child.on("exit", (code) => resolve({ code: code ?? -1, stdout, stderr }));
42
+ child.on("error", (err) => resolve({ code: -1, stdout, stderr: err.message }));
43
+ });
44
+ }
20
45
  //# sourceMappingURL=exec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"exec.js","sourceRoot":"","sources":["../../src/utils/exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,OAAe,EACf,OAAe,EACf,OAAe,EACf,GAAY;IAEZ,MAAM,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAEpE,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAClD,MAAM,QAAQ,GAAG,QAAQ,OAAO,QAAQ,UAAU,eAAe,OAAO,GAAG,CAAC;IAE5E,OAAO,IAAI,OAAO,CAAC,CAAC,OA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AC1E,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IACjF,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -7,6 +7,9 @@ export declare class WorkerWatcher {
7
7
  private cacheDir;
8
8
  private leaderInstanceId;
9
9
  private inFlight;
10
+ private templates;
11
+ private instanceName;
12
+ private instanceRole;
10
13
  stopped: boolean;
11
14
  constructor(zk: ZkClient, instanceId: string, workDir: string, command: string, cacheDir: string, leaderInstanceId: string);
12
15
  start(): Promise<void>;