@adamancyzhang/claude-orchestrator 0.3.3 → 0.4.0
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 +197 -269
- package/dist/cli/commands.d.ts +0 -10
- package/dist/cli/commands.js +1 -184
- package/dist/cli/commands.js.map +1 -1
- package/dist/config.d.ts +22 -0
- package/dist/config.js +23 -0
- package/dist/config.js.map +1 -1
- package/dist/executor/template.js +21 -3
- package/dist/executor/template.js.map +1 -1
- package/dist/index.js +9 -34
- package/dist/index.js.map +1 -1
- package/dist/leader/chain-router.d.ts +5 -1
- package/dist/leader/chain-router.js +90 -2
- package/dist/leader/chain-router.js.map +1 -1
- 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 +7 -0
- package/dist/leader/index.js +5 -2
- package/dist/leader/index.js.map +1 -1
- package/dist/leader/merge-validator.d.ts +24 -0
- package/dist/leader/merge-validator.js +112 -0
- package/dist/leader/merge-validator.js.map +1 -0
- package/dist/leader/state.d.ts +17 -0
- package/dist/leader/state.js +48 -2
- package/dist/leader/state.js.map +1 -1
- package/dist/leader/tui.d.ts +2 -0
- package/dist/leader/tui.js +140 -16
- package/dist/leader/tui.js.map +1 -1
- package/dist/leader/watcher.js +12 -0
- package/dist/leader/watcher.js.map +1 -1
- package/dist/models/schemas.d.ts +15 -0
- package/dist/models/schemas.js +5 -0
- package/dist/models/schemas.js.map +1 -1
- package/dist/orchestrator/run.d.ts +6 -0
- package/dist/orchestrator/run.js +181 -0
- package/dist/orchestrator/run.js.map +1 -0
- package/dist/skills/claude-orchestrator/SKILL.md +75 -217
- package/dist/templates/agents/worker-accept.md +48 -0
- package/dist/templates/agents/worker-build.md +38 -0
- package/dist/templates/agents/worker-decompose.md +40 -0
- package/dist/templates/agents/worker-evaluate.md +49 -0
- package/dist/templates/agents/worker-plan.md +36 -0
- package/dist/templates/agents/worker-review.md +42 -0
- package/dist/templates/agents/worker-verify.md +44 -0
- package/dist/templates/claude-memory/personal-claude-accepter.md +17 -0
- package/dist/templates/claude-memory/personal-claude-builder.md +24 -0
- package/dist/templates/claude-memory/personal-claude-planner.md +22 -0
- package/dist/templates/claude-memory/personal-claude-reviewer.md +25 -0
- package/dist/templates/claude-memory/personal-claude-verifier.md +24 -0
- package/dist/templates/claude-memory/team-claude.md +61 -0
- package/dist/utils/logger.d.ts +1 -0
- package/dist/utils/logger.js +3 -0
- package/dist/utils/logger.js.map +1 -1
- package/dist/worker/child-runner.d.ts +12 -0
- package/dist/worker/child-runner.js +99 -0
- package/dist/worker/child-runner.js.map +1 -0
- package/dist/worker/child.d.ts +2 -0
- package/dist/worker/child.js +8 -0
- package/dist/worker/child.js.map +1 -0
- package/dist/worker/commit-checker.d.ts +20 -0
- package/dist/worker/commit-checker.js +87 -0
- package/dist/worker/commit-checker.js.map +1 -0
- package/dist/worker/watcher.d.ts +5 -1
- package/dist/worker/watcher.js +41 -4
- package/dist/worker/watcher.js.map +1 -1
- package/dist/worker/worktree-initializer.d.ts +10 -0
- package/dist/worker/worktree-initializer.js +235 -0
- package/dist/worker/worktree-initializer.js.map +1 -0
- package/package.json +2 -2
- package/dist/templates/worker-accept.md +0 -46
- package/dist/templates/worker-build.md +0 -45
- package/dist/templates/worker-decompose.md +0 -67
- package/dist/templates/worker-evaluate.md +0 -41
- package/dist/templates/worker-plan.md +0 -43
- package/dist/templates/worker-review.md +0 -46
- package/dist/templates/worker-verify.md +0 -47
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import { execSync } from "node:child_process";
|
|
4
|
+
import { loadProjectWorktreeConfig, saveProjectWorktreeConfig } from "../config.js";
|
|
5
|
+
import { Logger } from "../utils/logger.js";
|
|
6
|
+
const BUILTIN_NAMES = [
|
|
7
|
+
"Tom", "Jerry", "Lucy", "Thomas", "Jack", "Lisa",
|
|
8
|
+
"Alice", "Bob", "Charlie", "Diana", "Edward", "Fiona",
|
|
9
|
+
"George", "Helen", "Ivan", "Julia", "Kevin", "Linda",
|
|
10
|
+
"Mike", "Nancy",
|
|
11
|
+
];
|
|
12
|
+
const ROLE_PRIORITY = ["planner", "builder", "verifier", "reviewer", "accepter"];
|
|
13
|
+
const logger = new Logger("WorktreeInit");
|
|
14
|
+
function assignRoles(count) {
|
|
15
|
+
if (count <= ROLE_PRIORITY.length) {
|
|
16
|
+
return ROLE_PRIORITY.slice(0, count);
|
|
17
|
+
}
|
|
18
|
+
const roles = [...ROLE_PRIORITY];
|
|
19
|
+
let remaining = count - ROLE_PRIORITY.length;
|
|
20
|
+
while (remaining > 0) {
|
|
21
|
+
roles.push("builder");
|
|
22
|
+
remaining--;
|
|
23
|
+
}
|
|
24
|
+
return roles;
|
|
25
|
+
}
|
|
26
|
+
export function getWorktreeBranch(name) {
|
|
27
|
+
return `claude-orchestrator/${name}-workspace`;
|
|
28
|
+
}
|
|
29
|
+
function execGit(args, cwd) {
|
|
30
|
+
try {
|
|
31
|
+
return execSync(`git ${args}`, { cwd, encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }).trim();
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return "";
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async function scanExistingNames(projectRoot) {
|
|
38
|
+
const used = new Set();
|
|
39
|
+
const wtDir = path.join(projectRoot, ".claude-orchestrator", "worktree");
|
|
40
|
+
// 1. Scan existing worktree directories
|
|
41
|
+
if (fs.existsSync(wtDir)) {
|
|
42
|
+
for (const entry of await fs.promises.readdir(wtDir)) {
|
|
43
|
+
used.add(entry);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// 2. Scan existing worktree branches
|
|
47
|
+
const branches = execGit("branch -a", projectRoot);
|
|
48
|
+
const wtBranchPattern = /claude-orchestrator\/(.+)-workspace/;
|
|
49
|
+
for (const line of branches.split("\n")) {
|
|
50
|
+
const m = line.trim().match(wtBranchPattern);
|
|
51
|
+
if (m)
|
|
52
|
+
used.add(m[1]);
|
|
53
|
+
}
|
|
54
|
+
// 3. Scan config.json worktree records
|
|
55
|
+
const worktreeConfig = loadProjectWorktreeConfig();
|
|
56
|
+
for (const name of Object.keys(worktreeConfig)) {
|
|
57
|
+
used.add(name);
|
|
58
|
+
}
|
|
59
|
+
return used;
|
|
60
|
+
}
|
|
61
|
+
function generateFallbackNames(count, used) {
|
|
62
|
+
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
63
|
+
const result = [];
|
|
64
|
+
for (const letter of alphabet) {
|
|
65
|
+
if (result.length >= count)
|
|
66
|
+
break;
|
|
67
|
+
for (const suffix of ["", "ay", "ee", "ie"]) {
|
|
68
|
+
if (result.length >= count)
|
|
69
|
+
break;
|
|
70
|
+
const candidate = `${letter}${suffix}`;
|
|
71
|
+
if (!used.includes(candidate)) {
|
|
72
|
+
result.push(candidate);
|
|
73
|
+
used.push(candidate);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return result;
|
|
78
|
+
}
|
|
79
|
+
function generateWorkerNames(count, usedNames) {
|
|
80
|
+
const roles = assignRoles(count);
|
|
81
|
+
const available = BUILTIN_NAMES.filter(n => !usedNames.has(n));
|
|
82
|
+
if (available.length >= count) {
|
|
83
|
+
return roles.map((role, i) => ({ name: available[i], role }));
|
|
84
|
+
}
|
|
85
|
+
const result = [];
|
|
86
|
+
for (let i = 0; i < Math.min(count, available.length); i++) {
|
|
87
|
+
result.push({ name: available[i], role: roles[i] });
|
|
88
|
+
}
|
|
89
|
+
const remaining = count - available.length;
|
|
90
|
+
const fallbackNames = generateFallbackNames(remaining, [...usedNames, ...available, ...result.map(r => r.name)]);
|
|
91
|
+
for (let i = 0; i < remaining; i++) {
|
|
92
|
+
result.push({ name: fallbackNames[i], role: roles[available.length + i] });
|
|
93
|
+
}
|
|
94
|
+
return result;
|
|
95
|
+
}
|
|
96
|
+
async function ensureWorktreeEnvironment(worktreePath, name, role) {
|
|
97
|
+
const projectRoot = path.resolve(worktreePath, "..", "..", "..");
|
|
98
|
+
const distTemplateDir = path.join(projectRoot, "dist", "templates");
|
|
99
|
+
const srcTemplateDir = path.join(projectRoot, "templates");
|
|
100
|
+
const templateDir = fs.existsSync(distTemplateDir) ? distTemplateDir : srcTemplateDir;
|
|
101
|
+
const agentsDir = path.join(worktreePath, ".claude-orchestrator", "agents");
|
|
102
|
+
if (fs.existsSync(templateDir)) {
|
|
103
|
+
// Copy agent templates
|
|
104
|
+
const templates = [
|
|
105
|
+
"worker-decompose.md", "worker-evaluate.md",
|
|
106
|
+
"worker-plan.md", "worker-build.md", "worker-verify.md",
|
|
107
|
+
"worker-review.md", "worker-accept.md",
|
|
108
|
+
];
|
|
109
|
+
for (const filename of templates) {
|
|
110
|
+
const src = path.join(templateDir, "agents", filename);
|
|
111
|
+
const dest = path.join(agentsDir, filename);
|
|
112
|
+
if (fs.existsSync(src) && !fs.existsSync(dest)) {
|
|
113
|
+
fs.mkdirSync(agentsDir, { recursive: true });
|
|
114
|
+
fs.copyFileSync(src, dest);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// Copy skills to worktree .claude/skills/
|
|
118
|
+
const distSkillsDir = path.join(projectRoot, "dist", "skills");
|
|
119
|
+
const srcSkillsDir = path.join(projectRoot, "skills");
|
|
120
|
+
const skillsSrcDir = fs.existsSync(distSkillsDir) ? distSkillsDir : srcSkillsDir;
|
|
121
|
+
const skillsDstDir = path.join(worktreePath, ".claude", "skills");
|
|
122
|
+
const SKILLS_TO_COPY = [
|
|
123
|
+
"task-traceability",
|
|
124
|
+
"task-planning",
|
|
125
|
+
"task-execution",
|
|
126
|
+
"task-verification",
|
|
127
|
+
"task-review",
|
|
128
|
+
"task-acceptance",
|
|
129
|
+
"claude-orchestrator",
|
|
130
|
+
];
|
|
131
|
+
if (fs.existsSync(skillsSrcDir)) {
|
|
132
|
+
for (const skillName of SKILLS_TO_COPY) {
|
|
133
|
+
const srcSkillPath = path.join(skillsSrcDir, skillName, "SKILL.md");
|
|
134
|
+
const dstSkillDir = path.join(skillsDstDir, skillName);
|
|
135
|
+
const dstSkillPath = path.join(dstSkillDir, "SKILL.md");
|
|
136
|
+
if (!fs.existsSync(srcSkillPath))
|
|
137
|
+
continue;
|
|
138
|
+
if (fs.existsSync(dstSkillDir)) {
|
|
139
|
+
fs.rmSync(dstSkillDir, { recursive: true, force: true });
|
|
140
|
+
}
|
|
141
|
+
fs.mkdirSync(dstSkillDir, { recursive: true });
|
|
142
|
+
fs.copyFileSync(srcSkillPath, dstSkillPath);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
// Copy team-level CLAUDE.md to worktree root
|
|
146
|
+
const teamClaudeSrc = path.join(templateDir, "claude-memory", "team-claude.md");
|
|
147
|
+
const teamClaudeDest = path.join(worktreePath, "CLAUDE.md");
|
|
148
|
+
if (fs.existsSync(teamClaudeSrc) && !fs.existsSync(teamClaudeDest)) {
|
|
149
|
+
fs.copyFileSync(teamClaudeSrc, teamClaudeDest);
|
|
150
|
+
}
|
|
151
|
+
// Copy personal CLAUDE.md for this role
|
|
152
|
+
const roleToPersonalTemplate = {
|
|
153
|
+
planner: "personal-claude-planner.md",
|
|
154
|
+
builder: "personal-claude-builder.md",
|
|
155
|
+
verifier: "personal-claude-verifier.md",
|
|
156
|
+
reviewer: "personal-claude-reviewer.md",
|
|
157
|
+
accepter: "personal-claude-accepter.md",
|
|
158
|
+
};
|
|
159
|
+
const personalSrc = path.join(templateDir, "claude-memory", roleToPersonalTemplate[role] ?? "personal-claude-builder.md");
|
|
160
|
+
const personalDir = path.join(worktreePath, ".claude-orchestrator", "docs", name);
|
|
161
|
+
const personalDest = path.join(personalDir, "CLAUDE.md");
|
|
162
|
+
if (fs.existsSync(personalSrc) && !fs.existsSync(personalDest)) {
|
|
163
|
+
fs.mkdirSync(personalDir, { recursive: true });
|
|
164
|
+
let content = fs.readFileSync(personalSrc, "utf-8");
|
|
165
|
+
content = content.replace(/\{\{name\}\}/g, name).replace(/\{\{role\}\}/g, role);
|
|
166
|
+
fs.writeFileSync(personalDest, content, "utf-8");
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
export async function initializeWorktrees(projectRoot, workerCount) {
|
|
171
|
+
const usedNames = await scanExistingNames(projectRoot);
|
|
172
|
+
const assignments = generateWorkerNames(workerCount, usedNames);
|
|
173
|
+
const configs = [];
|
|
174
|
+
const existingConfig = loadProjectWorktreeConfig();
|
|
175
|
+
const worktreeRoot = path.join(projectRoot, ".claude-orchestrator", "worktree");
|
|
176
|
+
for (const { name, role } of assignments) {
|
|
177
|
+
const existing = existingConfig[name];
|
|
178
|
+
const wtPath = path.join(worktreeRoot, name);
|
|
179
|
+
if (existing && fs.existsSync(wtPath)) {
|
|
180
|
+
configs.push({
|
|
181
|
+
name,
|
|
182
|
+
role: existing.role,
|
|
183
|
+
worktreePath: wtPath,
|
|
184
|
+
relativePath: `.claude-orchestrator/worktree/${name}`,
|
|
185
|
+
branch: getWorktreeBranch(name),
|
|
186
|
+
instanceId: existing.instance_id || crypto.randomUUID().replace(/-/g, ""),
|
|
187
|
+
});
|
|
188
|
+
logger.info(`Reusing existing worktree: ${name} (${role})`);
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
const relativePath = `.claude-orchestrator/worktree/${name}`;
|
|
192
|
+
const branch = getWorktreeBranch(name);
|
|
193
|
+
try {
|
|
194
|
+
await fs.promises.mkdir(worktreeRoot, { recursive: true });
|
|
195
|
+
const branchExists = execGit(`rev-parse --verify ${branch}`, projectRoot);
|
|
196
|
+
if (branchExists) {
|
|
197
|
+
execGit(`worktree add ${relativePath} ${branch}`, projectRoot);
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
execGit(`worktree add ${relativePath} -b ${branch}`, projectRoot);
|
|
201
|
+
}
|
|
202
|
+
const instanceId = crypto.randomUUID().replace(/-/g, "");
|
|
203
|
+
const wtConfigDir = path.join(wtPath, ".claude-orchestrator");
|
|
204
|
+
await fs.promises.mkdir(wtConfigDir, { recursive: true });
|
|
205
|
+
await fs.promises.writeFile(path.join(wtConfigDir, "config.json"), JSON.stringify({ name, role, instance_id: instanceId }, null, 2));
|
|
206
|
+
await ensureWorktreeEnvironment(wtPath, name, role);
|
|
207
|
+
if (fs.existsSync(path.join(wtPath, "package.json"))) {
|
|
208
|
+
logger.info(`Installing dependencies for ${name}...`);
|
|
209
|
+
try {
|
|
210
|
+
execSync("npm install", { cwd: wtPath, stdio: "inherit" });
|
|
211
|
+
}
|
|
212
|
+
catch {
|
|
213
|
+
logger.warn(`npm install failed for ${name}, continuing...`);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
configs.push({
|
|
217
|
+
name,
|
|
218
|
+
role,
|
|
219
|
+
worktreePath: wtPath,
|
|
220
|
+
relativePath,
|
|
221
|
+
branch,
|
|
222
|
+
instanceId,
|
|
223
|
+
});
|
|
224
|
+
logger.info(`Created worktree: ${name} (${role}) at ${relativePath}`);
|
|
225
|
+
}
|
|
226
|
+
catch (err) {
|
|
227
|
+
logger.error(`Failed to create worktree for ${name}`, err);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
if (configs.length > 0) {
|
|
231
|
+
saveProjectWorktreeConfig(configs);
|
|
232
|
+
}
|
|
233
|
+
return configs;
|
|
234
|
+
}
|
|
235
|
+
//# sourceMappingURL=worktree-initializer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktree-initializer.js","sourceRoot":"","sources":["../../src/worker/worktree-initializer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,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Q,YAAY,EAAE,CAAC,CAAC;QACxE,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,CAAC,KAAK,CAAC,iCAAiC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC;QAC7D,CAAC;IACH,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,yBAAyB,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adamancyzhang/claude-orchestrator",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Multi-agent orchestration CLI backed by ZooKeeper — register, assign tasks, communicate, share context",
|
|
5
5
|
"repository": "github:adamancyzhang/claude-orchestrator-server",
|
|
6
6
|
"license": "MIT",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"claude-orchestrator": "bin/claude-orchestrator"
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
|
-
"build": "rm -rf dist && tsc && cp -r
|
|
12
|
+
"build": "rm -rf dist && tsc && cp -r templates dist/templates && cp -r skills dist/skills",
|
|
13
13
|
"start": "node dist/index.js leader",
|
|
14
14
|
"prepublishOnly": "npm run build",
|
|
15
15
|
"test": "vitest run",
|
|
@@ -1,46 +0,0 @@
|
|
|
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)
|
|
@@ -1,45 +0,0 @@
|
|
|
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
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
You are {{name}}, a task decomposition specialist. Your role is {{preset_role}}. Break down the requirement below 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
|
-
## Requirement
|
|
12
|
-
|
|
13
|
-
{{task_description}}
|
|
14
|
-
|
|
15
|
-
## Instructions
|
|
16
|
-
|
|
17
|
-
1. Analyze the requirement. Identify how many independent delivery chains are needed (usually one, but complex requirements may need multiple).
|
|
18
|
-
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.
|
|
19
|
-
3. For each task, specify clear completion criteria — what "done" means for that specific link.
|
|
20
|
-
4. Assign a priority to each task: 0 (urgent), 1 (high), 2 (normal).
|
|
21
|
-
|
|
22
|
-
## Output Format
|
|
23
|
-
|
|
24
|
-
Output exactly one JSON object per chain. Write the result to {{result_path}}.
|
|
25
|
-
|
|
26
|
-
```json
|
|
27
|
-
{
|
|
28
|
-
"chain_id": "chain-<seq>",
|
|
29
|
-
"chain_title": "<short summary of the requirement>",
|
|
30
|
-
"tasks": {
|
|
31
|
-
"plan": {
|
|
32
|
-
"title": "<short title>",
|
|
33
|
-
"description": "<detailed description>",
|
|
34
|
-
"criteria": "<completion criteria>",
|
|
35
|
-
"priority": 1
|
|
36
|
-
},
|
|
37
|
-
"build": {
|
|
38
|
-
"title": "<short title>",
|
|
39
|
-
"description": "<detailed description>",
|
|
40
|
-
"criteria": "<completion criteria>",
|
|
41
|
-
"priority": 1
|
|
42
|
-
},
|
|
43
|
-
"verify": {
|
|
44
|
-
"title": "<short title>",
|
|
45
|
-
"description": "<what and how to verify>",
|
|
46
|
-
"criteria": "<completion criteria>",
|
|
47
|
-
"priority": 1
|
|
48
|
-
},
|
|
49
|
-
"review": {
|
|
50
|
-
"title": "<short title>",
|
|
51
|
-
"description": "<what to review, key concerns>",
|
|
52
|
-
"criteria": "<completion criteria>",
|
|
53
|
-
"priority": 1
|
|
54
|
-
},
|
|
55
|
-
"accept": {
|
|
56
|
-
"title": "<short title>",
|
|
57
|
-
"description": "<what to validate for final acceptance>",
|
|
58
|
-
"criteria": "<completion criteria>",
|
|
59
|
-
"priority": 1
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
If plan is not needed, set it to null. Output ONLY the JSON. No explanation.
|
|
66
|
-
|
|
67
|
-
After completing the decomposition, include the full JSON as your completion report so the Leader can mechanically create the tasks.
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
You are {{name}}, a self-evaluation specialist. Your role is {{preset_role}}. You just completed a task in the Plan → Build → Verify → Review → Accept responsibility chain. Evaluate your own output and decide the next action.
|
|
2
|
-
|
|
3
|
-
## Your Task
|
|
4
|
-
|
|
5
|
-
- **Link**: {{link}}
|
|
6
|
-
- **Title**: {{task_title}}
|
|
7
|
-
- **Description**: {{task_description}}
|
|
8
|
-
- **Completion Criteria**: {{task_criteria}}
|
|
9
|
-
|
|
10
|
-
## Your Result
|
|
11
|
-
|
|
12
|
-
The result of your work is at {{task_result_path}}. Review it objectively.
|
|
13
|
-
|
|
14
|
-
## Decision Rules
|
|
15
|
-
|
|
16
|
-
1. **Evaluate your output against the completion criteria.**
|
|
17
|
-
- Criteria fully met → `activate_next` (proceed to next link in the chain)
|
|
18
|
-
- Criteria partially met → `feedback` (describe what's missing so you or another worker can fix it)
|
|
19
|
-
- Criteria not met at all → `feedback` with clear explanation of what went wrong
|
|
20
|
-
|
|
21
|
-
2. **Check chain position.**
|
|
22
|
-
- If this was the Accept link and it passes → `close_chain`
|
|
23
|
-
- Otherwise → activate the next link
|
|
24
|
-
|
|
25
|
-
## Output Format
|
|
26
|
-
|
|
27
|
-
Output exactly one JSON decision. Write the result to {{result_path}}.
|
|
28
|
-
|
|
29
|
-
```json
|
|
30
|
-
{
|
|
31
|
-
"decision": "activate_next" | "feedback" | "close_chain",
|
|
32
|
-
"reason": "<one-line explanation of the evaluation>",
|
|
33
|
-
"feedback": "<only if feedback: specific guidance on what to improve>",
|
|
34
|
-
"nextLink": "<the next link to activate, e.g. build|verify|review|accept>",
|
|
35
|
-
"suggestedWorker": null
|
|
36
|
-
}
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
Output ONLY the JSON. No explanation.
|
|
40
|
-
|
|
41
|
-
After evaluating, include the full JSON decision as your completion report so the Leader can mechanically execute the decision.
|
|
@@ -1,43 +0,0 @@
|
|
|
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}}
|
|
@@ -1,46 +0,0 @@
|
|
|
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)
|
|
@@ -1,47 +0,0 @@
|
|
|
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>
|