@vib795/agent-memory 0.1.4 → 0.1.6
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 +109 -4
- package/package.json +1 -1
- package/skills/handoff/SKILL.md +2 -5
- package/skills/recall/SKILL.md +7 -4
- package/skills/remember/SKILL.md +6 -6
- package/src/cli.js +25 -2
- package/src/targets.js +10 -9
package/README.md
CHANGED
|
@@ -102,6 +102,77 @@ agent-memory doctor preflight and health report
|
|
|
102
102
|
|
|
103
103
|
Every command takes `--json`. Every cap lives in `config.json` and is tunable.
|
|
104
104
|
|
|
105
|
+
### Where they run
|
|
106
|
+
|
|
107
|
+
**Anywhere. There is one store per machine, not one per repository.** Everything
|
|
108
|
+
lives under `~/.agents/memory`, nothing is written into the projects you point it
|
|
109
|
+
at, and there is no per-repo setup step. `cd` between projects freely: the store
|
|
110
|
+
does not move, split, or reset.
|
|
111
|
+
|
|
112
|
+
One exception, and it is this repository rather than yours: if you installed from a
|
|
113
|
+
clone, `npm install -g .` symlinks rather than copies, so `compact` regenerating the
|
|
114
|
+
skill descriptions lands in your working tree and `skills/recall/SKILL.md` shows as
|
|
115
|
+
modified. That is generated state, and [From a clone](#from-a-clone) says so. No
|
|
116
|
+
project repository is ever written to.
|
|
117
|
+
|
|
118
|
+
What the working directory changes is *scope*, never location.
|
|
119
|
+
|
|
120
|
+
| Command | Reads | What the current repo changes |
|
|
121
|
+
|---|---|---|
|
|
122
|
+
| `init` | whole store | nothing |
|
|
123
|
+
| `index` | whole store | nothing |
|
|
124
|
+
| `compact` | whole store | nothing |
|
|
125
|
+
| `doctor` | whole store | nothing |
|
|
126
|
+
| `search` | whole store | nothing — full text hits every note in every repo |
|
|
127
|
+
| `get` | whole store | the staleness line only; the note is found by id either way |
|
|
128
|
+
| `tree` | whole store | **filters it** — defaults to the current repo |
|
|
129
|
+
| `write` | whole store | **is stamped into the note** — see below |
|
|
130
|
+
|
|
131
|
+
The current repo is `git rev-parse --show-toplevel` reduced to its directory name.
|
|
132
|
+
Outside a git repository it is `null` and every command still works: `tree` comes
|
|
133
|
+
back unscoped, and a new note carries no repo and no capture SHA, so it gets no
|
|
134
|
+
staleness signal for the rest of its life.
|
|
135
|
+
|
|
136
|
+
`write` is the one worth understanding, because it is the one that fixes facts in
|
|
137
|
+
place. Run from `~/work/orders-api` it stamps `repos: [orders-api]`, records that
|
|
138
|
+
repo's HEAD as `captured_sha`, and adds your `git config user.email` to the
|
|
139
|
+
redactor's keep list so your own address survives while every other one is removed.
|
|
140
|
+
Run the same JSON from your home directory and you get a note with no repo and no
|
|
141
|
+
staleness anchor. **Capture from inside the repository the knowledge is about** —
|
|
142
|
+
that is the whole reason `/remember` is worth invoking where you are working.
|
|
143
|
+
|
|
144
|
+
Two flags that do not mean what they look like:
|
|
145
|
+
|
|
146
|
+
- `agent-memory tree --repo`, with no value, means *all repos*. A bare `--repo`
|
|
147
|
+
clears the default scope rather than confirming it; `--repo <name>` points it at
|
|
148
|
+
a different repo.
|
|
149
|
+
- `--all` is unrelated to scope. It prints every node instead of truncating to the
|
|
150
|
+
`treeLines` cap, which is what the `run agent-memory tree --all` hint at the
|
|
151
|
+
bottom of a truncated tree is telling you.
|
|
152
|
+
|
|
153
|
+
One sharp edge: repo identity is the **directory name**, not the remote URL. Two
|
|
154
|
+
clones both sitting in a directory called `utils` are one repo as far as the store
|
|
155
|
+
is concerned. If you work across orgs, clone into distinct directory names.
|
|
156
|
+
|
|
157
|
+
### How often they run
|
|
158
|
+
|
|
159
|
+
Only `init` is a once-per-machine command, and `agent-memory setup` already ran it.
|
|
160
|
+
|
|
161
|
+
| Command | When |
|
|
162
|
+
|---|---|
|
|
163
|
+
| `init` | once, via `setup`. Again only to register extra skill paths |
|
|
164
|
+
| `write` | every capture |
|
|
165
|
+
| `tree`, `get`, `search` | every lookup |
|
|
166
|
+
| `index` | repair only — `write` reindexes on every call. Run it after hand-editing or deleting notes, or after deleting `index.db` |
|
|
167
|
+
| `compact` | occasionally. Nothing schedules it: no daemon, no cron, no hook |
|
|
168
|
+
| `doctor` | after install, after an upgrade, and whenever something looks wrong |
|
|
169
|
+
|
|
170
|
+
**You will not type most of these.** `/remember` and `/handoff` call `write`;
|
|
171
|
+
`/recall` calls `tree`, `get` and `search`. They are documented so you can see what
|
|
172
|
+
the skills are doing and drive it by hand when you want to, but the daily loop is
|
|
173
|
+
two slash commands in a chat box. The ones a person actually types are `setup`,
|
|
174
|
+
`doctor`, and `compact` now and then.
|
|
175
|
+
|
|
105
176
|
## Install
|
|
106
177
|
|
|
107
178
|
Two commands, and the second one is not optional:
|
|
@@ -144,7 +215,11 @@ routing digest.
|
|
|
144
215
|
| Claude Code, CLI and VS Code extension | linked skill directory | `~/.claude/skills/<name>/` |
|
|
145
216
|
| Codex CLI | linked skill directory | `$CODEX_HOME/skills/<name>/` |
|
|
146
217
|
| VS Code, Insiders, VSCodium, Cursor, Windsurf | prompt file | `<user data>/prompts/<name>.prompt.md` |
|
|
147
|
-
| Copilot CLI |
|
|
218
|
+
| GitHub Copilot CLI | linked skill directory | `~/.copilot/skills/<name>/` |
|
|
219
|
+
|
|
220
|
+
GitHub documents two personal skill directories, `~/.copilot/skills` and
|
|
221
|
+
`~/.agents/skills`, and Copilot reads both. The shared one is always written, so
|
|
222
|
+
Copilot is served even on a machine that has never run the CLI.
|
|
148
223
|
|
|
149
224
|
Prompt files are what GitHub Copilot chat reads, and they appear as `/recall`,
|
|
150
225
|
`/remember` and `/handoff` in the chat box. They are **generated from the same
|
|
@@ -164,8 +239,38 @@ command is documented as part of the install. If you would rather have it automa
|
|
|
164
239
|
npm install -g --allow-scripts=@vib795/agent-memory @vib795/agent-memory
|
|
165
240
|
```
|
|
166
241
|
|
|
167
|
-
Either way `agent-memory doctor` tells you where you stand
|
|
168
|
-
|
|
242
|
+
Either way `agent-memory doctor` tells you where you stand. It checks the files
|
|
243
|
+
rather than the tools, and names any agent it found that has no skills in it:
|
|
244
|
+
|
|
245
|
+
```
|
|
246
|
+
FAIL skills installed: GitHub Copilot CLI: handoff, recall, remember — run `agent-memory setup`
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Detecting an agent is not the same as having installed into it, and a check that
|
|
250
|
+
conflated the two would report healthy on exactly the machine where nothing ran.
|
|
251
|
+
|
|
252
|
+
### The skills on their own
|
|
253
|
+
|
|
254
|
+
The three skills are also published as [agent skills](https://docs.github.com/en/copilot/concepts/agents/about-agent-skills),
|
|
255
|
+
so they can be installed without the package:
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
gh skill install vib795/agent-memory --scope user
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
That gives you `/handoff`, `/remember` and `/recall` in every agent that reads the
|
|
262
|
+
shared skill directories, and nothing else — no CLI, so no store. The skills say so
|
|
263
|
+
when you run them and name the one command that fixes it. Use this to try the
|
|
264
|
+
prompts; use npm when you want the memory.
|
|
265
|
+
|
|
266
|
+
Claude Code can take the same three as a plugin:
|
|
267
|
+
|
|
268
|
+
```
|
|
269
|
+
/plugin marketplace add vib795/agent-memory
|
|
270
|
+
/plugin install agent-memory@agent-memory
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
The same caveat applies: the plugin carries the skills, `npm` carries the store.
|
|
169
274
|
|
|
170
275
|
Windows uses directory junctions, which need neither admin rights nor Developer
|
|
171
276
|
Mode. On a network-backed profile (FSLogix, roaming) junctions fail and the skills
|
|
@@ -190,7 +295,7 @@ is generated state, and the committed value is only a placeholder.
|
|
|
190
295
|
Needs Node 22.5 or newer; `doctor` says so plainly if the version is too old, and
|
|
191
296
|
`postinstall` refuses rather than failing your install.
|
|
192
297
|
|
|
193
|
-
Run `npm test` for the suite (
|
|
298
|
+
Run `npm test` for the suite (74 tests, no dependencies). CI runs it on Linux,
|
|
194
299
|
macOS and Windows across Node 22 and 24, and separately installs the packed tarball
|
|
195
300
|
and exercises it end to end on all three.
|
|
196
301
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vib795/agent-memory",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Durable cross-repo knowledge graph for GitHub Copilot and Claude Code. Markdown source of truth, disposable SQLite index, zero runtime dependencies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"github-copilot",
|
package/skills/handoff/SKILL.md
CHANGED
|
@@ -2,11 +2,8 @@
|
|
|
2
2
|
name: handoff
|
|
3
3
|
version: 0.1.0
|
|
4
4
|
description: Capture the working state of the current conversation into a portable handoff file, so an agent in a different VS Code window or a different repository can continue the work without the user re-explaining it. Use when the user says handoff, hand this off, save context, wrap this up, or continue this elsewhere.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- Read
|
|
8
|
-
- Write
|
|
9
|
-
- Glob
|
|
5
|
+
license: MIT
|
|
6
|
+
allowed-tools: Bash Read Write Glob
|
|
10
7
|
triggers:
|
|
11
8
|
- handoff
|
|
12
9
|
- hand this off
|
package/skills/recall/SKILL.md
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
name: recall
|
|
3
3
|
version: 0.1.0
|
|
4
4
|
description: "Durable project knowledge: 5 notes, 1 constraint across agent-memory. Topics: memory store is markdown with a disposable sqlite cache, chose node:sqlite over better-sqlite3, sqlite recursive cte is the graph engine. Use when you need to know how a system works, why a decision was made, what convention applies, or what the environment forbids."
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- Read
|
|
5
|
+
license: MIT
|
|
6
|
+
allowed-tools: Bash Read
|
|
8
7
|
triggers:
|
|
9
8
|
- how does this work
|
|
10
9
|
- why did we
|
|
@@ -118,7 +117,11 @@ Rules that separate a useful recall from a confident wrong one:
|
|
|
118
117
|
## Failure handling
|
|
119
118
|
|
|
120
119
|
- **`agent-memory: command not found`.** The package is not installed or not on
|
|
121
|
-
PATH.
|
|
120
|
+
PATH. This is the expected state when the skill was installed on its own, with
|
|
121
|
+
`gh skill install`, rather than with the package. Answer from the code, then say
|
|
122
|
+
once that the store needs `npm install -g @vib795/agent-memory` (Node >= 22.5).
|
|
123
|
+
Do not run it yourself: installing a global package is the user's decision, and on
|
|
124
|
+
a managed desktop it is one they may not be free to make.
|
|
122
125
|
- **Empty store.** Answer from the code, then mention `/remember` once.
|
|
123
126
|
- **`doctor` reports a problem.** Report it in one line and continue. `index.db` is
|
|
124
127
|
a cache; `agent-memory index` rebuilds it from the markdown, which is the source
|
package/skills/remember/SKILL.md
CHANGED
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
name: remember
|
|
3
3
|
version: 0.1.0
|
|
4
4
|
description: Capture durable project knowledge from the current conversation into the shared memory graph, so a later conversation in any window or repository already knows it. Use when the user says remember this, save this, note this for later, or /remember.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- Read
|
|
8
|
-
- Write
|
|
5
|
+
license: MIT
|
|
6
|
+
allowed-tools: Bash Read Write
|
|
9
7
|
triggers:
|
|
10
8
|
- remember this
|
|
11
9
|
- save this for later
|
|
@@ -149,7 +147,9 @@ Warnings from `write` are worth surfacing verbatim:
|
|
|
149
147
|
|
|
150
148
|
- **Validation failed.** `write` reports every error at once. Fix them all and retry
|
|
151
149
|
once. If it fails again, print the errors and stop; do not guess at the schema.
|
|
152
|
-
- **`agent-memory: command not found`.**
|
|
153
|
-
|
|
150
|
+
- **`agent-memory: command not found`.** Print the JSON in the chat first, so the
|
|
151
|
+
work is not lost, then say the store needs `npm install -g @vib795/agent-memory`
|
|
152
|
+
(Node >= 22.5). Do not run it yourself. This is the expected state when the skill
|
|
153
|
+
was installed on its own with `gh skill install` rather than with the package.
|
|
154
154
|
- **Nothing durable in the conversation.** Say so in one line. That is a correct
|
|
155
155
|
outcome, not a failure.
|
package/src/cli.js
CHANGED
|
@@ -10,8 +10,9 @@ import { neighborhood, applyBudget } from './graph.js';
|
|
|
10
10
|
import { buildTree, renderTree, buildDigest } from './digest.js';
|
|
11
11
|
import { compact, maybeCompact } from './compact.js';
|
|
12
12
|
import { staleness, currentRepo, reviewCandidates } from './staleness.js';
|
|
13
|
-
import { setup as runSetup, unlinkSkills, danglingSkillLinks } from './setup.js';
|
|
14
|
-
import { detectTargets } from './targets.js';
|
|
13
|
+
import { setup as runSetup, unlinkSkills, danglingSkillLinks, SKILLS } from './setup.js';
|
|
14
|
+
import { detectTargets, installableTargets } from './targets.js';
|
|
15
|
+
import { join } from 'node:path';
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* One process, one answer.
|
|
@@ -473,6 +474,28 @@ function cmdDoctor() {
|
|
|
473
474
|
agents.map((t) => `${t.label}${t.kind === 'unsupported' ? ' (skipped)' : ''}`).join('; '),
|
|
474
475
|
);
|
|
475
476
|
|
|
477
|
+
// Detection is not installation, and conflating them is how this tool reports
|
|
478
|
+
// healthy while doing nothing. npm gates postinstall scripts behind allow-scripts,
|
|
479
|
+
// and managed profiles set ignore-scripts=true; in both cases the CLI lands on PATH
|
|
480
|
+
// and every agent directory stays empty, while every other check here still passes.
|
|
481
|
+
// So verify the files, per agent, rather than trusting that setup ever ran.
|
|
482
|
+
const gaps = [];
|
|
483
|
+
for (const t of installableTargets()) {
|
|
484
|
+
const absent = SKILLS.filter((name) =>
|
|
485
|
+
t.kind === 'skill-dir'
|
|
486
|
+
? !existsSync(join(t.dir, name, 'SKILL.md'))
|
|
487
|
+
: !existsSync(join(t.dir, `${name}.prompt.md`)),
|
|
488
|
+
);
|
|
489
|
+
if (absent.length) gaps.push(`${t.label}: ${absent.join(', ')}`);
|
|
490
|
+
}
|
|
491
|
+
add(
|
|
492
|
+
'skills installed',
|
|
493
|
+
gaps.length === 0,
|
|
494
|
+
gaps.length
|
|
495
|
+
? `${gaps.join('; ')} — run \`agent-memory setup\``
|
|
496
|
+
: `${SKILLS.length} in each of ${installableTargets().length} agents`,
|
|
497
|
+
);
|
|
498
|
+
|
|
476
499
|
const dangling = danglingSkillLinks();
|
|
477
500
|
add(
|
|
478
501
|
'no broken skill links',
|
package/src/targets.js
CHANGED
|
@@ -115,18 +115,19 @@ export function detectTargets(home = agentHome()) {
|
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
//
|
|
119
|
-
//
|
|
120
|
-
//
|
|
121
|
-
|
|
122
|
-
|
|
118
|
+
// GitHub documents two personal skill directories, `~/.copilot/skills` and
|
|
119
|
+
// `~/.agents/skills`, and Copilot reads both. The `agents` entry above therefore
|
|
120
|
+
// already covers Copilot on a machine that has never run the CLI; this entry exists
|
|
121
|
+
// so that a machine which has one keeps its skills where its own docs say to look.
|
|
122
|
+
const copilotHome = join(home, '.copilot');
|
|
123
|
+
if (existsSync(copilotHome)) {
|
|
123
124
|
targets.push({
|
|
124
125
|
id: 'copilot-cli',
|
|
125
|
-
label: 'Copilot CLI',
|
|
126
|
-
kind: '
|
|
127
|
-
dir:
|
|
126
|
+
label: 'GitHub Copilot CLI',
|
|
127
|
+
kind: 'skill-dir',
|
|
128
|
+
dir: join(copilotHome, 'skills'),
|
|
128
129
|
detected: true,
|
|
129
|
-
note: '
|
|
130
|
+
note: 'personal agent skills, same SKILL.md layout',
|
|
130
131
|
});
|
|
131
132
|
}
|
|
132
133
|
|