@vuau/agent-memory 0.4.0 → 0.4.1
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 +24 -22
- package/README.vi.md +24 -22
- package/dist/bin/cli.js +18 -67
- package/dist/index.js +9 -9
- package/docs/ARCHITECTURE.md +15 -24
- package/docs/ARCHITECTURE.vi.md +15 -23
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @vuau/agent-memory
|
|
2
2
|
|
|
3
|
-
Structured AI memory for codebases.
|
|
3
|
+
Structured AI memory for codebases. Uses `AGENTS.md` to work with OpenCode, GitHub Copilot, Cursor, Windsurf, and any AI coding assistant that reads markdown files.
|
|
4
4
|
|
|
5
5
|
**[Tiếng Việt →](./README.vi.md)**
|
|
6
6
|
|
|
@@ -19,28 +19,26 @@ AI coding assistants lose context between sessions. They can't remember:
|
|
|
19
19
|
npx @vuau/agent-memory init
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
That's it. Creates `AGENTS.md` + `.agents/` structure.
|
|
23
|
-
|
|
24
22
|
## What It Creates
|
|
25
23
|
|
|
26
24
|
```
|
|
27
25
|
/ (Project Root)
|
|
28
|
-
├── AGENTS.md
|
|
26
|
+
├── AGENTS.md # Root agent rules
|
|
29
27
|
└── .agents/
|
|
30
|
-
├── MEMORY.md
|
|
31
|
-
├── TASKS.md
|
|
32
|
-
└── spec/
|
|
28
|
+
├── MEMORY.md # Long-term memory (decisions, patterns)
|
|
29
|
+
├── TASKS.md # Working memory (current tasks)
|
|
30
|
+
└── spec/ # Detailed specs (on-demand)
|
|
33
31
|
```
|
|
34
32
|
|
|
35
33
|
## How It Works
|
|
36
34
|
|
|
37
35
|
1. **You run `init`** → Creates `AGENTS.md` + `.agents/` structure
|
|
38
|
-
2. **Agent reads
|
|
36
|
+
2. **Agent reads rules** → Finds documentation map pointing to `.agents/`
|
|
39
37
|
3. **Agent works** → Reads MEMORY.md before implementing, updates TASKS.md
|
|
40
38
|
4. **You approve decision** → Agent writes 1-line entry to MEMORY.md
|
|
41
39
|
5. **Next session** → Agent reads memory, continues where you left off
|
|
42
40
|
|
|
43
|
-
**No plugin required.** The
|
|
41
|
+
**No plugin required.** The rules in `AGENTS.md` instruct the agent what to do.
|
|
44
42
|
|
|
45
43
|
## CLI Options
|
|
46
44
|
|
|
@@ -48,8 +46,8 @@ That's it. Creates `AGENTS.md` + `.agents/` structure.
|
|
|
48
46
|
npx @vuau/agent-memory init [options]
|
|
49
47
|
|
|
50
48
|
Options:
|
|
51
|
-
--force
|
|
52
|
-
--name <n>
|
|
49
|
+
--force Overwrite existing files without asking
|
|
50
|
+
--name <n> Project name (default: from package.json)
|
|
53
51
|
|
|
54
52
|
npx @vuau/agent-memory doctor # Validate structure
|
|
55
53
|
npx @vuau/agent-memory help # Show help
|
|
@@ -57,7 +55,7 @@ npx @vuau/agent-memory help # Show help
|
|
|
57
55
|
|
|
58
56
|
## Memory Protocol
|
|
59
57
|
|
|
60
|
-
Agents follow this protocol (defined in
|
|
58
|
+
Agents follow this protocol (defined in config files):
|
|
61
59
|
|
|
62
60
|
```markdown
|
|
63
61
|
## When to write
|
|
@@ -82,11 +80,11 @@ Agents follow this protocol (defined in AGENTS.md):
|
|
|
82
80
|
|
|
83
81
|
## Architecture
|
|
84
82
|
|
|
85
|
-
###
|
|
83
|
+
### 4-Layer Design
|
|
86
84
|
|
|
87
85
|
| Layer | File | Purpose |
|
|
88
86
|
|-------|------|---------|
|
|
89
|
-
|
|
|
87
|
+
| Router | AGENTS.md | Rules + pointers (~100 lines) |
|
|
90
88
|
| Memory | .agents/MEMORY.md | Curated decisions (1-line each) |
|
|
91
89
|
| Tasks | .agents/TASKS.md | Current work, next steps |
|
|
92
90
|
| Specs | .agents/spec/*.md | Detailed docs (on-demand) |
|
|
@@ -104,17 +102,21 @@ File-based solution:
|
|
|
104
102
|
- Plain markdown (portable, git-versionable, human-readable)
|
|
105
103
|
- No dependencies (works everywhere)
|
|
106
104
|
|
|
107
|
-
##
|
|
105
|
+
## Cross-IDE Compatibility
|
|
106
|
+
|
|
107
|
+
By default, we only scaffold `AGENTS.md`, which is an emerging standard router file.
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
If your tool requires a specific file (e.g. Cursor requires `.cursorrules`, GitHub Copilot requires `.github/copilot-instructions.md`), you can simply symlink or copy `AGENTS.md`:
|
|
110
110
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
111
|
+
```bash
|
|
112
|
+
# For Cursor
|
|
113
|
+
ln -s AGENTS.md .cursorrules
|
|
114
|
+
|
|
115
|
+
# For GitHub Copilot
|
|
116
|
+
mkdir -p .github && ln -s ../AGENTS.md .github/copilot-instructions.md
|
|
117
|
+
```
|
|
116
118
|
|
|
117
|
-
|
|
119
|
+
All tools will read from the same underlying `.agents/` memory structure.
|
|
118
120
|
|
|
119
121
|
## Documentation
|
|
120
122
|
|
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.
|
|
3
|
+
Bộ nhớ AI có cấu trúc cho các codebase. Sử dụng `AGENTS.md` để hoạt động với OpenCode, GitHub Copilot, Cursor, Windsurf, và bất kỳ AI coding assistant nào đọc markdown files.
|
|
4
4
|
|
|
5
5
|
## Bài toán
|
|
6
6
|
|
|
@@ -17,28 +17,26 @@ AI coding assistants mất bối cảnh giữa các phiên. Họ không thể nh
|
|
|
17
17
|
npx @vuau/agent-memory init
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
Đơn giản vậy thôi. Tạo `AGENTS.md` + `.agents/` structure.
|
|
21
|
-
|
|
22
20
|
## Cấu trúc tạo ra
|
|
23
21
|
|
|
24
22
|
```
|
|
25
23
|
/ (Project Root)
|
|
26
|
-
├── AGENTS.md
|
|
24
|
+
├── AGENTS.md # Root agent rules
|
|
27
25
|
└── .agents/
|
|
28
|
-
├── MEMORY.md
|
|
29
|
-
├── TASKS.md
|
|
30
|
-
└── spec/
|
|
26
|
+
├── MEMORY.md # Long-term memory (decisions, patterns)
|
|
27
|
+
├── TASKS.md # Working memory (current tasks)
|
|
28
|
+
└── spec/ # Detailed specs (on-demand)
|
|
31
29
|
```
|
|
32
30
|
|
|
33
31
|
## Cách hoạt động
|
|
34
32
|
|
|
35
33
|
1. **Bạn chạy `init`** → Tạo `AGENTS.md` + `.agents/` structure
|
|
36
|
-
2. **Agent đọc
|
|
34
|
+
2. **Agent đọc rules** → Tìm documentation map trỏ đến `.agents/`
|
|
37
35
|
3. **Agent làm việc** → Đọc MEMORY.md trước khi implement, update TASKS.md
|
|
38
36
|
4. **Bạn approve decision** → Agent ghi 1-line entry vào MEMORY.md
|
|
39
37
|
5. **Phiên tiếp theo** → Agent đọc memory, tiếp tục từ nơi dừng lại
|
|
40
38
|
|
|
41
|
-
**Không cần plugin.**
|
|
39
|
+
**Không cần plugin.** Rules trong `AGENTS.md` hướng dẫn agent phải làm gì.
|
|
42
40
|
|
|
43
41
|
## CLI Options
|
|
44
42
|
|
|
@@ -46,8 +44,8 @@ npx @vuau/agent-memory init
|
|
|
46
44
|
npx @vuau/agent-memory init [options]
|
|
47
45
|
|
|
48
46
|
Options:
|
|
49
|
-
--force
|
|
50
|
-
--name <n>
|
|
47
|
+
--force Ghi đè files có sẵn mà không hỏi
|
|
48
|
+
--name <n> Tên project (mặc định: từ package.json)
|
|
51
49
|
|
|
52
50
|
npx @vuau/agent-memory doctor # Validate structure
|
|
53
51
|
npx @vuau/agent-memory help # Hiện help
|
|
@@ -55,7 +53,7 @@ npx @vuau/agent-memory help # Hiện help
|
|
|
55
53
|
|
|
56
54
|
## Memory Protocol
|
|
57
55
|
|
|
58
|
-
Agents follow protocol này (defined trong
|
|
56
|
+
Agents follow protocol này (defined trong config files):
|
|
59
57
|
|
|
60
58
|
```markdown
|
|
61
59
|
## Khi nào ghi
|
|
@@ -80,11 +78,11 @@ Agents follow protocol này (defined trong AGENTS.md):
|
|
|
80
78
|
|
|
81
79
|
## Kiến trúc
|
|
82
80
|
|
|
83
|
-
### Thiết kế
|
|
81
|
+
### Thiết kế 4-Layer
|
|
84
82
|
|
|
85
83
|
| Layer | File | Mục đích |
|
|
86
84
|
|-------|------|----------|
|
|
87
|
-
|
|
|
85
|
+
| Router | AGENTS.md | Rules + pointers (~100 dòng) |
|
|
88
86
|
| Memory | .agents/MEMORY.md | Curated decisions (1-line each) |
|
|
89
87
|
| Tasks | .agents/TASKS.md | Current work, next steps |
|
|
90
88
|
| Specs | .agents/spec/*.md | Detailed docs (on-demand) |
|
|
@@ -102,17 +100,21 @@ File-based solution:
|
|
|
102
100
|
- Plain markdown (portable, git-versionable, human-readable)
|
|
103
101
|
- Không dependencies (works everywhere)
|
|
104
102
|
|
|
105
|
-
##
|
|
103
|
+
## Cross-IDE Compatibility
|
|
104
|
+
|
|
105
|
+
Mặc định, công cụ chỉ scaffold `AGENTS.md`, một chuẩn router file đang phổ biến.
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
Nếu công cụ của bạn yêu cầu một file cụ thể (vd: Cursor yêu cầu `.cursorrules`, GitHub Copilot yêu cầu `.github/copilot-instructions.md`), bạn có thể đơn giản dùng symlink hoặc copy `AGENTS.md`:
|
|
108
108
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
109
|
+
```bash
|
|
110
|
+
# Cho Cursor
|
|
111
|
+
ln -s AGENTS.md .cursorrules
|
|
112
|
+
|
|
113
|
+
# Cho GitHub Copilot
|
|
114
|
+
mkdir -p .github && ln -s ../AGENTS.md .github/copilot-instructions.md
|
|
115
|
+
```
|
|
114
116
|
|
|
115
|
-
|
|
117
|
+
Tất cả các công cụ sẽ cùng đọc chung cấu trúc bộ nhớ bên trong thư mục `.agents/`.
|
|
116
118
|
|
|
117
119
|
## Tài liệu
|
|
118
120
|
|
package/dist/bin/cli.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
// bin/cli.ts
|
|
4
|
-
import * as readline from "readline";
|
|
5
|
-
import { existsSync as existsSync3 } from "fs";
|
|
6
|
-
import { join as join3 } from "path";
|
|
7
|
-
|
|
8
3
|
// src/core/scaffold.ts
|
|
9
4
|
import { existsSync, mkdirSync, writeFileSync, readFileSync } from "fs";
|
|
10
5
|
import { join, resolve, dirname } from "path";
|
|
@@ -56,13 +51,6 @@ function scaffold(projectDir, options = {}) {
|
|
|
56
51
|
mkdirSync(dir, { recursive: true });
|
|
57
52
|
}
|
|
58
53
|
}
|
|
59
|
-
writeFileIfNeeded(
|
|
60
|
-
join(projectDir, AGENTS_MD),
|
|
61
|
-
applyVars(readTemplate("AGENTS.md"), vars),
|
|
62
|
-
AGENTS_MD,
|
|
63
|
-
result,
|
|
64
|
-
force
|
|
65
|
-
);
|
|
66
54
|
const coreFiles = [
|
|
67
55
|
{ target: MEMORY_FILE, template: "MEMORY.md" },
|
|
68
56
|
{ target: MEMORY_DETAIL_FILE, template: "MEMORY-DETAIL.md" },
|
|
@@ -83,6 +71,13 @@ function scaffold(projectDir, options = {}) {
|
|
|
83
71
|
writeFileSync(specKeep, "");
|
|
84
72
|
result.created.push(`${SPEC_DIR}/.gitkeep`);
|
|
85
73
|
}
|
|
74
|
+
writeFileIfNeeded(
|
|
75
|
+
join(projectDir, AGENTS_MD),
|
|
76
|
+
applyVars(readTemplate("AGENTS.md"), vars),
|
|
77
|
+
AGENTS_MD,
|
|
78
|
+
result,
|
|
79
|
+
force
|
|
80
|
+
);
|
|
86
81
|
return result;
|
|
87
82
|
}
|
|
88
83
|
function writeFileIfNeeded(targetPath, content, displayName, result, force) {
|
|
@@ -111,7 +106,7 @@ import { join as join2 } from "path";
|
|
|
111
106
|
function doctor(projectDir) {
|
|
112
107
|
const issues = [];
|
|
113
108
|
const required = [
|
|
114
|
-
{ file: AGENTS_MD, desc: "Root
|
|
109
|
+
{ file: AGENTS_MD, desc: "Root router file" },
|
|
115
110
|
{ file: MEMORY_FILE, desc: "Long-term memory" },
|
|
116
111
|
{ file: TASKS_FILE, desc: "Working memory" }
|
|
117
112
|
];
|
|
@@ -140,7 +135,7 @@ function doctor(projectDir) {
|
|
|
140
135
|
issues.push({
|
|
141
136
|
level: "warning",
|
|
142
137
|
file: AGENTS_MD,
|
|
143
|
-
message: "Over 150 lines \u2014 consider keeping it concise"
|
|
138
|
+
message: "Over 150 lines \u2014 consider keeping it concise as a router"
|
|
144
139
|
});
|
|
145
140
|
}
|
|
146
141
|
}
|
|
@@ -161,28 +156,12 @@ function doctor(projectDir) {
|
|
|
161
156
|
// bin/cli.ts
|
|
162
157
|
var args = process.argv.slice(2);
|
|
163
158
|
var command = args[0];
|
|
164
|
-
var rl = readline.createInterface({
|
|
165
|
-
input: process.stdin,
|
|
166
|
-
output: process.stdout
|
|
167
|
-
});
|
|
168
|
-
function ask(question) {
|
|
169
|
-
return new Promise((resolve2) => {
|
|
170
|
-
rl.question(question, (answer) => resolve2(answer.trim()));
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
function askYesNo(question, defaultYes = true) {
|
|
174
|
-
const hint = defaultYes ? "(Y/n)" : "(y/N)";
|
|
175
|
-
return ask(`${question} ${hint} `).then((answer) => {
|
|
176
|
-
if (!answer) return defaultYes;
|
|
177
|
-
return answer.toLowerCase().startsWith("y");
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
159
|
function printUsage() {
|
|
181
160
|
console.log(`
|
|
182
161
|
@vuau/agent-memory \u2014 Structured AI memory for codebases
|
|
183
162
|
|
|
184
163
|
Usage:
|
|
185
|
-
agent-memory init [options] Scaffold
|
|
164
|
+
agent-memory init [options] Scaffold .agents/ structure and AGENTS.md
|
|
186
165
|
agent-memory doctor Validate .agents/ structure
|
|
187
166
|
agent-memory help Show this help
|
|
188
167
|
|
|
@@ -191,14 +170,8 @@ Options (init):
|
|
|
191
170
|
--name <name> Project name (default: from package.json)
|
|
192
171
|
|
|
193
172
|
Examples:
|
|
194
|
-
npx @vuau/agent-memory init
|
|
195
|
-
npx @vuau/agent-memory init --force
|
|
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...
|
|
173
|
+
npx @vuau/agent-memory init
|
|
174
|
+
npx @vuau/agent-memory init --force
|
|
202
175
|
`);
|
|
203
176
|
}
|
|
204
177
|
async function runInit() {
|
|
@@ -207,31 +180,9 @@ async function runInit() {
|
|
|
207
180
|
const nameIdx = args.indexOf("--name");
|
|
208
181
|
const projectName = nameIdx !== -1 ? args[nameIdx + 1] : void 0;
|
|
209
182
|
const options = {
|
|
210
|
-
projectName
|
|
183
|
+
projectName,
|
|
184
|
+
force
|
|
211
185
|
};
|
|
212
|
-
if (!force) {
|
|
213
|
-
const filesToCheck = [
|
|
214
|
-
{ path: AGENTS_MD, name: "AGENTS.md" },
|
|
215
|
-
{ path: MEMORY_FILE, name: ".agents/MEMORY.md" },
|
|
216
|
-
{ path: TASKS_FILE, name: ".agents/TASKS.md" }
|
|
217
|
-
];
|
|
218
|
-
const existingFiles = filesToCheck.filter((f) => existsSync3(join3(cwd, f.path)));
|
|
219
|
-
if (existingFiles.length > 0) {
|
|
220
|
-
console.log("\nExisting files found:");
|
|
221
|
-
for (const f of existingFiles) {
|
|
222
|
-
console.log(` - ${f.name}`);
|
|
223
|
-
}
|
|
224
|
-
const overwrite = await askYesNo("\nOverwrite these files?", false);
|
|
225
|
-
if (!overwrite) {
|
|
226
|
-
console.log("\nAborted. Use --force to overwrite without asking.\n");
|
|
227
|
-
rl.close();
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
options.force = true;
|
|
231
|
-
}
|
|
232
|
-
} else {
|
|
233
|
-
options.force = true;
|
|
234
|
-
}
|
|
235
186
|
console.log(`
|
|
236
187
|
Initializing agent memory in ${cwd}...
|
|
237
188
|
`);
|
|
@@ -247,13 +198,15 @@ Initializing agent memory in ${cwd}...
|
|
|
247
198
|
for (const f of result.skipped) {
|
|
248
199
|
console.log(` - ${f}`);
|
|
249
200
|
}
|
|
201
|
+
if (!force) {
|
|
202
|
+
console.log("\nTip: Use --force to overwrite existing files.");
|
|
203
|
+
}
|
|
250
204
|
}
|
|
251
205
|
console.log("\nNext steps:");
|
|
252
206
|
console.log(" 1. Edit AGENTS.md \u2014 add project-specific rules");
|
|
253
207
|
console.log(" 2. Add spec files to .agents/spec/ for detailed documentation");
|
|
254
|
-
console.log(" 3.
|
|
208
|
+
console.log(" 3. Agent will read rules and write to .agents/MEMORY.md automatically");
|
|
255
209
|
console.log("");
|
|
256
|
-
rl.close();
|
|
257
210
|
}
|
|
258
211
|
function runDoctor() {
|
|
259
212
|
const cwd = process.cwd();
|
|
@@ -278,7 +231,6 @@ switch (command) {
|
|
|
278
231
|
case "init":
|
|
279
232
|
runInit().catch((err) => {
|
|
280
233
|
console.error("Error:", err.message);
|
|
281
|
-
rl.close();
|
|
282
234
|
process.exit(1);
|
|
283
235
|
});
|
|
284
236
|
break;
|
|
@@ -293,7 +245,6 @@ switch (command) {
|
|
|
293
245
|
case void 0:
|
|
294
246
|
runInit().catch((err) => {
|
|
295
247
|
console.error("Error:", err.message);
|
|
296
|
-
rl.close();
|
|
297
248
|
process.exit(1);
|
|
298
249
|
});
|
|
299
250
|
break;
|
package/dist/index.js
CHANGED
|
@@ -49,13 +49,6 @@ function scaffold(projectDir, options = {}) {
|
|
|
49
49
|
mkdirSync(dir, { recursive: true });
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
writeFileIfNeeded(
|
|
53
|
-
join(projectDir, AGENTS_MD),
|
|
54
|
-
applyVars(readTemplate("AGENTS.md"), vars),
|
|
55
|
-
AGENTS_MD,
|
|
56
|
-
result,
|
|
57
|
-
force
|
|
58
|
-
);
|
|
59
52
|
const coreFiles = [
|
|
60
53
|
{ target: MEMORY_FILE, template: "MEMORY.md" },
|
|
61
54
|
{ target: MEMORY_DETAIL_FILE, template: "MEMORY-DETAIL.md" },
|
|
@@ -76,6 +69,13 @@ function scaffold(projectDir, options = {}) {
|
|
|
76
69
|
writeFileSync(specKeep, "");
|
|
77
70
|
result.created.push(`${SPEC_DIR}/.gitkeep`);
|
|
78
71
|
}
|
|
72
|
+
writeFileIfNeeded(
|
|
73
|
+
join(projectDir, AGENTS_MD),
|
|
74
|
+
applyVars(readTemplate("AGENTS.md"), vars),
|
|
75
|
+
AGENTS_MD,
|
|
76
|
+
result,
|
|
77
|
+
force
|
|
78
|
+
);
|
|
79
79
|
return result;
|
|
80
80
|
}
|
|
81
81
|
function writeFileIfNeeded(targetPath, content, displayName, result, force) {
|
|
@@ -207,7 +207,7 @@ import { join as join4 } from "path";
|
|
|
207
207
|
function doctor(projectDir) {
|
|
208
208
|
const issues = [];
|
|
209
209
|
const required = [
|
|
210
|
-
{ file: AGENTS_MD, desc: "Root
|
|
210
|
+
{ file: AGENTS_MD, desc: "Root router file" },
|
|
211
211
|
{ file: MEMORY_FILE, desc: "Long-term memory" },
|
|
212
212
|
{ file: TASKS_FILE, desc: "Working memory" }
|
|
213
213
|
];
|
|
@@ -236,7 +236,7 @@ function doctor(projectDir) {
|
|
|
236
236
|
issues.push({
|
|
237
237
|
level: "warning",
|
|
238
238
|
file: AGENTS_MD,
|
|
239
|
-
message: "Over 150 lines \u2014 consider keeping it concise"
|
|
239
|
+
message: "Over 150 lines \u2014 consider keeping it concise as a router"
|
|
240
240
|
});
|
|
241
241
|
}
|
|
242
242
|
}
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -168,28 +168,21 @@ This document proposes a generalizable architecture for AI memory across codebas
|
|
|
168
168
|
|
|
169
169
|
---
|
|
170
170
|
|
|
171
|
-
##
|
|
171
|
+
## Integration Points
|
|
172
172
|
|
|
173
|
-
|
|
174
|
-
- Reads: AGENTS.md (via plugin hook)
|
|
175
|
-
- Plugin auto-injects: `.agents/MEMORY.md` context on session start
|
|
176
|
-
- Plugin reminds: Update TASKS.md on session idle
|
|
177
|
-
- Writes: Agent appends to MEMORY.md/TASKS.md/spec/
|
|
173
|
+
By default, we scaffold `AGENTS.md` which acts as the root router for your AI coding assistant. This file contains rules and documentation maps that point to the `.agents/` folder.
|
|
178
174
|
|
|
179
|
-
|
|
180
|
-
- Reads: `.github/copilot-instructions.md` (GitHub convention)
|
|
181
|
-
- copilot-instructions.md = same router format as AGENTS.md
|
|
182
|
-
- Points to `.agents/MEMORY.md` + spec files
|
|
183
|
-
- Writes: User includes `@save memory: <decision>` in chat → agent appends
|
|
175
|
+
If your specific AI tool requires a different file name, you can simply symlink the `AGENTS.md` file:
|
|
184
176
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
-
|
|
188
|
-
- Writes: Agent rules instruct direct append
|
|
177
|
+
```bash
|
|
178
|
+
# Example: For Cursor
|
|
179
|
+
ln -s AGENTS.md .cursorrules
|
|
189
180
|
|
|
190
|
-
|
|
191
|
-
-
|
|
192
|
-
|
|
181
|
+
# Example: For GitHub Copilot
|
|
182
|
+
mkdir -p .github && ln -s ../AGENTS.md .github/copilot-instructions.md
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
This ensures a single source of truth (`AGENTS.md`) is maintained while providing backward compatibility with any tool.
|
|
193
186
|
|
|
194
187
|
---
|
|
195
188
|
|
|
@@ -219,12 +212,12 @@ This document proposes a generalizable architecture for AI memory across codebas
|
|
|
219
212
|
- Keep `.memsearch/memory/` as archive (1 year retention)
|
|
220
213
|
- Delete milvus.db
|
|
221
214
|
|
|
222
|
-
### From .
|
|
215
|
+
### From Monolithic Config Files (e.g. .cursorrules)
|
|
223
216
|
|
|
224
217
|
1. **Extract decisions** → `.agents/MEMORY.md`
|
|
225
218
|
2. **Extract patterns** → `.agents/spec/patterns.md`
|
|
226
219
|
3. **Extract commands** → `AGENTS.md`
|
|
227
|
-
4. **Keep router** →
|
|
220
|
+
4. **Keep router** → Create symlink from your old config file to `AGENTS.md`
|
|
228
221
|
|
|
229
222
|
---
|
|
230
223
|
|
|
@@ -254,10 +247,8 @@ This document proposes a generalizable architecture for AI memory across codebas
|
|
|
254
247
|
## Tooling Support
|
|
255
248
|
|
|
256
249
|
### CLI
|
|
257
|
-
- ✓ `npx @vuau/agent-memory init` — scaffold structure (
|
|
258
|
-
- ✓ `npx @vuau/agent-memory init --
|
|
259
|
-
- ✓ `npx @vuau/agent-memory init --copilot --cursor` — multiple IDEs
|
|
260
|
-
- ✓ `npx @vuau/agent-memory init --all` — all IDEs
|
|
250
|
+
- ✓ `npx @vuau/agent-memory init` — scaffold structure (`AGENTS.md` + `.agents/`)
|
|
251
|
+
- ✓ `npx @vuau/agent-memory init --force` — overwrite existing files
|
|
261
252
|
- ✓ `npx @vuau/agent-memory doctor` — validate structure
|
|
262
253
|
- Planned: ✗ `report` — generate memory stats, archival suggestions
|
|
263
254
|
|
package/docs/ARCHITECTURE.vi.md
CHANGED
|
@@ -168,27 +168,21 @@ Tài liệu này đề xuất kiến trúc khả năng skalabiliti cho AI memory
|
|
|
168
168
|
|
|
169
169
|
---
|
|
170
170
|
|
|
171
|
-
##
|
|
171
|
+
## Điểm Tích Hợp
|
|
172
172
|
|
|
173
|
-
|
|
174
|
-
- Reads: `AGENTS.md` (native)
|
|
175
|
-
- Agents follow rules trong AGENTS.md
|
|
176
|
-
- Writes: Agent appends đến MEMORY.md/TASKS.md/spec/
|
|
173
|
+
Mặc định, chúng tôi scaffold `AGENTS.md` hoạt động như root router cho AI coding assistant của bạn. File này chứa các rules và documentation maps trỏ đến thư mục `.agents/`.
|
|
177
174
|
|
|
178
|
-
|
|
179
|
-
- Reads: `.github/copilot-instructions.md` (GitHub convention)
|
|
180
|
-
- copilot-instructions.md = cùng router format với AGENTS.md
|
|
181
|
-
- Points đến `.agents/MEMORY.md` + spec files
|
|
182
|
-
- Writes: Agent follows rules → appends khi appropriate
|
|
175
|
+
Nếu công cụ AI cụ thể của bạn yêu cầu một tên file khác, bạn có thể dễ dàng dùng symlink file `AGENTS.md`:
|
|
183
176
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
-
|
|
187
|
-
- Writes: Agent rules instruct direct append
|
|
177
|
+
```bash
|
|
178
|
+
# Ví dụ: Cho Cursor
|
|
179
|
+
ln -s AGENTS.md .cursorrules
|
|
188
180
|
|
|
189
|
-
|
|
190
|
-
-
|
|
191
|
-
|
|
181
|
+
# Ví dụ: Cho GitHub Copilot
|
|
182
|
+
mkdir -p .github && ln -s ../AGENTS.md .github/copilot-instructions.md
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Điều này đảm bảo single source of truth (`AGENTS.md`) được duy trì trong khi cung cấp khả năng tương thích ngược với mọi công cụ.
|
|
192
186
|
|
|
193
187
|
---
|
|
194
188
|
|
|
@@ -218,12 +212,12 @@ Tài liệu này đề xuất kiến trúc khả năng skalabiliti cho AI memory
|
|
|
218
212
|
- Keep `.memsearch/memory/` như archive (1 year retention)
|
|
219
213
|
- Delete milvus.db
|
|
220
214
|
|
|
221
|
-
### Từ
|
|
215
|
+
### Từ Monolithic Config Files (vd: .cursorrules)
|
|
222
216
|
|
|
223
217
|
1. **Extract decisions** → `.agents/MEMORY.md`
|
|
224
218
|
2. **Extract patterns** → `.agents/spec/patterns.md`
|
|
225
219
|
3. **Extract commands** → `AGENTS.md`
|
|
226
|
-
4. **Keep router** →
|
|
220
|
+
4. **Keep router** → Tạo symlink từ config file cũ của bạn trỏ tới `AGENTS.md`
|
|
227
221
|
|
|
228
222
|
---
|
|
229
223
|
|
|
@@ -253,10 +247,8 @@ Tài liệu này đề xuất kiến trúc khả năng skalabiliti cho AI memory
|
|
|
253
247
|
## Công cụ Support
|
|
254
248
|
|
|
255
249
|
### CLI
|
|
256
|
-
- ✓ `npx @vuau/agent-memory init` — scaffold structure (
|
|
257
|
-
- ✓ `npx @vuau/agent-memory init --
|
|
258
|
-
- ✓ `npx @vuau/agent-memory init --copilot --cursor` — nhiều IDEs
|
|
259
|
-
- ✓ `npx @vuau/agent-memory init --all` — tất cả IDEs
|
|
250
|
+
- ✓ `npx @vuau/agent-memory init` — scaffold structure (`AGENTS.md` + `.agents/`)
|
|
251
|
+
- ✓ `npx @vuau/agent-memory init --force` — ghi đè files có sẵn
|
|
260
252
|
- ✓ `npx @vuau/agent-memory doctor` — validate structure
|
|
261
253
|
- Planned: ✗ `report` — generate memory stats, archival suggestions
|
|
262
254
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuau/agent-memory",
|
|
3
|
-
"version": "0.4.
|
|
4
|
-
"description": "Structured AI memory for codebases —
|
|
3
|
+
"version": "0.4.1",
|
|
4
|
+
"description": "Structured AI memory for codebases — scaffolding CLI for OpenCode, Copilot, Cursor, Windsurf",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"exports": {
|