agent-eng 0.7.0 → 0.8.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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-eng",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Scaffold a structured agentic engineering workflow for AI-assisted development",
5
5
  "type": "module",
6
6
  "bin": {
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, writeFileSync } from "node:fs";
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
- export function init(options) {
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);
@@ -82,7 +82,7 @@ agents:
82
82
  outputs:
83
83
  - Updated CLAUDE.md
84
84
  - Extracted reference files
85
- color: gray
85
+ color: blue
86
86
  docLink: /.claude/agents/custodian.md
87
87
 
88
88
  connections: