@vuau/agent-memory 0.3.0 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @vuau/agent-memory
2
2
 
3
- Structured AI memory for codebases. Works with OpenCode, GitHub Copilot, Cursor, Windsurf, and any AI coding assistant that reads markdown files.
3
+ Structured AI memory for codebases. Works with GitHub Copilot, Cursor, Windsurf, VS Code, OpenCode, and [25+ other AI coding tools](#supported-tools).
4
4
 
5
5
  **[Tiếng Việt →](./README.vi.md)**
6
6
 
@@ -16,39 +16,31 @@ AI coding assistants lose context between sessions. They can't remember:
16
16
  ## Quick Start
17
17
 
18
18
  ```bash
19
- # Interactive mode — choose your IDEs
20
19
  npx @vuau/agent-memory init
21
-
22
- # Or specify directly
23
- npx @vuau/agent-memory init --opencode # OpenCode only
24
- npx @vuau/agent-memory init --copilot --cursor # Multiple IDEs
25
- npx @vuau/agent-memory init --all # All IDEs
26
20
  ```
27
21
 
22
+ That's it. Creates `AGENTS.md` + `.agents/` structure.
23
+
28
24
  ## What It Creates
29
25
 
30
26
  ```
31
27
  / (Project Root)
32
- ├── AGENTS.md # OpenCode rules
33
- ├── .cursorrules # Cursor rules
34
- ├── .windsurfrules # Windsurf rules
35
- ├── .github/
36
- │ └── copilot-instructions.md # GitHub Copilot rules
28
+ ├── AGENTS.md # Universal agent instructions
37
29
  └── .agents/
38
- ├── MEMORY.md # Long-term memory (decisions, patterns)
39
- ├── TASKS.md # Working memory (current tasks)
40
- └── spec/ # Detailed specs (on-demand)
30
+ ├── MEMORY.md # Long-term memory (decisions, patterns)
31
+ ├── TASKS.md # Working memory (current tasks)
32
+ └── spec/ # Detailed specs (on-demand)
41
33
  ```
42
34
 
43
35
  ## How It Works
44
36
 
45
- 1. **You run `init`** → Creates IDE config files + `.agents/` structure
46
- 2. **Agent reads rules** → Finds documentation map pointing to `.agents/`
37
+ 1. **You run `init`** → Creates `AGENTS.md` + `.agents/` structure
38
+ 2. **Agent reads AGENTS.md** → Finds documentation map pointing to `.agents/`
47
39
  3. **Agent works** → Reads MEMORY.md before implementing, updates TASKS.md
48
40
  4. **You approve decision** → Agent writes 1-line entry to MEMORY.md
49
41
  5. **Next session** → Agent reads memory, continues where you left off
50
42
 
51
- **No plugin required.** The rules in AGENTS.md/copilot-instructions.md instruct the agent what to do.
43
+ **No plugin required.** The instructions in AGENTS.md tell the agent what to do.
52
44
 
53
45
  ## CLI Options
54
46
 
@@ -56,13 +48,8 @@ npx @vuau/agent-memory init --all # All IDEs
56
48
  npx @vuau/agent-memory init [options]
57
49
 
58
50
  Options:
59
- --opencode Create AGENTS.md for OpenCode
60
- --copilot Create .github/copilot-instructions.md
61
- --cursor Create .cursorrules
62
- --windsurf Create .windsurfrules
63
- --all Create config for all IDEs
64
- --force Overwrite existing files without asking
65
- --name <n> Project name (default: from package.json)
51
+ --force Overwrite existing files without asking
52
+ --name <n> Project name (default: from package.json)
66
53
 
67
54
  npx @vuau/agent-memory doctor # Validate structure
68
55
  npx @vuau/agent-memory help # Show help
@@ -70,7 +57,7 @@ npx @vuau/agent-memory help # Show help
70
57
 
71
58
  ## Memory Protocol
72
59
 
73
- Agents follow this protocol (defined in config files):
60
+ Agents follow this protocol (defined in AGENTS.md):
74
61
 
75
62
  ```markdown
76
63
  ## When to write
@@ -95,11 +82,11 @@ Agents follow this protocol (defined in config files):
95
82
 
96
83
  ## Architecture
97
84
 
98
- ### 4-Layer Design
85
+ ### 3-Layer Design
99
86
 
100
87
  | Layer | File | Purpose |
101
88
  |-------|------|---------|
102
- | Router | AGENTS.md / .cursorrules / etc | Rules + pointers (~100 lines) |
89
+ | Instructions | AGENTS.md | Rules + pointers (~100 lines) |
103
90
  | Memory | .agents/MEMORY.md | Curated decisions (1-line each) |
104
91
  | Tasks | .agents/TASKS.md | Current work, next steps |
105
92
  | Specs | .agents/spec/*.md | Detailed docs (on-demand) |
@@ -117,16 +104,17 @@ File-based solution:
117
104
  - Plain markdown (portable, git-versionable, human-readable)
118
105
  - No dependencies (works everywhere)
119
106
 
120
- ## Cross-IDE Compatibility
107
+ ## Supported Tools
108
+
109
+ AGENTS.md is the universal format, supported by **25+ AI coding tools**:
121
110
 
122
- | IDE | Config File | Reads .agents/* |
123
- |-----|-------------|-----------------|
124
- | OpenCode | AGENTS.md | |
125
- | GitHub Copilot | .github/copilot-instructions.md | |
126
- | Cursor | .cursorrules | |
127
- | Windsurf | .windsurfrules | ✅ |
111
+ | Category | Tools |
112
+ |----------|-------|
113
+ | **IDEs** | Cursor, Windsurf, VS Code, Zed, RooCode, Kilo Code |
114
+ | **CLI Tools** | OpenCode, Aider, goose, Gemini CLI, Warp, Augment Code |
115
+ | **AI Agents** | GitHub Copilot, Codex (OpenAI), Jules (Google), Junie (JetBrains), Devin, Factory, Amp, Phoenix, Semgrep, Ona, UiPath Autopilot |
128
116
 
129
- All IDEs use the same `.agents/` memory structure.
117
+ See [agents.md](https://agents.md) for the full list.
130
118
 
131
119
  ## Documentation
132
120
 
package/README.vi.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @vuau/agent-memory
2
2
 
3
- Bộ nhớ AI có cấu trúc cho các codebase. Hoạt động với OpenCode, GitHub Copilot, Cursor, Windsurf, và bất kỳ AI coding assistant nào đọc markdown files.
3
+ Bộ nhớ AI có cấu trúc cho các codebase. Hoạt động với GitHub Copilot, Cursor, Windsurf, VS Code, OpenCode, [25+ AI coding tools khác](#supported-tools).
4
4
 
5
5
  ## Bài toán
6
6
 
@@ -14,39 +14,31 @@ AI coding assistants mất bối cảnh giữa các phiên. Họ không thể nh
14
14
  ## Bắt đầu nhanh
15
15
 
16
16
  ```bash
17
- # Interactive mode — chọn IDEs của bạn
18
17
  npx @vuau/agent-memory init
19
-
20
- # Hoặc chỉ định trực tiếp
21
- npx @vuau/agent-memory init --opencode # Chỉ OpenCode
22
- npx @vuau/agent-memory init --copilot --cursor # Nhiều IDEs
23
- npx @vuau/agent-memory init --all # Tất cả IDEs
24
18
  ```
25
19
 
20
+ Đơn giản vậy thôi. Tạo `AGENTS.md` + `.agents/` structure.
21
+
26
22
  ## Cấu trúc tạo ra
27
23
 
28
24
  ```
29
25
  / (Project Root)
30
- ├── AGENTS.md # OpenCode rules
31
- ├── .cursorrules # Cursor rules
32
- ├── .windsurfrules # Windsurf rules
33
- ├── .github/
34
- │ └── copilot-instructions.md # GitHub Copilot rules
26
+ ├── AGENTS.md # Universal agent instructions
35
27
  └── .agents/
36
- ├── MEMORY.md # Long-term memory (decisions, patterns)
37
- ├── TASKS.md # Working memory (current tasks)
38
- └── spec/ # Detailed specs (on-demand)
28
+ ├── MEMORY.md # Long-term memory (decisions, patterns)
29
+ ├── TASKS.md # Working memory (current tasks)
30
+ └── spec/ # Detailed specs (on-demand)
39
31
  ```
40
32
 
41
33
  ## Cách hoạt động
42
34
 
43
- 1. **Bạn chạy `init`** → Tạo IDE config files + `.agents/` structure
44
- 2. **Agent đọc rules** → Tìm documentation map trỏ đến `.agents/`
35
+ 1. **Bạn chạy `init`** → Tạo `AGENTS.md` + `.agents/` structure
36
+ 2. **Agent đọc AGENTS.md** → Tìm documentation map trỏ đến `.agents/`
45
37
  3. **Agent làm việc** → Đọc MEMORY.md trước khi implement, update TASKS.md
46
38
  4. **Bạn approve decision** → Agent ghi 1-line entry vào MEMORY.md
47
39
  5. **Phiên tiếp theo** → Agent đọc memory, tiếp tục từ nơi dừng lại
48
40
 
49
- **Không cần plugin.** Rules trong AGENTS.md/copilot-instructions.md hướng dẫn agent phải làm gì.
41
+ **Không cần plugin.** Instructions trong AGENTS.md hướng dẫn agent phải làm gì.
50
42
 
51
43
  ## CLI Options
52
44
 
@@ -54,13 +46,8 @@ npx @vuau/agent-memory init --all # Tất cả IDEs
54
46
  npx @vuau/agent-memory init [options]
55
47
 
56
48
  Options:
57
- --opencode Tạo AGENTS.md cho OpenCode
58
- --copilot Tạo .github/copilot-instructions.md
59
- --cursor Tạo .cursorrules
60
- --windsurf Tạo .windsurfrules
61
- --all Tạo config cho tất cả IDEs
62
- --force Ghi đè files có sẵn mà không hỏi
63
- --name <n> Tên project (mặc định: từ package.json)
49
+ --force Ghi đè files có sẵn mà không hỏi
50
+ --name <n> Tên project (mặc định: từ package.json)
64
51
 
65
52
  npx @vuau/agent-memory doctor # Validate structure
66
53
  npx @vuau/agent-memory help # Hiện help
@@ -68,7 +55,7 @@ npx @vuau/agent-memory help # Hiện help
68
55
 
69
56
  ## Memory Protocol
70
57
 
71
- Agents follow protocol này (defined trong config files):
58
+ Agents follow protocol này (defined trong AGENTS.md):
72
59
 
73
60
  ```markdown
74
61
  ## Khi nào ghi
@@ -93,11 +80,11 @@ Agents follow protocol này (defined trong config files):
93
80
 
94
81
  ## Kiến trúc
95
82
 
96
- ### Thiết kế 4-Layer
83
+ ### Thiết kế 3-Layer
97
84
 
98
85
  | Layer | File | Mục đích |
99
86
  |-------|------|----------|
100
- | Router | AGENTS.md / .cursorrules / etc | Rules + pointers (~100 dòng) |
87
+ | Instructions | AGENTS.md | Rules + pointers (~100 dòng) |
101
88
  | Memory | .agents/MEMORY.md | Curated decisions (1-line each) |
102
89
  | Tasks | .agents/TASKS.md | Current work, next steps |
103
90
  | Specs | .agents/spec/*.md | Detailed docs (on-demand) |
@@ -115,16 +102,17 @@ File-based solution:
115
102
  - Plain markdown (portable, git-versionable, human-readable)
116
103
  - Không dependencies (works everywhere)
117
104
 
118
- ## Cross-IDE Compatibility
105
+ ## Supported Tools
106
+
107
+ AGENTS.md là format universal, được hỗ trợ bởi **25+ AI coding tools**:
119
108
 
120
- | IDE | Config File | Reads .agents/* |
121
- |-----|-------------|-----------------|
122
- | OpenCode | AGENTS.md | |
123
- | GitHub Copilot | .github/copilot-instructions.md | |
124
- | Cursor | .cursorrules | |
125
- | Windsurf | .windsurfrules | ✅ |
109
+ | Category | Tools |
110
+ |----------|-------|
111
+ | **IDEs** | Cursor, Windsurf, VS Code, Zed, RooCode, Kilo Code |
112
+ | **CLI Tools** | OpenCode, Aider, goose, Gemini CLI, Warp, Augment Code |
113
+ | **AI Agents** | GitHub Copilot, Codex (OpenAI), Jules (Google), Junie (JetBrains), Devin, Factory, Amp, Phoenix, Semgrep, Ona, UiPath Autopilot |
126
114
 
127
- Tất cả IDEs dùng cùng `.agents/` memory structure.
115
+ Xem [agents.md](https://agents.md) để danh sách đầy đủ.
128
116
 
129
117
  ## Tài liệu
130
118
 
package/dist/bin/cli.js CHANGED
@@ -14,11 +14,9 @@ import { fileURLToPath } from "url";
14
14
  var AGENTS_DIR = ".agents";
15
15
  var SPEC_DIR = ".agents/spec";
16
16
  var MEMORY_FILE = ".agents/MEMORY.md";
17
+ var MEMORY_DETAIL_FILE = ".agents/MEMORY-DETAIL.md";
17
18
  var TASKS_FILE = ".agents/TASKS.md";
18
19
  var AGENTS_MD = "AGENTS.md";
19
- var COPILOT_INSTRUCTIONS = ".github/copilot-instructions.md";
20
- var CURSOR_RULES = ".cursorrules";
21
- var WINDSURF_RULES = ".windsurfrules";
22
20
 
23
21
  // src/core/scaffold.ts
24
22
  function getTemplatesDir() {
@@ -49,25 +47,25 @@ function scaffold(projectDir, options = {}) {
49
47
  const projectName = options.projectName || guessProjectName(projectDir);
50
48
  const vars = { PROJECT_NAME: projectName };
51
49
  const force = options.force || false;
52
- const hasAnyIde = options.opencode || options.copilot || options.cursor || options.windsurf;
53
- const useOpencode = hasAnyIde ? options.opencode : true;
54
- const useCopilot = options.copilot || false;
55
- const useCursor = options.cursor || false;
56
- const useWindsurf = options.windsurf || false;
57
50
  const dirs = [
58
51
  join(projectDir, AGENTS_DIR),
59
52
  join(projectDir, SPEC_DIR)
60
53
  ];
61
- if (useCopilot) {
62
- dirs.push(join(projectDir, ".github"));
63
- }
64
54
  for (const dir of dirs) {
65
55
  if (!existsSync(dir)) {
66
56
  mkdirSync(dir, { recursive: true });
67
57
  }
68
58
  }
59
+ writeFileIfNeeded(
60
+ join(projectDir, AGENTS_MD),
61
+ applyVars(readTemplate("AGENTS.md"), vars),
62
+ AGENTS_MD,
63
+ result,
64
+ force
65
+ );
69
66
  const coreFiles = [
70
67
  { target: MEMORY_FILE, template: "MEMORY.md" },
68
+ { target: MEMORY_DETAIL_FILE, template: "MEMORY-DETAIL.md" },
71
69
  { target: TASKS_FILE, template: "TASKS.md" }
72
70
  ];
73
71
  for (const { target, template } of coreFiles) {
@@ -85,42 +83,6 @@ function scaffold(projectDir, options = {}) {
85
83
  writeFileSync(specKeep, "");
86
84
  result.created.push(`${SPEC_DIR}/.gitkeep`);
87
85
  }
88
- if (useOpencode) {
89
- writeFileIfNeeded(
90
- join(projectDir, AGENTS_MD),
91
- applyVars(readTemplate("AGENTS.md"), vars),
92
- AGENTS_MD,
93
- result,
94
- force
95
- );
96
- }
97
- if (useCopilot) {
98
- writeFileIfNeeded(
99
- join(projectDir, COPILOT_INSTRUCTIONS),
100
- applyVars(readTemplate("copilot-instructions.md"), vars),
101
- COPILOT_INSTRUCTIONS,
102
- result,
103
- force
104
- );
105
- }
106
- if (useCursor) {
107
- writeFileIfNeeded(
108
- join(projectDir, CURSOR_RULES),
109
- applyVars(readTemplate("cursorrules.md"), vars),
110
- CURSOR_RULES,
111
- result,
112
- force
113
- );
114
- }
115
- if (useWindsurf) {
116
- writeFileIfNeeded(
117
- join(projectDir, WINDSURF_RULES),
118
- applyVars(readTemplate("windsurfrules.md"), vars),
119
- WINDSURF_RULES,
120
- result,
121
- force
122
- );
123
- }
124
86
  return result;
125
87
  }
126
88
  function writeFileIfNeeded(targetPath, content, displayName, result, force) {
@@ -149,7 +111,7 @@ import { join as join2 } from "path";
149
111
  function doctor(projectDir) {
150
112
  const issues = [];
151
113
  const required = [
152
- { file: AGENTS_MD, desc: "Root router file" },
114
+ { file: AGENTS_MD, desc: "Root agent instructions" },
153
115
  { file: MEMORY_FILE, desc: "Long-term memory" },
154
116
  { file: TASKS_FILE, desc: "Working memory" }
155
117
  ];
@@ -164,14 +126,6 @@ function doctor(projectDir) {
164
126
  issues.push({ level: "error", file: dir, message: "Directory missing" });
165
127
  }
166
128
  }
167
- const copilotPath = join2(projectDir, COPILOT_INSTRUCTIONS);
168
- if (!existsSync2(copilotPath)) {
169
- issues.push({
170
- level: "warning",
171
- file: COPILOT_INSTRUCTIONS,
172
- message: "Copilot instructions missing \u2014 VSCode/GitHub Copilot won't have context"
173
- });
174
- }
175
129
  const agentsPath = join2(projectDir, AGENTS_MD);
176
130
  if (existsSync2(agentsPath)) {
177
131
  const content = readFileSync2(agentsPath, "utf-8");
@@ -186,7 +140,7 @@ function doctor(projectDir) {
186
140
  issues.push({
187
141
  level: "warning",
188
142
  file: AGENTS_MD,
189
- message: "Over 150 lines \u2014 consider keeping it concise as a router"
143
+ message: "Over 150 lines \u2014 consider keeping it concise"
190
144
  });
191
145
  }
192
146
  }
@@ -201,53 +155,6 @@ function doctor(projectDir) {
201
155
  });
202
156
  }
203
157
  }
204
- const opencodePkgPath = join2(projectDir, ".opencode", "package.json");
205
- const opencodeJsonPath = join2(projectDir, "opencode.json");
206
- const opencodeExists = existsSync2(join2(projectDir, ".opencode"));
207
- if (opencodeExists) {
208
- if (!existsSync2(opencodePkgPath)) {
209
- issues.push({
210
- level: "warning",
211
- file: ".opencode/package.json",
212
- message: "Missing \u2014 run 'agent-memory init --opencode' to wire up the plugin"
213
- });
214
- } else {
215
- try {
216
- const pkg = JSON.parse(readFileSync2(opencodePkgPath, "utf-8"));
217
- const deps = { ...pkg.dependencies, ...pkg.devDependencies };
218
- if (!deps["@vuau/agent-memory"]) {
219
- issues.push({
220
- level: "warning",
221
- file: ".opencode/package.json",
222
- message: "@vuau/agent-memory not in dependencies \u2014 run 'agent-memory init --opencode'"
223
- });
224
- }
225
- } catch {
226
- issues.push({ level: "warning", file: ".opencode/package.json", message: "Invalid JSON" });
227
- }
228
- }
229
- if (!existsSync2(opencodeJsonPath)) {
230
- issues.push({
231
- level: "warning",
232
- file: "opencode.json",
233
- message: "Missing \u2014 run 'agent-memory init --opencode' to wire up the plugin"
234
- });
235
- } else {
236
- try {
237
- const config = JSON.parse(readFileSync2(opencodeJsonPath, "utf-8"));
238
- const plugins = config.plugin || [];
239
- if (!plugins.includes("@vuau/agent-memory")) {
240
- issues.push({
241
- level: "warning",
242
- file: "opencode.json",
243
- message: "@vuau/agent-memory not in plugin array \u2014 run 'agent-memory init --opencode'"
244
- });
245
- }
246
- } catch {
247
- issues.push({ level: "warning", file: "opencode.json", message: "Invalid JSON" });
248
- }
249
- }
250
- }
251
158
  return { ok: issues.filter((i) => i.level === "error").length === 0, issues };
252
159
  }
253
160
 
@@ -270,96 +177,44 @@ function askYesNo(question, defaultYes = true) {
270
177
  return answer.toLowerCase().startsWith("y");
271
178
  });
272
179
  }
273
- async function askMultiSelect(question, options) {
274
- console.log(`
275
- ${question}`);
276
- for (const opt of options) {
277
- console.log(` [${opt.key}] ${opt.label}`);
278
- }
279
- const answer = await ask("Enter choices (e.g., 1,2 or 1 2): ");
280
- const selected = answer.split(/[,\s]+/).filter(Boolean);
281
- return selected;
282
- }
283
180
  function printUsage() {
284
181
  console.log(`
285
182
  @vuau/agent-memory \u2014 Structured AI memory for codebases
286
183
 
287
184
  Usage:
288
- agent-memory init [options] Scaffold .agents/ structure
185
+ agent-memory init [options] Scaffold AGENTS.md + .agents/ structure
289
186
  agent-memory doctor Validate .agents/ structure
290
187
  agent-memory help Show this help
291
188
 
292
189
  Options (init):
293
- --opencode Create AGENTS.md for OpenCode
294
- --copilot Create .github/copilot-instructions.md for GitHub Copilot
295
- --cursor Create .cursorrules for Cursor
296
- --windsurf Create .windsurfrules for Windsurf
297
- --all Create config for all IDEs
298
190
  --force Overwrite existing files without asking
299
191
  --name <name> Project name (default: from package.json)
300
192
 
301
193
  Examples:
302
- npx @vuau/agent-memory init # Interactive mode
303
- npx @vuau/agent-memory init --opencode # OpenCode only
304
- npx @vuau/agent-memory init --copilot --cursor # Copilot + Cursor
305
- npx @vuau/agent-memory init --all # All IDEs
194
+ npx @vuau/agent-memory init # Create AGENTS.md + .agents/
195
+ npx @vuau/agent-memory init --force # Overwrite existing files
196
+ npx @vuau/agent-memory doctor # Check structure
197
+
198
+ AGENTS.md is the universal format supported by 25+ AI coding tools:
199
+ GitHub Copilot, Cursor, Windsurf, VS Code, OpenCode, Codex, Jules,
200
+ Junie, Gemini CLI, Devin, Aider, goose, Factory, Amp, RooCode,
201
+ Zed, Warp, Kilo Code, Phoenix, Semgrep, Ona, UiPath, Augment Code...
306
202
  `);
307
203
  }
308
204
  async function runInit() {
309
205
  const cwd = process.cwd();
310
206
  const force = args.includes("--force");
311
- const hasOpencode = args.includes("--opencode");
312
- const hasCopilot = args.includes("--copilot");
313
- const hasCursor = args.includes("--cursor");
314
- const hasWindsurf = args.includes("--windsurf");
315
- const hasAll = args.includes("--all");
316
207
  const nameIdx = args.indexOf("--name");
317
208
  const projectName = nameIdx !== -1 ? args[nameIdx + 1] : void 0;
318
- let selectedIdes = [];
319
- if (hasAll) {
320
- selectedIdes = ["1", "2", "3", "4"];
321
- } else if (hasOpencode || hasCopilot || hasCursor || hasWindsurf) {
322
- if (hasOpencode) selectedIdes.push("1");
323
- if (hasCopilot) selectedIdes.push("2");
324
- if (hasCursor) selectedIdes.push("3");
325
- if (hasWindsurf) selectedIdes.push("4");
326
- } else {
327
- console.log("\n@vuau/agent-memory \u2014 Structured AI memory for codebases\n");
328
- selectedIdes = await askMultiSelect("What are your coding tools?", [
329
- { key: "1", label: "OpenCode (AGENTS.md)" },
330
- { key: "2", label: "GitHub Copilot (.github/copilot-instructions.md)" },
331
- { key: "3", label: "Cursor (.cursorrules)" },
332
- { key: "4", label: "Windsurf (.windsurfrules)" }
333
- ]);
334
- if (selectedIdes.length === 0) {
335
- console.log("\nNo tools selected. Defaulting to OpenCode.\n");
336
- selectedIdes = ["1"];
337
- }
338
- }
339
209
  const options = {
340
- projectName,
341
- opencode: selectedIdes.includes("1"),
342
- copilot: selectedIdes.includes("2"),
343
- cursor: selectedIdes.includes("3"),
344
- windsurf: selectedIdes.includes("4")
210
+ projectName
345
211
  };
346
212
  if (!force) {
347
213
  const filesToCheck = [
214
+ { path: AGENTS_MD, name: "AGENTS.md" },
348
215
  { path: MEMORY_FILE, name: ".agents/MEMORY.md" },
349
216
  { path: TASKS_FILE, name: ".agents/TASKS.md" }
350
217
  ];
351
- if (options.opencode) {
352
- filesToCheck.push({ path: AGENTS_MD, name: "AGENTS.md" });
353
- }
354
- if (options.copilot) {
355
- filesToCheck.push({ path: COPILOT_INSTRUCTIONS, name: ".github/copilot-instructions.md" });
356
- }
357
- if (options.cursor) {
358
- filesToCheck.push({ path: ".cursorrules", name: ".cursorrules" });
359
- }
360
- if (options.windsurf) {
361
- filesToCheck.push({ path: ".windsurfrules", name: ".windsurfrules" });
362
- }
363
218
  const existingFiles = filesToCheck.filter((f) => existsSync3(join3(cwd, f.path)));
364
219
  if (existingFiles.length > 0) {
365
220
  console.log("\nExisting files found:");
@@ -394,9 +249,9 @@ Initializing agent memory in ${cwd}...
394
249
  }
395
250
  }
396
251
  console.log("\nNext steps:");
397
- console.log(" 1. Edit your IDE config file \u2014 add project-specific rules");
252
+ console.log(" 1. Edit AGENTS.md \u2014 add project-specific rules");
398
253
  console.log(" 2. Add spec files to .agents/spec/ for detailed documentation");
399
- console.log(" 3. Agent will read rules and write to .agents/MEMORY.md automatically");
254
+ console.log(" 3. AI agents will read AGENTS.md and write to .agents/ automatically");
400
255
  console.log("");
401
256
  rl.close();
402
257
  }
package/dist/index.js CHANGED
@@ -7,11 +7,9 @@ import { fileURLToPath } from "url";
7
7
  var AGENTS_DIR = ".agents";
8
8
  var SPEC_DIR = ".agents/spec";
9
9
  var MEMORY_FILE = ".agents/MEMORY.md";
10
+ var MEMORY_DETAIL_FILE = ".agents/MEMORY-DETAIL.md";
10
11
  var TASKS_FILE = ".agents/TASKS.md";
11
12
  var AGENTS_MD = "AGENTS.md";
12
- var COPILOT_INSTRUCTIONS = ".github/copilot-instructions.md";
13
- var CURSOR_RULES = ".cursorrules";
14
- var WINDSURF_RULES = ".windsurfrules";
15
13
 
16
14
  // src/core/scaffold.ts
17
15
  function getTemplatesDir() {
@@ -42,25 +40,25 @@ function scaffold(projectDir, options = {}) {
42
40
  const projectName = options.projectName || guessProjectName(projectDir);
43
41
  const vars = { PROJECT_NAME: projectName };
44
42
  const force = options.force || false;
45
- const hasAnyIde = options.opencode || options.copilot || options.cursor || options.windsurf;
46
- const useOpencode = hasAnyIde ? options.opencode : true;
47
- const useCopilot = options.copilot || false;
48
- const useCursor = options.cursor || false;
49
- const useWindsurf = options.windsurf || false;
50
43
  const dirs = [
51
44
  join(projectDir, AGENTS_DIR),
52
45
  join(projectDir, SPEC_DIR)
53
46
  ];
54
- if (useCopilot) {
55
- dirs.push(join(projectDir, ".github"));
56
- }
57
47
  for (const dir of dirs) {
58
48
  if (!existsSync(dir)) {
59
49
  mkdirSync(dir, { recursive: true });
60
50
  }
61
51
  }
52
+ writeFileIfNeeded(
53
+ join(projectDir, AGENTS_MD),
54
+ applyVars(readTemplate("AGENTS.md"), vars),
55
+ AGENTS_MD,
56
+ result,
57
+ force
58
+ );
62
59
  const coreFiles = [
63
60
  { target: MEMORY_FILE, template: "MEMORY.md" },
61
+ { target: MEMORY_DETAIL_FILE, template: "MEMORY-DETAIL.md" },
64
62
  { target: TASKS_FILE, template: "TASKS.md" }
65
63
  ];
66
64
  for (const { target, template } of coreFiles) {
@@ -78,42 +76,6 @@ function scaffold(projectDir, options = {}) {
78
76
  writeFileSync(specKeep, "");
79
77
  result.created.push(`${SPEC_DIR}/.gitkeep`);
80
78
  }
81
- if (useOpencode) {
82
- writeFileIfNeeded(
83
- join(projectDir, AGENTS_MD),
84
- applyVars(readTemplate("AGENTS.md"), vars),
85
- AGENTS_MD,
86
- result,
87
- force
88
- );
89
- }
90
- if (useCopilot) {
91
- writeFileIfNeeded(
92
- join(projectDir, COPILOT_INSTRUCTIONS),
93
- applyVars(readTemplate("copilot-instructions.md"), vars),
94
- COPILOT_INSTRUCTIONS,
95
- result,
96
- force
97
- );
98
- }
99
- if (useCursor) {
100
- writeFileIfNeeded(
101
- join(projectDir, CURSOR_RULES),
102
- applyVars(readTemplate("cursorrules.md"), vars),
103
- CURSOR_RULES,
104
- result,
105
- force
106
- );
107
- }
108
- if (useWindsurf) {
109
- writeFileIfNeeded(
110
- join(projectDir, WINDSURF_RULES),
111
- applyVars(readTemplate("windsurfrules.md"), vars),
112
- WINDSURF_RULES,
113
- result,
114
- force
115
- );
116
- }
117
79
  return result;
118
80
  }
119
81
  function writeFileIfNeeded(targetPath, content, displayName, result, force) {
@@ -245,7 +207,7 @@ import { join as join4 } from "path";
245
207
  function doctor(projectDir) {
246
208
  const issues = [];
247
209
  const required = [
248
- { file: AGENTS_MD, desc: "Root router file" },
210
+ { file: AGENTS_MD, desc: "Root agent instructions" },
249
211
  { file: MEMORY_FILE, desc: "Long-term memory" },
250
212
  { file: TASKS_FILE, desc: "Working memory" }
251
213
  ];
@@ -260,14 +222,6 @@ function doctor(projectDir) {
260
222
  issues.push({ level: "error", file: dir, message: "Directory missing" });
261
223
  }
262
224
  }
263
- const copilotPath = join4(projectDir, COPILOT_INSTRUCTIONS);
264
- if (!existsSync4(copilotPath)) {
265
- issues.push({
266
- level: "warning",
267
- file: COPILOT_INSTRUCTIONS,
268
- message: "Copilot instructions missing \u2014 VSCode/GitHub Copilot won't have context"
269
- });
270
- }
271
225
  const agentsPath = join4(projectDir, AGENTS_MD);
272
226
  if (existsSync4(agentsPath)) {
273
227
  const content = readFileSync4(agentsPath, "utf-8");
@@ -282,7 +236,7 @@ function doctor(projectDir) {
282
236
  issues.push({
283
237
  level: "warning",
284
238
  file: AGENTS_MD,
285
- message: "Over 150 lines \u2014 consider keeping it concise as a router"
239
+ message: "Over 150 lines \u2014 consider keeping it concise"
286
240
  });
287
241
  }
288
242
  }
@@ -297,64 +251,15 @@ function doctor(projectDir) {
297
251
  });
298
252
  }
299
253
  }
300
- const opencodePkgPath = join4(projectDir, ".opencode", "package.json");
301
- const opencodeJsonPath = join4(projectDir, "opencode.json");
302
- const opencodeExists = existsSync4(join4(projectDir, ".opencode"));
303
- if (opencodeExists) {
304
- if (!existsSync4(opencodePkgPath)) {
305
- issues.push({
306
- level: "warning",
307
- file: ".opencode/package.json",
308
- message: "Missing \u2014 run 'agent-memory init --opencode' to wire up the plugin"
309
- });
310
- } else {
311
- try {
312
- const pkg = JSON.parse(readFileSync4(opencodePkgPath, "utf-8"));
313
- const deps = { ...pkg.dependencies, ...pkg.devDependencies };
314
- if (!deps["@vuau/agent-memory"]) {
315
- issues.push({
316
- level: "warning",
317
- file: ".opencode/package.json",
318
- message: "@vuau/agent-memory not in dependencies \u2014 run 'agent-memory init --opencode'"
319
- });
320
- }
321
- } catch {
322
- issues.push({ level: "warning", file: ".opencode/package.json", message: "Invalid JSON" });
323
- }
324
- }
325
- if (!existsSync4(opencodeJsonPath)) {
326
- issues.push({
327
- level: "warning",
328
- file: "opencode.json",
329
- message: "Missing \u2014 run 'agent-memory init --opencode' to wire up the plugin"
330
- });
331
- } else {
332
- try {
333
- const config = JSON.parse(readFileSync4(opencodeJsonPath, "utf-8"));
334
- const plugins = config.plugin || [];
335
- if (!plugins.includes("@vuau/agent-memory")) {
336
- issues.push({
337
- level: "warning",
338
- file: "opencode.json",
339
- message: "@vuau/agent-memory not in plugin array \u2014 run 'agent-memory init --opencode'"
340
- });
341
- }
342
- } catch {
343
- issues.push({ level: "warning", file: "opencode.json", message: "Invalid JSON" });
344
- }
345
- }
346
- }
347
254
  return { ok: issues.filter((i) => i.level === "error").length === 0, issues };
348
255
  }
349
256
  export {
350
257
  AGENTS_DIR,
351
258
  AGENTS_MD,
352
- COPILOT_INSTRUCTIONS,
353
- CURSOR_RULES,
259
+ MEMORY_DETAIL_FILE,
354
260
  MEMORY_FILE,
355
261
  SPEC_DIR,
356
262
  TASKS_FILE,
357
- WINDSURF_RULES,
358
263
  appendMemory,
359
264
  doctor,
360
265
  readMemory,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vuau/agent-memory",
3
- "version": "0.3.0",
4
- "description": "Structured AI memory for codebases — scaffolding CLI for OpenCode, Copilot, Cursor, Windsurf",
3
+ "version": "0.4.0",
4
+ "description": "Structured AI memory for codebases — works with GitHub Copilot, Cursor, Windsurf, VS Code, OpenCode, and 25+ AI tools",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "exports": {
@@ -12,7 +12,8 @@ Router file for AI agents. Keep under 150 lines.
12
12
 
13
13
  | Task | Spec File |
14
14
  |------|-----------|
15
- | Past decisions & patterns | `.agents/MEMORY.md` |
15
+ | Past decisions (1-line) | `.agents/MEMORY.md` |
16
+ | Past decisions (full context) | `.agents/MEMORY-DETAIL.md` |
16
17
  | Current work in progress | `.agents/TASKS.md` |
17
18
 
18
19
  > Add your own spec files to `.agents/spec/` and reference them here.
@@ -26,9 +27,9 @@ Router file for AI agents. Keep under 150 lines.
26
27
 
27
28
  ### MEMORY.md entry format
28
29
  ```
29
- - YYYY-MM-DD: <1-line decision or pattern>
30
+ - YYYY-MM-DD: <1-line decision or pattern> → detail
30
31
  ```
31
- Place under the appropriate category. Add `→ spec file` pointer if details belong in a spec.
32
+ Place under the appropriate category. Add `→ detail` pointer when full context exists in MEMORY-DETAIL.md.
32
33
 
33
34
  ### TASKS.md update
34
35
  Before ending a session with unfinished work, move items to `## In Progress` or `## Up Next`.
@@ -0,0 +1,16 @@
1
+ # Memory Detail
2
+
3
+ Full Problem/Solution context for entries in MEMORY.md. Read on-demand when needing to understand *why* a decision was made.
4
+
5
+ ---
6
+
7
+ ## Example Category
8
+
9
+ ### Example decision title
10
+ - **Date**: YYYY-MM-DD
11
+ - **Problem**: What issue or question prompted this decision
12
+ - **Solution**: What was decided and why
13
+
14
+ ---
15
+
16
+ <!-- Add new detailed entries below. Use the format above. -->
@@ -1,30 +0,0 @@
1
- # {{PROJECT_NAME}} - Copilot Instructions (VSCode)
2
-
3
- Router file for GitHub Copilot. Points to shared agent documentation.
4
-
5
- ## Priority
6
- 1. Follow direct user request.
7
- 2. Follow this file.
8
- 3. Follow spec files in `.agents/spec/`.
9
- 4. If conflict remains, choose smallest safe change and state assumptions.
10
-
11
- ## Documentation Map
12
-
13
- | Task | Spec File |
14
- |------|-----------|
15
- | Past decisions & patterns | `.agents/MEMORY.md` |
16
- | Current work in progress | `.agents/TASKS.md` |
17
-
18
- > Add your own spec files to `.agents/spec/` and reference them here.
19
-
20
- ## Response Style
21
- - Concise, concrete, implementation-focused.
22
- - If uncertain, say "I don't know" and give fastest verification step.
23
- - Do not invent files, APIs, or command results.
24
- - Keep diffs minimal, aligned with existing conventions.
25
-
26
- ## Memory Protocol
27
- - When user approves a decision → append 1-line entry to `.agents/MEMORY.md` under appropriate category.
28
- - Format: `- YYYY-MM-DD: <decision>`.
29
- - Read `.agents/MEMORY.md` before implementing; follow spec file pointers for details.
30
- - Do not create additional memory files.
@@ -1,43 +0,0 @@
1
- # {{PROJECT_NAME}} - Cursor Rules
2
-
3
- Instructions for Cursor AI. Keep under 150 lines.
4
-
5
- ## Priority
6
- 1. User request first.
7
- 2. These rules.
8
- 3. Spec files in `.agents/spec/`.
9
- 4. If conflict remains, choose smallest safe change and state assumption.
10
-
11
- ## Documentation Map
12
-
13
- | Task | Location |
14
- |------|----------|
15
- | Past decisions & patterns | `.agents/MEMORY.md` |
16
- | Current work in progress | `.agents/TASKS.md` |
17
- | Detailed specs | `.agents/spec/*.md` |
18
-
19
- ## Memory Protocol
20
-
21
- ### When to write
22
- - User approves a decision or pattern → append to `.agents/MEMORY.md`
23
- - Explore codebase/architecture → update relevant `.agents/spec/*.md`
24
- - Start/finish a large task → update `.agents/TASKS.md`
25
-
26
- ### MEMORY.md entry format
27
- ```
28
- - YYYY-MM-DD: <1-line decision or pattern>
29
- ```
30
- Place under the appropriate category. Add `→ spec file` pointer if details belong in a spec.
31
-
32
- ### TASKS.md update
33
- Before ending a session with unfinished work, move items to `## In Progress` or `## Up Next`.
34
-
35
- ### Rules
36
- - Keep MEMORY.md entries to 1 line each. Details go in spec files.
37
- - If MEMORY.md > 150 lines, archive old entries.
38
- - Do not create additional memory files outside `.agents/`.
39
-
40
- ## Response Style
41
- - Concise, concrete, implementation-focused.
42
- - If uncertain, say `I don't know`, then give fastest verification step.
43
- - Do not invent files, APIs, or command outputs.
@@ -1,43 +0,0 @@
1
- # {{PROJECT_NAME}} - Windsurf Rules
2
-
3
- Instructions for Windsurf AI. Keep under 150 lines.
4
-
5
- ## Priority
6
- 1. User request first.
7
- 2. These rules.
8
- 3. Spec files in `.agents/spec/`.
9
- 4. If conflict remains, choose smallest safe change and state assumption.
10
-
11
- ## Documentation Map
12
-
13
- | Task | Location |
14
- |------|----------|
15
- | Past decisions & patterns | `.agents/MEMORY.md` |
16
- | Current work in progress | `.agents/TASKS.md` |
17
- | Detailed specs | `.agents/spec/*.md` |
18
-
19
- ## Memory Protocol
20
-
21
- ### When to write
22
- - User approves a decision or pattern → append to `.agents/MEMORY.md`
23
- - Explore codebase/architecture → update relevant `.agents/spec/*.md`
24
- - Start/finish a large task → update `.agents/TASKS.md`
25
-
26
- ### MEMORY.md entry format
27
- ```
28
- - YYYY-MM-DD: <1-line decision or pattern>
29
- ```
30
- Place under the appropriate category. Add `→ spec file` pointer if details belong in a spec.
31
-
32
- ### TASKS.md update
33
- Before ending a session with unfinished work, move items to `## In Progress` or `## Up Next`.
34
-
35
- ### Rules
36
- - Keep MEMORY.md entries to 1 line each. Details go in spec files.
37
- - If MEMORY.md > 150 lines, archive old entries.
38
- - Do not create additional memory files outside `.agents/`.
39
-
40
- ## Response Style
41
- - Concise, concrete, implementation-focused.
42
- - If uncertain, say `I don't know`, then give fastest verification step.
43
- - Do not invent files, APIs, or command outputs.