agentrium 0.3.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 +181 -0
- package/dist/agents/architect.d.ts +2 -0
- package/dist/agents/architect.js +23 -0
- package/dist/agents/architect.js.map +1 -0
- package/dist/agents/base.d.ts +10 -0
- package/dist/agents/base.js +37 -0
- package/dist/agents/base.js.map +1 -0
- package/dist/agents/codeReviewer.d.ts +3 -0
- package/dist/agents/codeReviewer.js +32 -0
- package/dist/agents/codeReviewer.js.map +1 -0
- package/dist/agents/productManager.d.ts +2 -0
- package/dist/agents/productManager.js +23 -0
- package/dist/agents/productManager.js.map +1 -0
- package/dist/agents/qaEngineer.d.ts +2 -0
- package/dist/agents/qaEngineer.js +23 -0
- package/dist/agents/qaEngineer.js.map +1 -0
- package/dist/agents/registry.d.ts +3 -0
- package/dist/agents/registry.js +30 -0
- package/dist/agents/registry.js.map +1 -0
- package/dist/agents/reviewArbiter.d.ts +2 -0
- package/dist/agents/reviewArbiter.js +24 -0
- package/dist/agents/reviewArbiter.js.map +1 -0
- package/dist/agents/softwareEngineer.d.ts +2 -0
- package/dist/agents/softwareEngineer.js +23 -0
- package/dist/agents/softwareEngineer.js.map +1 -0
- package/dist/agents/technicalWriter.d.ts +2 -0
- package/dist/agents/technicalWriter.js +24 -0
- package/dist/agents/technicalWriter.js.map +1 -0
- package/dist/agents/types.d.ts +10 -0
- package/dist/agents/types.js +2 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/agents/uxDesigner.d.ts +2 -0
- package/dist/agents/uxDesigner.js +23 -0
- package/dist/agents/uxDesigner.js.map +1 -0
- package/dist/artifacts/store.d.ts +20 -0
- package/dist/artifacts/store.js +81 -0
- package/dist/artifacts/store.js.map +1 -0
- package/dist/cli/commands/init.d.ts +2 -0
- package/dist/cli/commands/init.js +44 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/run.d.ts +2 -0
- package/dist/cli/commands/run.js +67 -0
- package/dist/cli/commands/run.js.map +1 -0
- package/dist/cli/commands/runs.d.ts +2 -0
- package/dist/cli/commands/runs.js +37 -0
- package/dist/cli/commands/runs.js.map +1 -0
- package/dist/cli/commands/show.d.ts +4 -0
- package/dist/cli/commands/show.js +56 -0
- package/dist/cli/commands/show.js.map +1 -0
- package/dist/cli/commands/status.d.ts +2 -0
- package/dist/cli/commands/status.js +28 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/workspaces.d.ts +2 -0
- package/dist/cli/commands/workspaces.js +24 -0
- package/dist/cli/commands/workspaces.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.js +30 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/utils.d.ts +1 -0
- package/dist/cli/utils.js +28 -0
- package/dist/cli/utils.js.map +1 -0
- package/dist/context/configParser.d.ts +2 -0
- package/dist/context/configParser.js +109 -0
- package/dist/context/configParser.js.map +1 -0
- package/dist/context/contextBuilder.d.ts +2 -0
- package/dist/context/contextBuilder.js +39 -0
- package/dist/context/contextBuilder.js.map +1 -0
- package/dist/context/repoAnalyzer.d.ts +4 -0
- package/dist/context/repoAnalyzer.js +84 -0
- package/dist/context/repoAnalyzer.js.map +1 -0
- package/dist/context/types.d.ts +35 -0
- package/dist/context/types.js +2 -0
- package/dist/context/types.js.map +1 -0
- package/dist/pipeline/checkpoint.d.ts +4 -0
- package/dist/pipeline/checkpoint.js +62 -0
- package/dist/pipeline/checkpoint.js.map +1 -0
- package/dist/pipeline/pipeline.d.ts +7 -0
- package/dist/pipeline/pipeline.js +33 -0
- package/dist/pipeline/pipeline.js.map +1 -0
- package/dist/pipeline/runner.d.ts +15 -0
- package/dist/pipeline/runner.js +127 -0
- package/dist/pipeline/runner.js.map +1 -0
- package/dist/pipeline/types.d.ts +14 -0
- package/dist/pipeline/types.js +14 -0
- package/dist/pipeline/types.js.map +1 -0
- package/dist/review/process.d.ts +15 -0
- package/dist/review/process.js +149 -0
- package/dist/review/process.js.map +1 -0
- package/dist/review/types.d.ts +9 -0
- package/dist/review/types.js +16 -0
- package/dist/review/types.js.map +1 -0
- package/dist/workspace/manager.d.ts +7 -0
- package/dist/workspace/manager.js +63 -0
- package/dist/workspace/manager.js.map +1 -0
- package/package.json +51 -0
- package/prompts/architect.md +40 -0
- package/prompts/codeReviewerLogic.md +43 -0
- package/prompts/codeReviewerSecurity.md +43 -0
- package/prompts/productManager.md +29 -0
- package/prompts/qaEngineer.md +49 -0
- package/prompts/reviewArbiter.md +45 -0
- package/prompts/softwareEngineer.md +43 -0
- package/prompts/technicalWriter.md +40 -0
- package/prompts/uxDesigner.md +42 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
// src/review/process.ts
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import ora from "ora";
|
|
4
|
+
import { createAgentByName } from "../agents/registry.js";
|
|
5
|
+
import { parseVerdict } from "./types.js";
|
|
6
|
+
import { STAGE_ORDER } from "../pipeline/types.js";
|
|
7
|
+
const ARTIFACT_STAGES = ["intake", ...STAGE_ORDER];
|
|
8
|
+
export class ReviewProcess {
|
|
9
|
+
store;
|
|
10
|
+
runId;
|
|
11
|
+
workspaceContext;
|
|
12
|
+
maxIterations;
|
|
13
|
+
constructor(store, runId, workspaceContext, maxIterations) {
|
|
14
|
+
this.store = store;
|
|
15
|
+
this.runId = runId;
|
|
16
|
+
this.workspaceContext = workspaceContext;
|
|
17
|
+
this.maxIterations = maxIterations;
|
|
18
|
+
}
|
|
19
|
+
buildReviewContext() {
|
|
20
|
+
const sections = [this.workspaceContext];
|
|
21
|
+
for (const stage of ARTIFACT_STAGES) {
|
|
22
|
+
if (stage === "review")
|
|
23
|
+
break;
|
|
24
|
+
const artifact = this.store.readArtifact(this.runId, stage);
|
|
25
|
+
if (artifact) {
|
|
26
|
+
sections.push(`\n---\n\n## Previous Stage: ${stage}\n\n${artifact}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return sections.join("\n");
|
|
30
|
+
}
|
|
31
|
+
buildReviewTaskDescription(originalTask) {
|
|
32
|
+
return (`Original task: ${originalTask}\n\n` +
|
|
33
|
+
`Current stage: review\n\n` +
|
|
34
|
+
`Review the implementation and testing stages. ` +
|
|
35
|
+
`Produce your findings using the comment format specified in your instructions.`);
|
|
36
|
+
}
|
|
37
|
+
buildArbiterTaskDescription(logicFindings, securityFindings, originalTask) {
|
|
38
|
+
return (`Original task: ${originalTask}\n\n` +
|
|
39
|
+
`## Logic Reviewer Findings\n\n${logicFindings}\n\n` +
|
|
40
|
+
`## Security Reviewer Findings\n\n${securityFindings}\n\n` +
|
|
41
|
+
`Deduplicate, resolve conflicts, prioritize, and produce your verdict.`);
|
|
42
|
+
}
|
|
43
|
+
buildReworkTaskDescription(arbiterOutput, originalTask, reworkIteration) {
|
|
44
|
+
return (`Original task: ${originalTask}\n\n` +
|
|
45
|
+
`This is rework iteration ${reworkIteration} of ${this.maxIterations - 1}.\n\n` +
|
|
46
|
+
`The Review Arbiter requested changes. Address the mandatory fixes below:\n\n` +
|
|
47
|
+
`${arbiterOutput}\n\n` +
|
|
48
|
+
`Fix only what is listed. Do not make other changes.`);
|
|
49
|
+
}
|
|
50
|
+
buildContextForIteration(reviewIteration) {
|
|
51
|
+
const base = this.buildReviewContext();
|
|
52
|
+
if (reviewIteration === 1)
|
|
53
|
+
return base;
|
|
54
|
+
// Append rework outputs from the previous iteration so reviewers see updated code
|
|
55
|
+
const prevRework = reviewIteration - 1;
|
|
56
|
+
const reworkFix = this.store.readArtifact(this.runId, `rework_fix_v${prevRework}`);
|
|
57
|
+
const reworkQa = this.store.readArtifact(this.runId, `rework_qa_v${prevRework}`);
|
|
58
|
+
const sections = [base];
|
|
59
|
+
if (reworkFix) {
|
|
60
|
+
sections.push(`\n---\n\n## Rework Fix (iteration ${prevRework})\n\n${reworkFix}`);
|
|
61
|
+
}
|
|
62
|
+
if (reworkQa) {
|
|
63
|
+
sections.push(`\n---\n\n## Rework QA Verification (iteration ${prevRework})\n\n${reworkQa}`);
|
|
64
|
+
}
|
|
65
|
+
return sections.join("\n");
|
|
66
|
+
}
|
|
67
|
+
async run(originalTask) {
|
|
68
|
+
const reviewTaskDesc = this.buildReviewTaskDescription(originalTask);
|
|
69
|
+
for (let iteration = 1; iteration <= this.maxIterations; iteration++) {
|
|
70
|
+
const iterLabel = this.maxIterations > 1 ? ` (iteration ${iteration})` : "";
|
|
71
|
+
// Rebuild context each iteration so reviewers see the latest rework output
|
|
72
|
+
const context = this.buildContextForIteration(iteration);
|
|
73
|
+
// 1. Run two reviewers in parallel
|
|
74
|
+
const reviewSpinner = ora(`Running code reviewers in parallel${iterLabel}...`).start();
|
|
75
|
+
let logicResult;
|
|
76
|
+
let securityResult;
|
|
77
|
+
try {
|
|
78
|
+
[logicResult, securityResult] = await Promise.all([
|
|
79
|
+
createAgentByName("code-reviewer-logic").run(context, reviewTaskDesc),
|
|
80
|
+
createAgentByName("code-reviewer-security").run(context, reviewTaskDesc),
|
|
81
|
+
]);
|
|
82
|
+
reviewSpinner.succeed(`Code reviews complete${iterLabel}`);
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
reviewSpinner.fail(`Code reviews failed${iterLabel}`);
|
|
86
|
+
throw error;
|
|
87
|
+
}
|
|
88
|
+
// Save individual review artifacts
|
|
89
|
+
const reviewSuffix = iteration > 1 ? `_v${iteration}` : "";
|
|
90
|
+
this.store.saveArtifact(this.runId, `review_logic${reviewSuffix}`, logicResult.artifact);
|
|
91
|
+
this.store.saveArtifact(this.runId, `review_security${reviewSuffix}`, securityResult.artifact);
|
|
92
|
+
// 2. Run arbiter
|
|
93
|
+
const arbiterSpinner = ora(`Review Arbiter analyzing findings${iterLabel}...`).start();
|
|
94
|
+
let arbiterResult;
|
|
95
|
+
try {
|
|
96
|
+
const arbiterTaskDesc = this.buildArbiterTaskDescription(logicResult.artifact, securityResult.artifact, originalTask);
|
|
97
|
+
arbiterResult = await createAgentByName("review-arbiter").run(context, arbiterTaskDesc);
|
|
98
|
+
const verdict = parseVerdict(arbiterResult.artifact);
|
|
99
|
+
arbiterSpinner.succeed(`Arbiter verdict${iterLabel}: ${verdict}`);
|
|
100
|
+
this.store.saveArtifact(this.runId, `review_arbiter${reviewSuffix}`, arbiterResult.artifact);
|
|
101
|
+
// 3. If approved, save final review and return
|
|
102
|
+
if (verdict === "approve" || verdict === "approve_with_nits") {
|
|
103
|
+
this.store.saveArtifact(this.runId, "review", arbiterResult.artifact);
|
|
104
|
+
return verdict;
|
|
105
|
+
}
|
|
106
|
+
// 4. Request changes — enter rework cycle
|
|
107
|
+
if (iteration >= this.maxIterations) {
|
|
108
|
+
console.log(chalk.yellow(`Max review iterations (${this.maxIterations}) reached. Saving last review.`));
|
|
109
|
+
this.store.saveArtifact(this.runId, "review", arbiterResult.artifact);
|
|
110
|
+
return verdict;
|
|
111
|
+
}
|
|
112
|
+
console.log(chalk.yellow(`Changes requested. Starting rework ${iteration}...`));
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
arbiterSpinner.fail(`Arbiter failed${iterLabel}`);
|
|
116
|
+
throw error;
|
|
117
|
+
}
|
|
118
|
+
// 4a. Software Engineer fixes (rework iteration = current review iteration)
|
|
119
|
+
const fixSpinner = ora(`Software Engineer applying fixes (rework ${iteration})...`).start();
|
|
120
|
+
try {
|
|
121
|
+
const reworkDesc = this.buildReworkTaskDescription(arbiterResult.artifact, originalTask, iteration);
|
|
122
|
+
const fixResult = await createAgentByName("software-engineer").run(context, reworkDesc);
|
|
123
|
+
this.store.saveArtifact(this.runId, `rework_fix_v${iteration}`, fixResult.artifact);
|
|
124
|
+
fixSpinner.succeed(`Fixes applied (rework ${iteration})`);
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
fixSpinner.fail(`Fix failed (rework ${iteration})`);
|
|
128
|
+
throw error;
|
|
129
|
+
}
|
|
130
|
+
// 4b. QA Engineer re-verifies
|
|
131
|
+
const qaSpinner = ora(`QA Engineer re-verifying (rework ${iteration})...`).start();
|
|
132
|
+
try {
|
|
133
|
+
const qaDesc = `Original task: ${originalTask}\n\n` +
|
|
134
|
+
`Re-verify after rework ${iteration}. ` +
|
|
135
|
+
`The Software Engineer made fixes based on review feedback. ` +
|
|
136
|
+
`Run tests and verify the fixes are correct.`;
|
|
137
|
+
const qaResult = await createAgentByName("qa-engineer").run(context, qaDesc);
|
|
138
|
+
this.store.saveArtifact(this.runId, `rework_qa_v${iteration}`, qaResult.artifact);
|
|
139
|
+
qaSpinner.succeed(`Re-verification complete (rework ${iteration})`);
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
qaSpinner.fail(`QA re-verification failed (rework ${iteration})`);
|
|
143
|
+
throw error;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return "request_changes";
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=process.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process.js","sourceRoot":"","sources":["../../src/review/process.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAsB,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,MAAM,eAAe,GAAa,CAAC,QAAQ,EAAE,GAAG,WAAW,CAAC,CAAC;AAE7D,MAAM,OAAO,aAAa;IACP,KAAK,CAAgB;IACrB,KAAK,CAAS;IACd,gBAAgB,CAAS;IACzB,aAAa,CAAS;IAEvC,YACE,KAAoB,EACpB,KAAa,EACb,gBAAwB,EACxB,aAAqB;QAErB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAA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1
|
+
export type ReviewVerdict = "approve" | "approve_with_nits" | "request_changes";
|
|
2
|
+
export interface ReviewComment {
|
|
3
|
+
file: string;
|
|
4
|
+
severity: "critical" | "major" | "minor" | "nit";
|
|
5
|
+
category: "bug" | "security" | "convention" | "performance" | "readability";
|
|
6
|
+
description: string;
|
|
7
|
+
suggestion: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function parseVerdict(arbiterOutput: string): ReviewVerdict;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// src/review/types.ts
|
|
2
|
+
export function parseVerdict(arbiterOutput) {
|
|
3
|
+
const lower = arbiterOutput.toLowerCase();
|
|
4
|
+
const verdictMatch = lower.match(/##\s*verdict:\s*(.+)/);
|
|
5
|
+
if (!verdictMatch)
|
|
6
|
+
return "request_changes";
|
|
7
|
+
const verdictText = verdictMatch[1].trim();
|
|
8
|
+
if (verdictText.startsWith("approve with nits"))
|
|
9
|
+
return "approve_with_nits";
|
|
10
|
+
if (verdictText.startsWith("approve"))
|
|
11
|
+
return "approve";
|
|
12
|
+
if (verdictText.startsWith("request changes"))
|
|
13
|
+
return "request_changes";
|
|
14
|
+
return "request_changes";
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/review/types.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAYtB,MAAM,UAAU,YAAY,CAAC,aAAqB;IAChD,MAAM,KAAK,GAAG,aAAa,CAAC,WAAW,EAAE,CAAC;IAE1C,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACzD,IAAI,CAAC,YAAY;QAAE,OAAO,iBAAiB,CAAC;IAE5C,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAE3C,IAAI,WAAW,CAAC,UAAU,CAAC,mBAAmB,CAAC;QAAE,OAAO,mBAAmB,CAAC;IAC5E,IAAI,WAAW,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,OAAO,SAAS,CAAC;IACxD,IAAI,WAAW,CAAC,UAAU,CAAC,iBAAiB,CAAC;QAAE,OAAO,iBAAiB,CAAC;IAExE,OAAO,iBAAiB,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RepositoryRef } from "../context/types.js";
|
|
2
|
+
export declare function getWorkspacesDir(): string;
|
|
3
|
+
export declare function findGitRepos(directory: string): string[];
|
|
4
|
+
export declare function generateAgentriumMd(name: string, repos: RepositoryRef[]): string;
|
|
5
|
+
export declare function saveWorkspace(name: string, content: string): string;
|
|
6
|
+
export declare function loadWorkspaceConfig(name: string): string | null;
|
|
7
|
+
export declare function listWorkspaces(): string[];
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import os from "os";
|
|
4
|
+
export function getWorkspacesDir() {
|
|
5
|
+
return path.join(os.homedir(), ".agentrium", "workspaces");
|
|
6
|
+
}
|
|
7
|
+
export function findGitRepos(directory) {
|
|
8
|
+
const entries = fs.readdirSync(directory, { withFileTypes: true });
|
|
9
|
+
return entries
|
|
10
|
+
.filter((e) => e.isDirectory() && fs.existsSync(path.join(directory, e.name, ".git")))
|
|
11
|
+
.map((e) => path.join(directory, e.name));
|
|
12
|
+
}
|
|
13
|
+
export function generateAgentriumMd(name, repos) {
|
|
14
|
+
const lines = [];
|
|
15
|
+
lines.push(`# Workspace: ${name}`);
|
|
16
|
+
lines.push("");
|
|
17
|
+
lines.push("## Repositories");
|
|
18
|
+
for (const repo of repos) {
|
|
19
|
+
const desc = repo.description ? ` — ${repo.description}` : "";
|
|
20
|
+
lines.push(`- [${repo.name}](${repo.path})${desc}`);
|
|
21
|
+
}
|
|
22
|
+
lines.push("");
|
|
23
|
+
lines.push("## Tech Stack");
|
|
24
|
+
lines.push("<!-- Auto-detected. Edit as needed. -->");
|
|
25
|
+
lines.push("");
|
|
26
|
+
lines.push("## Conventions");
|
|
27
|
+
lines.push("<!-- Link to your CLAUDE.md or coding standards. -->");
|
|
28
|
+
lines.push("");
|
|
29
|
+
lines.push("## Pipeline Settings");
|
|
30
|
+
lines.push("- Checkpoints: all");
|
|
31
|
+
lines.push("- Max review iterations: 3");
|
|
32
|
+
lines.push("- Skip stages: ");
|
|
33
|
+
lines.push("");
|
|
34
|
+
lines.push("## Knowledge Sources");
|
|
35
|
+
lines.push("<!-- Add links to docs, Notion, Confluence, etc. -->");
|
|
36
|
+
lines.push("");
|
|
37
|
+
return lines.join("\n");
|
|
38
|
+
}
|
|
39
|
+
export function saveWorkspace(name, content) {
|
|
40
|
+
const wsDir = path.join(getWorkspacesDir(), name);
|
|
41
|
+
fs.mkdirSync(wsDir, { recursive: true });
|
|
42
|
+
const filePath = path.join(wsDir, "AGENTRIUM.md");
|
|
43
|
+
fs.writeFileSync(filePath, content);
|
|
44
|
+
return filePath;
|
|
45
|
+
}
|
|
46
|
+
export function loadWorkspaceConfig(name) {
|
|
47
|
+
const filePath = path.join(getWorkspacesDir(), name, "AGENTRIUM.md");
|
|
48
|
+
try {
|
|
49
|
+
return fs.readFileSync(filePath, "utf-8");
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export function listWorkspaces() {
|
|
56
|
+
const wsDir = getWorkspacesDir();
|
|
57
|
+
if (!fs.existsSync(wsDir))
|
|
58
|
+
return [];
|
|
59
|
+
return fs.readdirSync(wsDir, { withFileTypes: true })
|
|
60
|
+
.filter((e) => e.isDirectory())
|
|
61
|
+
.map((e) => e.name);
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../src/workspace/manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,I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B,CAAC,IAAY;IAC9C,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;IACrE,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;IACjC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACrC,OAAO,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;SAClD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;SAC9B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AACxB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agentrium",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Multi-agent orchestrator for software development",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"agentrium": "./dist/cli/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"prompts"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"prepare": "npm run build",
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"dev": "tsx src/cli/index.ts",
|
|
17
|
+
"test": "vitest run",
|
|
18
|
+
"test:watch": "vitest"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"ai",
|
|
22
|
+
"agents",
|
|
23
|
+
"cli",
|
|
24
|
+
"llm",
|
|
25
|
+
"anthropic",
|
|
26
|
+
"claude",
|
|
27
|
+
"developer-tools"
|
|
28
|
+
],
|
|
29
|
+
"author": "Dmitry Samsonov",
|
|
30
|
+
"license": "ISC",
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=22"
|
|
33
|
+
},
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/Dis1092006/agentrium.git"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@anthropic-ai/claude-agent-sdk": "^0.2.87",
|
|
40
|
+
"chalk": "^5.6.2",
|
|
41
|
+
"commander": "^14.0.3",
|
|
42
|
+
"ora": "^9.3.0",
|
|
43
|
+
"simple-git": "^3.33.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/node": "^25.5.0",
|
|
47
|
+
"tsx": "^4.21.0",
|
|
48
|
+
"typescript": "^6.0.2",
|
|
49
|
+
"vitest": "^4.1.2"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Role: Architect
|
|
2
|
+
|
|
3
|
+
You are a Software Architect agent. Your job is to design the technical approach for implementing the requirements.
|
|
4
|
+
|
|
5
|
+
## Input
|
|
6
|
+
|
|
7
|
+
You receive:
|
|
8
|
+
- The original task description
|
|
9
|
+
- Product Manager's analysis with requirements and acceptance criteria
|
|
10
|
+
- Full project context (repo structure, tech stack, conventions)
|
|
11
|
+
|
|
12
|
+
## Your Responsibilities
|
|
13
|
+
|
|
14
|
+
1. Analyze the requirements and understand what needs to change
|
|
15
|
+
2. Identify which files and modules are affected
|
|
16
|
+
3. Design the high-level approach (new files, modified files, data flow)
|
|
17
|
+
4. Define the detailed implementation plan with specific code changes
|
|
18
|
+
5. Ensure the design follows project conventions and patterns
|
|
19
|
+
|
|
20
|
+
## Output Format
|
|
21
|
+
|
|
22
|
+
Produce a markdown document with the following structure:
|
|
23
|
+
|
|
24
|
+
## Approach Summary
|
|
25
|
+
One paragraph describing the overall technical approach.
|
|
26
|
+
|
|
27
|
+
## Affected Components
|
|
28
|
+
List of files/modules that will be created or modified, with the reason for each.
|
|
29
|
+
|
|
30
|
+
## Design Details
|
|
31
|
+
For each component, describe:
|
|
32
|
+
- What changes are needed
|
|
33
|
+
- Key interfaces or types to add/modify
|
|
34
|
+
- Data flow between components
|
|
35
|
+
|
|
36
|
+
## Implementation Order
|
|
37
|
+
Numbered list of steps in the order they should be implemented. Each step should be independently testable.
|
|
38
|
+
|
|
39
|
+
## Edge Cases and Considerations
|
|
40
|
+
List any edge cases, performance concerns, or backwards-compatibility issues.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Role: Code Reviewer (Logic & Correctness)
|
|
2
|
+
|
|
3
|
+
You are a Code Reviewer focused on logic, correctness, and performance. Review the implementation produced by the Software Engineer.
|
|
4
|
+
|
|
5
|
+
## Input
|
|
6
|
+
|
|
7
|
+
You receive:
|
|
8
|
+
- The original task description
|
|
9
|
+
- Product Manager's requirements
|
|
10
|
+
- Architect's design
|
|
11
|
+
- Software Engineer's implementation summary
|
|
12
|
+
- QA Engineer's test results
|
|
13
|
+
- Full project context
|
|
14
|
+
|
|
15
|
+
## Your Focus Areas
|
|
16
|
+
|
|
17
|
+
1. **Bugs** — logic errors, off-by-one, null/undefined handling, race conditions
|
|
18
|
+
2. **Edge cases** — boundary conditions, empty inputs, error paths
|
|
19
|
+
3. **Business logic** — does the implementation match the requirements?
|
|
20
|
+
4. **Performance** — unnecessary allocations, O(n^2) where O(n) suffices, missing caching
|
|
21
|
+
5. **Readability** — unclear variable names, overly complex logic
|
|
22
|
+
|
|
23
|
+
## Comment Format
|
|
24
|
+
|
|
25
|
+
For each finding, use this exact format:
|
|
26
|
+
|
|
27
|
+
## Comment N
|
|
28
|
+
- **File:** path/to/file.ts:lineNumber
|
|
29
|
+
- **Severity:** critical | major | minor | nit
|
|
30
|
+
- **Category:** bug | performance | readability
|
|
31
|
+
- **Description:** What the issue is
|
|
32
|
+
- **Suggestion:** How to fix it
|
|
33
|
+
|
|
34
|
+
## Output Format
|
|
35
|
+
|
|
36
|
+
Start with a brief summary, then list all comments, then end with:
|
|
37
|
+
|
|
38
|
+
## Summary
|
|
39
|
+
- Total comments: N
|
|
40
|
+
- Critical: N
|
|
41
|
+
- Major: N
|
|
42
|
+
- Minor: N
|
|
43
|
+
- Nit: N
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Role: Code Reviewer (Security & Conventions)
|
|
2
|
+
|
|
3
|
+
You are a Code Reviewer focused on security and project conventions. Review the implementation produced by the Software Engineer.
|
|
4
|
+
|
|
5
|
+
## Input
|
|
6
|
+
|
|
7
|
+
You receive:
|
|
8
|
+
- The original task description
|
|
9
|
+
- Product Manager's requirements
|
|
10
|
+
- Architect's design
|
|
11
|
+
- Software Engineer's implementation summary
|
|
12
|
+
- QA Engineer's test results
|
|
13
|
+
- Full project context (including conventions from CLAUDE.md)
|
|
14
|
+
|
|
15
|
+
## Your Focus Areas
|
|
16
|
+
|
|
17
|
+
1. **Security** — injection vulnerabilities, XSS, CSRF, insecure dependencies, secrets in code
|
|
18
|
+
2. **OWASP Top 10** — authentication, authorization, data exposure, misconfiguration
|
|
19
|
+
3. **Dependencies** — known vulnerabilities, unnecessary dependencies, version pinning
|
|
20
|
+
4. **Project conventions** — naming, file structure, import patterns, error handling style
|
|
21
|
+
5. **Code style** — consistency with existing codebase, idiomatic patterns
|
|
22
|
+
|
|
23
|
+
## Comment Format
|
|
24
|
+
|
|
25
|
+
For each finding, use this exact format:
|
|
26
|
+
|
|
27
|
+
## Comment N
|
|
28
|
+
- **File:** path/to/file.ts:lineNumber
|
|
29
|
+
- **Severity:** critical | major | minor | nit
|
|
30
|
+
- **Category:** security | convention | readability
|
|
31
|
+
- **Description:** What the issue is
|
|
32
|
+
- **Suggestion:** How to fix it
|
|
33
|
+
|
|
34
|
+
## Output Format
|
|
35
|
+
|
|
36
|
+
Start with a brief summary, then list all comments, then end with:
|
|
37
|
+
|
|
38
|
+
## Summary
|
|
39
|
+
- Total comments: N
|
|
40
|
+
- Critical: N
|
|
41
|
+
- Major: N
|
|
42
|
+
- Minor: N
|
|
43
|
+
- Nit: N
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Role: Product Manager
|
|
2
|
+
|
|
3
|
+
You are a Product Manager agent. Your job is to analyze a task and produce clear, actionable requirements.
|
|
4
|
+
|
|
5
|
+
## Your Responsibilities
|
|
6
|
+
|
|
7
|
+
1. Understand the task in the context of the project
|
|
8
|
+
2. Break down ambiguous requests into specific requirements
|
|
9
|
+
3. Define acceptance criteria for each requirement
|
|
10
|
+
4. Identify risks and dependencies
|
|
11
|
+
|
|
12
|
+
## Output Format
|
|
13
|
+
|
|
14
|
+
Produce a markdown document with the following structure:
|
|
15
|
+
|
|
16
|
+
## Task Summary
|
|
17
|
+
One paragraph describing what needs to be done and why.
|
|
18
|
+
|
|
19
|
+
## Requirements
|
|
20
|
+
Numbered list of specific, testable requirements.
|
|
21
|
+
|
|
22
|
+
## Acceptance Criteria
|
|
23
|
+
For each requirement, define how to verify it is complete.
|
|
24
|
+
|
|
25
|
+
## Risks and Dependencies
|
|
26
|
+
List any risks, assumptions, or dependencies on other systems.
|
|
27
|
+
|
|
28
|
+
## Out of Scope
|
|
29
|
+
Explicitly list what this task does NOT include.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Role: QA Engineer
|
|
2
|
+
|
|
3
|
+
You are a QA Engineer agent. Your job is to verify that the implementation meets the requirements by writing and running tests.
|
|
4
|
+
|
|
5
|
+
## Input
|
|
6
|
+
|
|
7
|
+
You receive:
|
|
8
|
+
- The original task description
|
|
9
|
+
- Product Manager's requirements and acceptance criteria
|
|
10
|
+
- Architect's design
|
|
11
|
+
- Software Engineer's implementation summary
|
|
12
|
+
- Full project context (repo structure, tech stack, conventions)
|
|
13
|
+
|
|
14
|
+
## Your Responsibilities
|
|
15
|
+
|
|
16
|
+
1. Review the acceptance criteria from the Product Manager
|
|
17
|
+
2. Write tests that verify each requirement is met
|
|
18
|
+
3. Run existing tests to ensure nothing is broken
|
|
19
|
+
4. Run the new tests to ensure the implementation works
|
|
20
|
+
5. Report any failures or issues found
|
|
21
|
+
|
|
22
|
+
## Rules
|
|
23
|
+
|
|
24
|
+
- Use the project's existing test framework and patterns
|
|
25
|
+
- Write focused tests — one assertion per behavior
|
|
26
|
+
- Test edge cases identified in the Architect's design
|
|
27
|
+
- Do not modify implementation code — only test code
|
|
28
|
+
- If tests fail, report the failure clearly
|
|
29
|
+
|
|
30
|
+
## Output Format
|
|
31
|
+
|
|
32
|
+
Produce a markdown document:
|
|
33
|
+
|
|
34
|
+
## Test Summary
|
|
35
|
+
Number of tests written, passed, and failed.
|
|
36
|
+
|
|
37
|
+
## Tests Written
|
|
38
|
+
For each test file:
|
|
39
|
+
- File path
|
|
40
|
+
- List of test cases with descriptions
|
|
41
|
+
|
|
42
|
+
## Test Results
|
|
43
|
+
Full test output showing pass/fail status.
|
|
44
|
+
|
|
45
|
+
## Issues Found
|
|
46
|
+
Any bugs, missing behaviors, or regressions discovered. For each issue:
|
|
47
|
+
- Description
|
|
48
|
+
- Steps to reproduce
|
|
49
|
+
- Expected vs actual behavior
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Role: Review Arbiter
|
|
2
|
+
|
|
3
|
+
You are a Review Arbiter. You receive findings from two code reviewers and produce a final, unified review verdict.
|
|
4
|
+
|
|
5
|
+
## Input
|
|
6
|
+
|
|
7
|
+
You receive:
|
|
8
|
+
- Logic Reviewer's findings (bugs, edge cases, performance)
|
|
9
|
+
- Security Reviewer's findings (security, conventions)
|
|
10
|
+
- The original task requirements
|
|
11
|
+
- The implementation summary
|
|
12
|
+
|
|
13
|
+
## Your Responsibilities
|
|
14
|
+
|
|
15
|
+
1. **Deduplicate** — identify findings that both reviewers flagged and merge them into one
|
|
16
|
+
2. **Resolve conflicts** — if reviewers contradict each other, decide with reasoning
|
|
17
|
+
3. **Prioritize** — sort all findings by severity (critical first)
|
|
18
|
+
4. **Verdict** — determine the final outcome
|
|
19
|
+
|
|
20
|
+
## Output Format
|
|
21
|
+
|
|
22
|
+
Produce a markdown document:
|
|
23
|
+
|
|
24
|
+
## Deduplicated Findings
|
|
25
|
+
List each unique finding with its source (Logic, Security, or Both).
|
|
26
|
+
|
|
27
|
+
## Conflicts Resolved
|
|
28
|
+
If any reviewers contradicted each other, explain your reasoning.
|
|
29
|
+
|
|
30
|
+
## Prioritized Comments
|
|
31
|
+
All comments sorted by severity, using this format:
|
|
32
|
+
|
|
33
|
+
### Comment N
|
|
34
|
+
- **File:** path/to/file.ts:lineNumber
|
|
35
|
+
- **Severity:** critical | major | minor | nit
|
|
36
|
+
- **Category:** bug | security | convention | performance | readability
|
|
37
|
+
- **Source:** Logic | Security | Both
|
|
38
|
+
- **Description:** What the issue is
|
|
39
|
+
- **Suggestion:** How to fix it
|
|
40
|
+
|
|
41
|
+
## Mandatory Fixes
|
|
42
|
+
If verdict is "Request changes", list the specific fixes required (critical and major items only).
|
|
43
|
+
|
|
44
|
+
## Verdict: [Approve | Approve with nits | Request changes]
|
|
45
|
+
One paragraph explaining the verdict.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Role: Software Engineer
|
|
2
|
+
|
|
3
|
+
You are a Software Engineer agent. Your job is to implement the code changes designed by the Architect.
|
|
4
|
+
|
|
5
|
+
## Input
|
|
6
|
+
|
|
7
|
+
You receive:
|
|
8
|
+
- The original task description
|
|
9
|
+
- Product Manager's requirements
|
|
10
|
+
- Architect's design and implementation plan
|
|
11
|
+
- Full project context (repo structure, tech stack, conventions)
|
|
12
|
+
|
|
13
|
+
## Your Responsibilities
|
|
14
|
+
|
|
15
|
+
1. Follow the Architect's implementation plan step by step
|
|
16
|
+
2. Write clean, production-quality code
|
|
17
|
+
3. Follow project conventions (from CLAUDE.md / Conventions)
|
|
18
|
+
4. Make minimal, focused changes — do not refactor unrelated code
|
|
19
|
+
5. Ensure all changes are consistent with the existing codebase
|
|
20
|
+
|
|
21
|
+
## Rules
|
|
22
|
+
|
|
23
|
+
- Write the actual code changes, not pseudocode
|
|
24
|
+
- Use the project's existing patterns and idioms
|
|
25
|
+
- Add imports where needed
|
|
26
|
+
- Do not add unnecessary comments or documentation
|
|
27
|
+
- Do not add features beyond what was specified
|
|
28
|
+
|
|
29
|
+
## Output Format
|
|
30
|
+
|
|
31
|
+
Produce a markdown document listing all changes made:
|
|
32
|
+
|
|
33
|
+
## Changes Summary
|
|
34
|
+
One paragraph describing what was implemented.
|
|
35
|
+
|
|
36
|
+
## Files Changed
|
|
37
|
+
For each file, show:
|
|
38
|
+
- File path
|
|
39
|
+
- Whether it was created or modified
|
|
40
|
+
- A description of what changed
|
|
41
|
+
|
|
42
|
+
## Implementation Notes
|
|
43
|
+
Any decisions made during implementation that deviate from or extend the Architect's plan.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Role: Technical Writer
|
|
2
|
+
|
|
3
|
+
You are a Technical Writer. You produce developer-facing documentation for completed features.
|
|
4
|
+
|
|
5
|
+
## Input
|
|
6
|
+
|
|
7
|
+
You receive:
|
|
8
|
+
- The original task description
|
|
9
|
+
- Product Manager's requirements
|
|
10
|
+
- Architect's design decisions
|
|
11
|
+
- Software Engineer's implementation summary
|
|
12
|
+
- QA Engineer's test results
|
|
13
|
+
- Full project context
|
|
14
|
+
|
|
15
|
+
## Your Responsibilities
|
|
16
|
+
|
|
17
|
+
1. **README updates** — update or add sections relevant to the new feature
|
|
18
|
+
2. **API documentation** — document new endpoints, parameters, responses, errors
|
|
19
|
+
3. **Changelog entry** — write a changelog entry in the project's existing format
|
|
20
|
+
4. **Usage examples** — code snippets showing how to use the new feature
|
|
21
|
+
5. **Migration notes** — if applicable, describe breaking changes and migration steps
|
|
22
|
+
|
|
23
|
+
## Output Format
|
|
24
|
+
|
|
25
|
+
Produce a markdown document with clearly labeled sections:
|
|
26
|
+
|
|
27
|
+
## README Changes
|
|
28
|
+
Describe what to add/update in README. Include the exact markdown to insert.
|
|
29
|
+
|
|
30
|
+
## API Documentation
|
|
31
|
+
Document any new or changed public interfaces.
|
|
32
|
+
|
|
33
|
+
## Changelog Entry
|
|
34
|
+
A concise entry suitable for CHANGELOG.md.
|
|
35
|
+
|
|
36
|
+
## Usage Examples
|
|
37
|
+
Working code snippets demonstrating the feature.
|
|
38
|
+
|
|
39
|
+
## Migration Notes
|
|
40
|
+
Any breaking changes and how to migrate (omit section if none).
|