pmem-ai 0.5.0 → 0.6.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/CHANGELOG.md +24 -0
- package/README.md +75 -17
- package/dist/commands/ask.d.ts.map +1 -1
- package/dist/commands/ask.js +14 -1
- package/dist/commands/ask.js.map +1 -1
- package/dist/commands/doctor.d.ts +3 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +164 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/init.d.ts +4 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +111 -6
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/install.d.ts +8 -0
- package/dist/commands/install.d.ts.map +1 -0
- package/dist/commands/install.js +119 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/integration.d.ts.map +1 -1
- package/dist/commands/integration.js +113 -35
- package/dist/commands/integration.js.map +1 -1
- package/dist/commands/session.d.ts.map +1 -1
- package/dist/commands/session.js +3 -1
- package/dist/commands/session.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +71 -2
- package/dist/commands/update.js.map +1 -1
- package/dist/index.js +39 -2
- package/dist/index.js.map +1 -1
- package/docs/project-roadmap.md +58 -25
- package/docs/release-checklist-v0.6.md +72 -0
- package/docs/usage.md +374 -0
- package/docs/v0.6 pre-design.md +550 -0
- package/package.json +9 -2
- package/skills/pmem/SKILL.md +194 -0
- package/skills/pmem/references/first-init.md +90 -0
- package/skills/pmem/references/memory-cards.md +86 -0
- package/skills/pmem/references/session-workflow.md +83 -0
- package/skills/pmem/references/troubleshooting.md +60 -0
package/dist/index.js
CHANGED
|
@@ -14,11 +14,13 @@ const migrate_1 = require("./commands/migrate");
|
|
|
14
14
|
const distill_1 = require("./commands/distill");
|
|
15
15
|
const session_1 = require("./commands/session");
|
|
16
16
|
const status_1 = require("./commands/status");
|
|
17
|
+
const install_1 = require("./commands/install");
|
|
18
|
+
const doctor_1 = require("./commands/doctor");
|
|
17
19
|
const program = new commander_1.Command();
|
|
18
20
|
program
|
|
19
21
|
.name('pmem')
|
|
20
22
|
.description('Project Memory for AI Agents — graph-based project memory runtime')
|
|
21
|
-
.version('0.
|
|
23
|
+
.version('0.6.0');
|
|
22
24
|
program
|
|
23
25
|
.command('status')
|
|
24
26
|
.description('Detect changed files and affected memory cards')
|
|
@@ -31,9 +33,20 @@ program
|
|
|
31
33
|
.command('init [project-name]')
|
|
32
34
|
.description('Initialize pmem in the current project')
|
|
33
35
|
.option('--guided', 'Interactive guided initialization (recommended)')
|
|
36
|
+
.option('--description <text>', 'Project description (non-interactive mode)')
|
|
37
|
+
.option('--stage <text>', 'Current project stage (non-interactive mode)')
|
|
38
|
+
.option('--next <text>', 'Most important next step (non-interactive mode)')
|
|
39
|
+
.option('--answers <path>', 'Path to JSON answers file for non-interactive init')
|
|
34
40
|
.action((projectName, options) => {
|
|
35
41
|
const opts = options || {};
|
|
36
|
-
(0, init_1.initCommand)({
|
|
42
|
+
(0, init_1.initCommand)({
|
|
43
|
+
projectName,
|
|
44
|
+
guided: opts.guided,
|
|
45
|
+
description: opts.description,
|
|
46
|
+
stage: opts.stage,
|
|
47
|
+
next: opts.next,
|
|
48
|
+
answers: opts.answers,
|
|
49
|
+
});
|
|
37
50
|
});
|
|
38
51
|
program
|
|
39
52
|
.command('recall')
|
|
@@ -106,6 +119,13 @@ program
|
|
|
106
119
|
.action((options) => {
|
|
107
120
|
(0, verify_1.verifyCommand)({ fix: options.fix });
|
|
108
121
|
});
|
|
122
|
+
program
|
|
123
|
+
.command('doctor')
|
|
124
|
+
.description('Run diagnostic checks on project memory setup')
|
|
125
|
+
.option('-f, --format <format>', 'Output format (compact, json)', 'compact')
|
|
126
|
+
.action((options) => {
|
|
127
|
+
(0, doctor_1.doctorCommand)(options.format);
|
|
128
|
+
});
|
|
109
129
|
program
|
|
110
130
|
.command('migrate')
|
|
111
131
|
.description('Migrate project memory to a newer schema version')
|
|
@@ -163,5 +183,22 @@ integration
|
|
|
163
183
|
.action(() => {
|
|
164
184
|
(0, integration_1.integrationCommand)('verify');
|
|
165
185
|
});
|
|
186
|
+
program
|
|
187
|
+
.command('install')
|
|
188
|
+
.description('Install pmem skills to agent global directories')
|
|
189
|
+
.option('--skills', 'Install skill files')
|
|
190
|
+
.option('--claude', 'Target Claude Code')
|
|
191
|
+
.option('--codex', 'Target Codex')
|
|
192
|
+
.option('--gemini', 'Target Gemini CLI')
|
|
193
|
+
.option('--all', 'Target all detected agents')
|
|
194
|
+
.action((options) => {
|
|
195
|
+
(0, install_1.installCommand)({
|
|
196
|
+
skills: options.skills,
|
|
197
|
+
claude: options.claude,
|
|
198
|
+
codex: options.codex,
|
|
199
|
+
gemini: options.gemini,
|
|
200
|
+
all: options.all,
|
|
201
|
+
});
|
|
202
|
+
});
|
|
166
203
|
program.parse();
|
|
167
204
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,0CAA8C;AAC9C,gDAAoD;AACpD,8CAAkD;AAClD,8CAAkD;AAClD,wCAA4C;AAC5C,4CAAgE;AAChE,8CAAoE;AACpE,wDAA4D;AAC5D,gDAAoD;AACpD,gDAAoD;AACpD,gDAA4E;AAC5E,8CAAkD;AAElD,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,MAAM,CAAC;KACZ,WAAW,CAAC,mEAAmE,CAAC;KAChF,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,gDAAgD,CAAC;KAC7D,MAAM,CAAC,yBAAyB,EAAE,+BAA+B,CAAC;KAClE,MAAM,CAAC,uBAAuB,EAAE,+BAA+B,EAAE,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C;KACvC,MAAM,CAAC,OAAO,EAAE,4BAA4B,CAAC;KAC7C,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE;IAClB,IAAA,wBAAc,EAAC;QACb,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,GAAG,EAAE,OAAO,CAAC,GAAG;KACjB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/docs/project-roadmap.md
CHANGED
|
@@ -19,7 +19,8 @@ CLI:`pmem`
|
|
|
19
19
|
| v0.2 | 文件模式可信 | 防损坏——冷启动不空、并发不丢、卡片不乱、版本可迁 |
|
|
20
20
|
| v0.3 | SQLite 运行时 | 强一致——查询/索引/状态迁入 SQLite,Markdown 仍为主数据 |
|
|
21
21
|
| v0.4 | Agent 集成 & 自动化 | 多框架适配、session 追踪、distill 工作流优化 |
|
|
22
|
-
| v0.5 |
|
|
22
|
+
| v0.5 | Productization Beta | README、npm package、E2E、错误 UX、发布清单,上线 npm Beta |
|
|
23
|
+
| v0.6 | Agent-native Workflow Polish | 非交互 init、友好错误、空结果引导、Claude Code slash commands |
|
|
23
24
|
|
|
24
25
|
---
|
|
25
26
|
|
|
@@ -194,21 +195,44 @@ v0.3: 文件系统 → SQLite indexes → SQL 查询 → CLI
|
|
|
194
195
|
|
|
195
196
|
---
|
|
196
197
|
|
|
197
|
-
## v0.5 —
|
|
198
|
+
## v0.5 — Productization Beta ✅ 已完成
|
|
198
199
|
|
|
199
|
-
**主题:**
|
|
200
|
+
**主题:** 把 v0.4 已经跑通的 Agent Workflow Runtime 包装成一个真实项目可以安装、理解、运行、验证、反馈的 Beta CLI 产品。
|
|
200
201
|
|
|
201
202
|
| 功能 | 说明 |
|
|
202
203
|
|------|------|
|
|
203
|
-
|
|
|
204
|
-
|
|
|
205
|
-
|
|
|
206
|
-
|
|
|
207
|
-
|
|
|
208
|
-
|
|
|
209
|
-
|
|
|
210
|
-
|
|
211
|
-
|
|
204
|
+
| README / quick start | 外部用户可独立理解 pmem 并跑通 5 分钟流程 |
|
|
205
|
+
| npm package readiness | package metadata、bin、files、build、pack smoke |
|
|
206
|
+
| install smoke E2E | 验证 tarball 安装后的 `pmem` 二进制可用 |
|
|
207
|
+
| real workflow E2E | 覆盖 init → rebuild → recall/ask → status → mark-dirty → update → verify |
|
|
208
|
+
| Agent docs sync | `AGENTS.md`、`CLAUDE.md`、integration templates 统一到 v0.5 产品口径 |
|
|
209
|
+
| Error UX / exit code docs | 明确 workflow signal exit code,不把 exit 1 都视为失败 |
|
|
210
|
+
| CHANGELOG / release checklist | 支持可重复 Beta 发布 |
|
|
211
|
+
|
|
212
|
+
详细设计:`docs/v0.5 pre-design.md`
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## v0.6 — Agent-native Workflow Polish
|
|
217
|
+
|
|
218
|
+
**主题:** 让 v0.5 已经成立的 Beta CLI 更适合 AI Agent 程序化调用、跨会话恢复、无人工兜底使用。
|
|
219
|
+
|
|
220
|
+
v0.6 不扩大能力边界,不做 embedding、MCP/REST、Graph UI、遥测或远程服务。它专注处理 v0.5 真实使用反馈中暴露出的 Agent 摩擦点。
|
|
221
|
+
|
|
222
|
+
| 功能 | 说明 |
|
|
223
|
+
|------|------|
|
|
224
|
+
| 非交互 init | `init --guided` 提供参数 / answers 文件路径,避免 Agent 卡在 TTY |
|
|
225
|
+
| git 前置检查 | `status` / `mark-dirty --auto` 在非 git 或 git 不可用时给友好提示 |
|
|
226
|
+
| 空结果引导 | `update --suggest` / `ask` 不静默返回空数组,解释下一步 |
|
|
227
|
+
| session 容错 UX | `session end` 未 start 时给出可操作建议,评估显式容错 option |
|
|
228
|
+
| Claude Code slash commands | `integration install claude-code` 生成 `.claude/commands/pmem-*.md` |
|
|
229
|
+
| integration verify 增强 | 检查 root files、settings、slash commands、rules 是否真实存在 |
|
|
230
|
+
| 全局 skills 安装 | `pmem install --skills --claude/--codex/--gemini` 一键安装到 agent skills 目录 |
|
|
231
|
+
| pmem doctor | 8 项诊断检查(pmem_dir/manifest/database/cards/dirty_flags/session/git/integrations) |
|
|
232
|
+
| Agent-native E2E | 覆盖非交互 init、integration install、空结果、非 git UX、skills install |
|
|
233
|
+
| 文档口径同步 | README / AGENTS / CLAUDE 解释 pmem 的跨会话价值 |
|
|
234
|
+
|
|
235
|
+
详细设计:`docs/v0.6 pre-design.md`
|
|
212
236
|
|
|
213
237
|
---
|
|
214
238
|
|
|
@@ -233,10 +257,12 @@ v0.3 → v0.4:
|
|
|
233
257
|
manifest integrations 扩展
|
|
234
258
|
|
|
235
259
|
v0.4 → v0.5:
|
|
236
|
-
|
|
237
|
-
变更:
|
|
238
|
-
|
|
239
|
-
|
|
260
|
+
无强制 memory schema migration
|
|
261
|
+
变更:README / package / E2E / agent docs / release checklist 产品化
|
|
262
|
+
|
|
263
|
+
v0.5 → v0.6:
|
|
264
|
+
无强制 memory schema migration
|
|
265
|
+
变更:非交互 init、Agent integration 文件、错误 UX、空结果引导
|
|
240
266
|
```
|
|
241
267
|
|
|
242
268
|
每次迁移自动备份到 `.pmem/backups/YYYY-MM-DD-before-vX.Y/`。
|
|
@@ -246,10 +272,10 @@ v0.4 → v0.5:
|
|
|
246
272
|
## 总览
|
|
247
273
|
|
|
248
274
|
```
|
|
249
|
-
v0.1 ───→ v0.2 ───→ v0.3 ───→ v0.4 ───→ v0.5
|
|
250
|
-
能用 防损坏 强一致 自动化
|
|
251
|
-
10 cmd 14 cmd 16 cmd 18 cmd
|
|
252
|
-
文件模式 文件模式 +SQLite +集成 +体验
|
|
275
|
+
v0.1 ───→ v0.2 ───→ v0.3 ───→ v0.4 ───→ v0.5 ───→ v0.6
|
|
276
|
+
能用 防损坏 强一致 自动化 Beta上线 Agent原生
|
|
277
|
+
10 cmd 14 cmd 16 cmd 18 cmd 产品化 低摩擦
|
|
278
|
+
文件模式 文件模式 +SQLite +集成 +体验 +程序化调用
|
|
253
279
|
```
|
|
254
280
|
|
|
255
281
|
---
|
|
@@ -257,10 +283,19 @@ v0.1 ───→ v0.2 ───→ v0.3 ───→ v0.4 ───→ v0.5
|
|
|
257
283
|
## 当前状态
|
|
258
284
|
|
|
259
285
|
- **v0.1:** ✅ 完成(10 个命令实现并测试)
|
|
260
|
-
- **v0.2:**
|
|
286
|
+
- **v0.2:** ✅ 完成(文件模式可信)
|
|
261
287
|
- 设计决策:`docs/v0.2 pre-design.md`
|
|
262
288
|
- 架构规划:`docs/v0.2 pre-roadmap.md`
|
|
263
|
-
- **v0.3
|
|
289
|
+
- **v0.3:** ✅ 完成(SQLite runtime)
|
|
290
|
+
- 设计决策:`docs/v0.3 pre-design.md`
|
|
291
|
+
- **v0.4:** ✅ 完成(Agent workflow runtime)
|
|
292
|
+
- 设计决策:`docs/v0.4 pre-design.md`
|
|
293
|
+
- handover:`docs/handover-v0.4.md`
|
|
294
|
+
- **v0.5:** ✅ 完成并上线 npm(Productization Beta)
|
|
295
|
+
- 设计决策:`docs/v0.5 pre-design.md`
|
|
296
|
+
- 发布清单:`docs/release-checklist-v0.5.md`
|
|
297
|
+
- **v0.6:** 📋 设计完成,待开工(Agent-native Workflow Polish)
|
|
298
|
+
- 设计决策:`docs/v0.6 pre-design.md`
|
|
264
299
|
|
|
265
300
|
---
|
|
266
301
|
|
|
@@ -268,12 +303,10 @@ v0.1 ───→ v0.2 ───→ v0.3 ───→ v0.4 ───→ v0.5
|
|
|
268
303
|
|
|
269
304
|
以下问题留待后续版本讨论:
|
|
270
305
|
|
|
271
|
-
- v0.3 SQLite schema 详细设计
|
|
272
306
|
- MCP Server vs HTTP API 的选择
|
|
273
307
|
- 多项目 / workspace 支持
|
|
274
308
|
- 记忆共享与协作机制
|
|
275
309
|
- 记忆权限模型
|
|
276
310
|
- 多语言 CLI 支持
|
|
277
|
-
- telemetry
|
|
278
|
-
- npm 包发布与版本策略
|
|
311
|
+
- telemetry 的范围和隐私策略(v0.6 继续不做)
|
|
279
312
|
- 是否支持嵌入到 VS Code / JetBrains 插件
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# pmem v0.6 Release Checklist
|
|
2
|
+
|
|
3
|
+
Use this checklist before tagging or publishing v0.6.0.
|
|
4
|
+
|
|
5
|
+
## Scope Check
|
|
6
|
+
|
|
7
|
+
- [ ] v0.6 remains Agent-native Workflow Polish only.
|
|
8
|
+
- [ ] No embedding, MCP/REST, Graph UI, telemetry, or remote service was added.
|
|
9
|
+
- [ ] Non-interactive init, error UX, empty result guidance, Claude Code slash commands, pmem doctor, and global skills installation are complete.
|
|
10
|
+
|
|
11
|
+
## Version Check
|
|
12
|
+
|
|
13
|
+
- [ ] `package.json` version is `0.6.0`.
|
|
14
|
+
- [ ] `package-lock.json` root version is `0.6.0`.
|
|
15
|
+
- [ ] `src/index.ts` Commander version is `0.6.0`.
|
|
16
|
+
- [ ] `CHANGELOG.md` has a `0.6.0` section.
|
|
17
|
+
|
|
18
|
+
## Test Check
|
|
19
|
+
|
|
20
|
+
Run:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm test
|
|
24
|
+
npm run build
|
|
25
|
+
npm run test:e2e:install
|
|
26
|
+
npm run test:e2e:workflow
|
|
27
|
+
npm run test:e2e:non-git
|
|
28
|
+
npm run test:e2e:v06-init
|
|
29
|
+
npm run test:e2e:v06-answers
|
|
30
|
+
npm run test:e2e:v06-claude
|
|
31
|
+
npm run test:e2e:v06-empty
|
|
32
|
+
npm run test:e2e:v06-nongit
|
|
33
|
+
npm run test:e2e:v06-skills
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Expected:
|
|
37
|
+
|
|
38
|
+
- [ ] Unit tests pass (90+).
|
|
39
|
+
- [ ] TypeScript build passes.
|
|
40
|
+
- [ ] All E2E scripts pass.
|
|
41
|
+
|
|
42
|
+
## Package Check
|
|
43
|
+
|
|
44
|
+
Run:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npm pack --dry-run
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Expected:
|
|
51
|
+
|
|
52
|
+
- [ ] Package name is `pmem-ai`.
|
|
53
|
+
- [ ] Package version is `0.6.0`.
|
|
54
|
+
- [ ] Tarball includes `dist/`.
|
|
55
|
+
- [ ] Tarball includes `skills/pmem/SKILL.md` and `skills/pmem/references/`.
|
|
56
|
+
- [ ] Tarball includes `README.md`, `LICENSE`, `CHANGELOG.md`.
|
|
57
|
+
- [ ] Tarball includes `docs/*.md` including `docs/usage.md`.
|
|
58
|
+
- [ ] Tarball excludes `src/`, `temp/`, `.pmem/`, `node_modules/`.
|
|
59
|
+
- [ ] Tarball excludes compiled test files.
|
|
60
|
+
|
|
61
|
+
## Publish Decision
|
|
62
|
+
|
|
63
|
+
- [ ] Confirm whether v0.6.0 is ready to publish.
|
|
64
|
+
- [ ] Confirm npm account and publish permission.
|
|
65
|
+
- [ ] Confirm CI/CD publish job will run on push to main.
|
|
66
|
+
|
|
67
|
+
## Final Commands
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
npm publish --access public
|
|
71
|
+
# or push to main for CI/CD auto-publish
|
|
72
|
+
```
|
package/docs/usage.md
ADDED
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
# pmem Usage Guide
|
|
2
|
+
|
|
3
|
+
A step-by-step guide to using pmem with AI coding agents. Uses Claude Code as the primary example; the same patterns work for Codex, Cursor, and other agent frameworks.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- Node.js >= 18
|
|
8
|
+
- A Git repository (pmem uses `git status --porcelain` for change detection; non-Git projects fall back to mtime scanning)
|
|
9
|
+
|
|
10
|
+
## 1. Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install -g pmem-ai
|
|
14
|
+
pmem --version # should print 0.5.0
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The binary is `pmem`. The package name `pmem-ai` is only for npm.
|
|
18
|
+
|
|
19
|
+
## 2. One-Time Setup (per project)
|
|
20
|
+
|
|
21
|
+
Run these once in your project root:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
cd your-project
|
|
25
|
+
pmem init your-project
|
|
26
|
+
pmem rebuild
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
This creates a `.pmem/` directory with:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
.pmem/
|
|
33
|
+
manifest.yml # project configuration
|
|
34
|
+
index.md # project overview (edit this)
|
|
35
|
+
state.md # current state (edit this)
|
|
36
|
+
next.md # recommended next step (edit this)
|
|
37
|
+
modules/ # module memory cards
|
|
38
|
+
decisions/ # decision records
|
|
39
|
+
tasks/ # task tracking
|
|
40
|
+
traces/ # work traces
|
|
41
|
+
integrations/ # agent framework templates
|
|
42
|
+
pmem.db # SQLite runtime index (auto-generated)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
`pmem init --guided` lets you answer 3 questions interactively to populate the project info.
|
|
46
|
+
|
|
47
|
+
## 3. Create Your First Memory Card
|
|
48
|
+
|
|
49
|
+
A memory card is a Markdown file with YAML frontmatter. The most important type is `module` — it connects source files to memory:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
mkdir -p .pmem/modules
|
|
53
|
+
|
|
54
|
+
cat > .pmem/modules/core.md <<'EOF'
|
|
55
|
+
---
|
|
56
|
+
id: module.core
|
|
57
|
+
type: module
|
|
58
|
+
status: active
|
|
59
|
+
tags: [core]
|
|
60
|
+
aliases: [main, entry]
|
|
61
|
+
source_files: [src/index.ts]
|
|
62
|
+
depends_on: []
|
|
63
|
+
---
|
|
64
|
+
# Core Module
|
|
65
|
+
|
|
66
|
+
## Purpose
|
|
67
|
+
Main application entry point.
|
|
68
|
+
|
|
69
|
+
## Key Behavior
|
|
70
|
+
- Initializes the app
|
|
71
|
+
- Loads configuration
|
|
72
|
+
- Boots subsystems
|
|
73
|
+
EOF
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Then rebuild the index:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
pmem rebuild
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Now pmem knows that `src/index.ts` belongs to the `module.core` card.
|
|
83
|
+
|
|
84
|
+
## 4. Claude Code Integration
|
|
85
|
+
|
|
86
|
+
### 4a. Install the Integration Template
|
|
87
|
+
|
|
88
|
+
`pmem init` already created `.pmem/integrations/claude-code/CLAUDE.md`. Copy it to your project root so Claude Code can see it:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
cp .pmem/integrations/claude-code/CLAUDE.md ./CLAUDE.md
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
If your project already has a `CLAUDE.md`, merge the pmem workflow section into it instead.
|
|
95
|
+
|
|
96
|
+
### 4b. What the Integration Does
|
|
97
|
+
|
|
98
|
+
The integration template teaches Claude Code the pmem workflow. Here is what happens in a typical session:
|
|
99
|
+
|
|
100
|
+
**Session Start**
|
|
101
|
+
|
|
102
|
+
Claude Code runs these when beginning work:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
pmem session start -a "Claude"
|
|
106
|
+
pmem recall --format compact --budget 2000
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
`pmem recall` outputs the project context: name, stage, current focus, state summary, recommended next step, and a list of files to read. All within the token budget.
|
|
110
|
+
|
|
111
|
+
**Before Focused Work**
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
pmem ask "<task or module>" --format compact
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
`pmem ask` finds relevant memory cards by exact ID match, alias, tag, graph neighbor expansion, and keyword fallback (FTS5 or LIKE).
|
|
118
|
+
|
|
119
|
+
**After Editing Code**
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
pmem status --format json
|
|
123
|
+
pmem mark-dirty --auto
|
|
124
|
+
pmem update --suggest --format json
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
- `pmem status` detects changed files and maps them to affected memory cards
|
|
128
|
+
- `pmem mark-dirty --auto` marks those cards as potentially stale
|
|
129
|
+
- `pmem update --suggest` generates memory update suggestions
|
|
130
|
+
|
|
131
|
+
Important: `pmem update --suggest` exits with code `1` when it has suggestions. This is a workflow signal ("action suggested"), not a failure.
|
|
132
|
+
|
|
133
|
+
**Session End**
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
pmem update --confirm -s "<what changed>" -n "<next step>"
|
|
137
|
+
pmem session end -s "<task summary>"
|
|
138
|
+
pmem verify
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
- `pmem update --confirm` writes the confirmed changes
|
|
142
|
+
- `pmem session end` closes the session with a summary
|
|
143
|
+
- `pmem verify` checks consistency
|
|
144
|
+
|
|
145
|
+
### 4c. Complete Session Example
|
|
146
|
+
|
|
147
|
+
Here is a complete Claude Code session transcript showing pmem integration:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# === Session start ===
|
|
151
|
+
$ pmem session start -a "Claude"
|
|
152
|
+
Session started: session_2026-05-20T09-00-00
|
|
153
|
+
|
|
154
|
+
$ pmem recall --format compact --budget 2000
|
|
155
|
+
PROJECT: pmem
|
|
156
|
+
STAGE: v0.5 Productization Beta
|
|
157
|
+
|
|
158
|
+
FOCUS: Making the CLI product installable and reliable as a Beta.
|
|
159
|
+
|
|
160
|
+
NEXT:
|
|
161
|
+
Complete the Error UX pass for common failure scenarios.
|
|
162
|
+
|
|
163
|
+
STATE:
|
|
164
|
+
- README and quick start: done
|
|
165
|
+
- npm package readiness: done
|
|
166
|
+
- E2E scripts: done
|
|
167
|
+
- Agent docs sync: done
|
|
168
|
+
- Error UX pass: in progress
|
|
169
|
+
|
|
170
|
+
READ_IF_NEEDED:
|
|
171
|
+
.pmem/state.md
|
|
172
|
+
.pmem/next.md
|
|
173
|
+
.pmem/modules/core.md
|
|
174
|
+
|
|
175
|
+
# === Before editing src/commands/verify.ts ===
|
|
176
|
+
$ pmem ask "verify" --format compact
|
|
177
|
+
Query: verify
|
|
178
|
+
|
|
179
|
+
Matched:
|
|
180
|
+
- module.verify by keyword_fallback: "verify.ts"
|
|
181
|
+
|
|
182
|
+
# === After editing the file ===
|
|
183
|
+
$ pmem status --format json
|
|
184
|
+
{
|
|
185
|
+
"source": "git",
|
|
186
|
+
"changes": [
|
|
187
|
+
{
|
|
188
|
+
"path": "src/commands/verify.ts",
|
|
189
|
+
"status": "M",
|
|
190
|
+
"related_cards": [{"card_id": "module.verify", "match_type": "exact"}]
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
$ pmem mark-dirty --auto
|
|
196
|
+
Auto-marked 1 card(s) as dirty.
|
|
197
|
+
|
|
198
|
+
$ pmem update --suggest --format json
|
|
199
|
+
# exit code 1 (suggestions exist)
|
|
200
|
+
{
|
|
201
|
+
"suggestions": [
|
|
202
|
+
{
|
|
203
|
+
"card_id": "module.verify",
|
|
204
|
+
"action": "update",
|
|
205
|
+
"reason": "Source file changed: src/commands/verify.ts"
|
|
206
|
+
}
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
# === Confirm the update ===
|
|
211
|
+
$ pmem update --confirm -s "Added corrupt DB error handling to verify" -n "Test the error UX changes"
|
|
212
|
+
Memory updated.
|
|
213
|
+
|
|
214
|
+
# === Session end ===
|
|
215
|
+
$ pmem session end -s "Completed Error UX pass for verify command"
|
|
216
|
+
Session ended. 1 update recorded.
|
|
217
|
+
|
|
218
|
+
$ pmem verify
|
|
219
|
+
✓ Memory verification passed.
|
|
220
|
+
Score: 100/100
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## 5. What the Agent Sees
|
|
224
|
+
|
|
225
|
+
When Claude Code (or another agent) starts a session with pmem, it gets the critical project context immediately:
|
|
226
|
+
|
|
227
|
+
- **recall** gives it orientation: project name, stage, focus, state, and next steps
|
|
228
|
+
- **ask** finds the specific cards relevant to the current task
|
|
229
|
+
- **status** tells it which memory cards are affected by code changes
|
|
230
|
+
- **update --suggest** tells it what needs updating in the memory
|
|
231
|
+
|
|
232
|
+
The agent never needs to read the entire `.pmem/` tree. It only reads what pmem tells it to.
|
|
233
|
+
|
|
234
|
+
## 6. Adding More Memory Cards
|
|
235
|
+
|
|
236
|
+
### Decision Record
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
cat > .pmem/decisions/sqlite-runtime.md <<'EOF'
|
|
240
|
+
---
|
|
241
|
+
id: decision.sqlite_runtime
|
|
242
|
+
type: decision
|
|
243
|
+
status: accepted
|
|
244
|
+
tags: [architecture, data]
|
|
245
|
+
---
|
|
246
|
+
# Use SQLite as Runtime Index
|
|
247
|
+
|
|
248
|
+
## Context
|
|
249
|
+
v0.3 needed faster recall and richer query support.
|
|
250
|
+
|
|
251
|
+
## Decision
|
|
252
|
+
Use better-sqlite3 with WAL mode as the primary runtime store.
|
|
253
|
+
|
|
254
|
+
## Consequences
|
|
255
|
+
- Markdown cards remain source of truth
|
|
256
|
+
- SQLite is fully rebuildable from cards
|
|
257
|
+
- FTS5 enables keyword search; LIKE fallback for builds without FTS5
|
|
258
|
+
EOF
|
|
259
|
+
|
|
260
|
+
pmem rebuild
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### Task Card
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
cat > .pmem/tasks/error-ux-pass.md <<'EOF'
|
|
267
|
+
---
|
|
268
|
+
id: task.error_ux_pass
|
|
269
|
+
type: task
|
|
270
|
+
status: in_progress
|
|
271
|
+
priority: high
|
|
272
|
+
tags: [v0.5, ux]
|
|
273
|
+
depends_on: [module.verify, module.ask]
|
|
274
|
+
---
|
|
275
|
+
# Error UX Pass
|
|
276
|
+
|
|
277
|
+
## Goal
|
|
278
|
+
Every common failure scenario should produce a message that says what happened, why, and what to do next.
|
|
279
|
+
|
|
280
|
+
## Sub-tasks
|
|
281
|
+
- [x] Corrupt DB: catch SQLITE_NOTADB in openDatabase
|
|
282
|
+
- [x] Missing .pmem: prompt pmem init
|
|
283
|
+
- [ ] Non-git status: show mtime source in compact output
|
|
284
|
+
EOF
|
|
285
|
+
|
|
286
|
+
pmem rebuild
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
## 7. Working with Codex
|
|
290
|
+
|
|
291
|
+
For Codex, the integration template is at `.pmem/integrations/codex/AGENTS.md`. Copy or merge it into your project's `AGENTS.md`:
|
|
292
|
+
|
|
293
|
+
```bash
|
|
294
|
+
cat .pmem/integrations/codex/AGENTS.md >> AGENTS.md
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
The workflow is identical — replace `Claude` with `Codex` in `pmem session start -a`.
|
|
298
|
+
|
|
299
|
+
## 8. Working with Cursor
|
|
300
|
+
|
|
301
|
+
Cursor uses `.cursor/rules/` for instructions. The pmem integration is at `.pmem/integrations/cursor/rules.example.md`:
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
mkdir -p .cursor/rules
|
|
305
|
+
cp .pmem/integrations/cursor/rules.example.md .cursor/rules/pmem.md
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
In Cursor's AI chat, prefix pmem commands with backticks:
|
|
309
|
+
|
|
310
|
+
```
|
|
311
|
+
`pmem session start -a "Cursor" && pmem recall --format compact --budget 2000`
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
## 9. Exit Codes
|
|
315
|
+
|
|
316
|
+
Agents must treat some exit codes as workflow signals:
|
|
317
|
+
|
|
318
|
+
| Command | 0 | 1 | 2 |
|
|
319
|
+
|---------|---|---|---|
|
|
320
|
+
| `pmem status` | changes found | no changes | error |
|
|
321
|
+
| `pmem update --suggest` | no suggestions | **suggestions found** | error |
|
|
322
|
+
| `pmem distill --suggest` | no distillation needed | **distillation suggested** | error |
|
|
323
|
+
| `pmem verify` | passed | warnings | errors |
|
|
324
|
+
|
|
325
|
+
When `pmem update --suggest` returns 1, it means "action suggested" — not "command failed". Parse the JSON output for suggestions.
|
|
326
|
+
|
|
327
|
+
## 10. Tips for Agent Framework Authors
|
|
328
|
+
|
|
329
|
+
If you are an agent framework developer integrating pmem:
|
|
330
|
+
|
|
331
|
+
1. **Run session start + recall at session begin.** This gives the agent immediate project orientation.
|
|
332
|
+
2. **Run status after file writes.** Detect changes before the agent forgets what it edited.
|
|
333
|
+
3. **Parse exit code 1 correctly.** For `update --suggest` and `distill --suggest`, code 1 is success.
|
|
334
|
+
4. **Use `--format json` for machine consumption.** Compact format is for humans.
|
|
335
|
+
5. **Don't edit `pmem.db` directly.** All writes go through Markdown cards or pmem CLI commands.
|
|
336
|
+
6. **Run verify at session end.** Catch stale indexes, orphan edges, or dirty flags before they accumulate.
|
|
337
|
+
|
|
338
|
+
## 11. Troubleshooting First-Run Issues
|
|
339
|
+
|
|
340
|
+
### `pmem: command not found`
|
|
341
|
+
|
|
342
|
+
npm global bin directory is not in your `PATH`. Add it:
|
|
343
|
+
|
|
344
|
+
```bash
|
|
345
|
+
npm config get prefix # shows where global packages are installed
|
|
346
|
+
export PATH="$(npm config get prefix)/bin:$PATH"
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
### `No .pmem directory found`
|
|
350
|
+
|
|
351
|
+
You are not in a project that has been initialized. Run `pmem init <name>` from the project root.
|
|
352
|
+
|
|
353
|
+
### `pmem rebuild` says no manifest
|
|
354
|
+
|
|
355
|
+
The project was not properly initialized. Run `pmem init <name>` again.
|
|
356
|
+
|
|
357
|
+
### `pmem recall` shows empty project
|
|
358
|
+
|
|
359
|
+
No memory cards exist yet. Create at least one module card (see Section 3), then run `pmem rebuild`.
|
|
360
|
+
|
|
361
|
+
### `pmem.db` is corrupted
|
|
362
|
+
|
|
363
|
+
This can happen if the SQLite file was interrupted during a write:
|
|
364
|
+
|
|
365
|
+
```bash
|
|
366
|
+
mv .pmem/pmem.db .pmem/pmem.db.bak
|
|
367
|
+
pmem rebuild --full
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
## Next Steps
|
|
371
|
+
|
|
372
|
+
- Read the [README](../README.md) for the full CLI reference
|
|
373
|
+
- Read the [v0.5 pre-design](v0.5%20pre-design.md) for the product vision
|
|
374
|
+
- Check `.pmem/integrations/` for your agent framework's template
|