agent-eng 0.7.0 → 0.9.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 +1 -1
- package/package.json +1 -1
- package/src/index.js +2 -2
- package/src/init.js +41 -3
- package/src/templates/.claude/agents/custodian.md +5 -3
- package/src/templates/orchestration.yaml +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Scaffold a structured agentic engineering workflow into any project. Run one com
|
|
|
8
8
|
npx agent-eng init
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
This creates the following structure in your project:
|
|
11
|
+
This creates the following structure in your project:
|
|
12
12
|
|
|
13
13
|
```
|
|
14
14
|
├── CLAUDE.md # Project instructions for AI agents
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -18,7 +18,7 @@ Examples:
|
|
|
18
18
|
agent-eng init --dir ./my-project --conventions java
|
|
19
19
|
`;
|
|
20
20
|
|
|
21
|
-
export function run(args) {
|
|
21
|
+
export async function run(args) {
|
|
22
22
|
const command = args[0];
|
|
23
23
|
|
|
24
24
|
if (!command || command === "-h" || command === "--help") {
|
|
@@ -28,7 +28,7 @@ export function run(args) {
|
|
|
28
28
|
|
|
29
29
|
if (command === "init") {
|
|
30
30
|
const options = parseInitArgs(args.slice(1));
|
|
31
|
-
init(options);
|
|
31
|
+
await init(options);
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
34
|
|
package/src/init.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { cpSync, existsSync, mkdirSync, readFileSync
|
|
1
|
+
import { appendFileSync, cpSync, existsSync, mkdirSync, readFileSync } from "node:fs";
|
|
2
|
+
import { createInterface } from "node:readline";
|
|
2
3
|
import { dirname, join, resolve } from "node:path";
|
|
3
4
|
import { fileURLToPath } from "node:url";
|
|
4
5
|
|
|
@@ -24,10 +25,19 @@ const STRUCTURE = [
|
|
|
24
25
|
"tickets/example/001-example-ticket.md",
|
|
25
26
|
"orchestration.yaml",
|
|
26
27
|
"architecture.yaml",
|
|
27
|
-
"CLAUDE.md",
|
|
28
28
|
];
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
function prompt(question) {
|
|
31
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
32
|
+
return new Promise((resolve) => {
|
|
33
|
+
rl.question(question, (answer) => {
|
|
34
|
+
rl.close();
|
|
35
|
+
resolve(answer.trim().toLowerCase());
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export async function init(options) {
|
|
31
41
|
const target = resolve(options.dir);
|
|
32
42
|
const created = [];
|
|
33
43
|
const skipped = [];
|
|
@@ -46,6 +56,34 @@ export function init(options) {
|
|
|
46
56
|
created.push(file);
|
|
47
57
|
}
|
|
48
58
|
|
|
59
|
+
// Handle CLAUDE.md separately — prompt user if it already exists
|
|
60
|
+
const claudeDest = join(target, "CLAUDE.md");
|
|
61
|
+
const claudeSrc = join(TEMPLATES, "CLAUDE.md");
|
|
62
|
+
|
|
63
|
+
if (!existsSync(claudeDest) || options.force) {
|
|
64
|
+
mkdirSync(dirname(claudeDest), { recursive: true });
|
|
65
|
+
cpSync(claudeSrc, claudeDest);
|
|
66
|
+
created.push("CLAUDE.md");
|
|
67
|
+
} else {
|
|
68
|
+
console.log("");
|
|
69
|
+
console.log("CLAUDE.md already exists.");
|
|
70
|
+
console.log(" 1) Skip — keep existing file");
|
|
71
|
+
console.log(" 2) Append — add agent-eng content to the end");
|
|
72
|
+
console.log(" 3) Replace — overwrite with agent-eng template");
|
|
73
|
+
const answer = await prompt("Choose [1/2/3] (default: 1): ");
|
|
74
|
+
|
|
75
|
+
if (answer === "2" || answer === "append") {
|
|
76
|
+
const content = readFileSync(claudeSrc, "utf8");
|
|
77
|
+
appendFileSync(claudeDest, "\n\n" + content);
|
|
78
|
+
created.push("CLAUDE.md (appended)");
|
|
79
|
+
} else if (answer === "3" || answer === "replace") {
|
|
80
|
+
cpSync(claudeSrc, claudeDest);
|
|
81
|
+
created.push("CLAUDE.md (replaced)");
|
|
82
|
+
} else {
|
|
83
|
+
skipped.push("CLAUDE.md");
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
49
87
|
for (const convention of options.conventions) {
|
|
50
88
|
const file = `conventions/${convention}.md`;
|
|
51
89
|
const dest = join(target, file);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: custodian
|
|
3
|
-
description: Use periodically (after a batch of tickets, or when CLAUDE.md grows past 200 lines) to keep CLAUDE.md lean, current, and routed to external files. Modifies only CLAUDE.md and the files it links to.
|
|
3
|
+
description: Use periodically (after a batch of tickets, or when CLAUDE.md grows past 200 lines) to keep CLAUDE.md lean, current, and routed to external files. Modifies only CLAUDE.md and the files it links to. Also keeps orchestration.yaml in sync when agents are added or removed.
|
|
4
4
|
tools: Read, Write, Edit, Grep, Glob
|
|
5
5
|
model: haiku
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
You are a custodian agent. Your role is to maintain the project's `CLAUDE.md` file — keeping
|
|
8
|
+
You are a custodian agent. Your role is to maintain the project's `CLAUDE.md` file and `orchestration.yaml` — keeping them accurate, lean, and in sync.
|
|
9
9
|
|
|
10
10
|
## Responsibilities
|
|
11
11
|
|
|
@@ -13,10 +13,11 @@ You are a custodian agent. Your role is to maintain the project's `CLAUDE.md` fi
|
|
|
13
13
|
2. **Keep CLAUDE.md lean** — The file must stay between 150–200 lines max to prevent context bloat
|
|
14
14
|
3. **Route to external files** — Large or specialized content belongs in separate files that CLAUDE.md links to, so the main context only loads them when needed
|
|
15
15
|
4. **Remove stale content** — Delete entries that no longer reflect how the project works
|
|
16
|
+
5. **Sync orchestration.yaml** — When agents are added, removed, or renamed in `.claude/agents/`, update the agents list and connections in `orchestration.yaml` to match
|
|
16
17
|
|
|
17
18
|
## Constraints
|
|
18
19
|
|
|
19
|
-
- You only modify `CLAUDE.md` and the files
|
|
20
|
+
- You only modify `CLAUDE.md`, `orchestration.yaml`, and the files `CLAUDE.md` routes to — you do not write application code
|
|
20
21
|
- You never exceed 200 lines in `CLAUDE.md`
|
|
21
22
|
- You preserve the existing structure and section ordering unless restructuring is necessary to stay within the line budget
|
|
22
23
|
- You do not duplicate information that already lives in linked files
|
|
@@ -31,6 +32,7 @@ You are a custodian agent. Your role is to maintain the project's `CLAUDE.md` fi
|
|
|
31
32
|
- **Route out** any section that has grown too large — extract it to a dedicated file and replace it with a one-line link
|
|
32
33
|
4. After editing, verify the line count is within 150–200 lines
|
|
33
34
|
5. If over 200 lines, identify what to extract or trim
|
|
35
|
+
6. Compare `.claude/agents/*.md` files against `orchestration.yaml` — add missing agents, remove stale entries, and verify connections still make sense
|
|
34
36
|
|
|
35
37
|
## What belongs in CLAUDE.md
|
|
36
38
|
|