hmem-mcp 5.0.0 → 5.1.21
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 +161 -214
- package/dist/cli-checkpoint.js +102 -40
- package/dist/cli-checkpoint.js.map +1 -1
- package/dist/cli-context-inject.d.ts +7 -6
- package/dist/cli-context-inject.js +27 -130
- package/dist/cli-context-inject.js.map +1 -1
- package/dist/cli-env.d.ts +16 -0
- package/dist/cli-env.js +40 -0
- package/dist/cli-env.js.map +1 -0
- package/dist/cli-hook-startup.d.ts +20 -0
- package/dist/cli-hook-startup.js +101 -0
- package/dist/cli-hook-startup.js.map +1 -0
- package/dist/cli-init.js +97 -188
- package/dist/cli-init.js.map +1 -1
- package/dist/cli-log-exchange.js +63 -3
- package/dist/cli-log-exchange.js.map +1 -1
- package/dist/cli-statusline.d.ts +14 -0
- package/dist/cli-statusline.js +172 -0
- package/dist/cli-statusline.js.map +1 -0
- package/dist/cli.js +18 -2
- package/dist/cli.js.map +1 -1
- package/dist/hmem-config.d.ts +10 -0
- package/dist/hmem-config.js +63 -13
- package/dist/hmem-config.js.map +1 -1
- package/dist/hmem-store.d.ts +30 -1
- package/dist/hmem-store.js +219 -48
- package/dist/hmem-store.js.map +1 -1
- package/dist/mcp-server.js +202 -75
- package/dist/mcp-server.js.map +1 -1
- package/package.json +1 -1
- package/scripts/autoresearch-nightly.sh +84 -0
- package/scripts/hmem-statusline.sh +4 -0
- package/skills/hmem-config/SKILL.md +112 -147
- package/skills/hmem-curate/SKILL.md +56 -6
- package/skills/hmem-new-project/SKILL.md +164 -0
- package/skills/hmem-read/SKILL.md +174 -146
- package/skills/hmem-release/SKILL.md +141 -0
- package/skills/hmem-self-curate/SKILL.md +49 -7
- package/skills/hmem-setup/SKILL.md +169 -87
- package/skills/hmem-sync-setup/SKILL.md +16 -3
- package/skills/hmem-update/SKILL.md +254 -0
- package/skills/hmem-wipe/SKILL.md +47 -21
- package/skills/hmem-write/SKILL.md +38 -14
|
@@ -1,191 +1,156 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: hmem-config
|
|
3
3
|
description: >
|
|
4
|
-
View and change hmem settings,
|
|
5
|
-
types /hmem-config
|
|
6
|
-
|
|
4
|
+
View and change hmem memory settings, hooks, sync, and checkpoint configuration.
|
|
5
|
+
Use this skill whenever the user types /hmem-config, asks to change memory settings,
|
|
6
|
+
adjust parameters, tune bulk-read behavior, configure auto-checkpoints, manage
|
|
7
|
+
hmem-sync, or troubleshoot memory-related issues. Also trigger when the user asks
|
|
8
|
+
things like "how often does auto-save fire", "why is my context so large",
|
|
9
|
+
"change checkpoint to auto", "how many tokens does startup cost", or "set up sync".
|
|
7
10
|
---
|
|
8
11
|
|
|
9
12
|
# hmem-config — View and Change Settings
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
This skill guides you through reading, explaining, and updating hmem's configuration. The config controls how memory is stored, displayed, checkpointed, and synced across devices.
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
## Locate and read the config
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
# Check the MCP environment variable first
|
|
18
|
-
echo $HMEM_PROJECT_DIR
|
|
18
|
+
The config lives at `hmem.config.json` inside the hmem project directory. With an agent ID, it's typically at `~/.hmem/Agents/<NAME>/hmem.config.json`. Without one, `~/.hmem/hmem.config.json`.
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
```
|
|
20
|
+
Read the file directly — don't ask the user where it is. If it doesn't exist, offer to create one (only non-default values need to be specified).
|
|
21
|
+
|
|
22
|
+
The config uses a unified format with a `"memory"` block and an optional `"sync"` block:
|
|
24
23
|
|
|
25
|
-
If the file does not exist, offer to create it with defaults (see Step 3).
|
|
26
|
-
|
|
27
|
-
## Step 2 — Read and display current settings
|
|
28
|
-
|
|
29
|
-
Read the file and show the user a clear table of current values vs. defaults:
|
|
30
|
-
|
|
31
|
-
| Parameter | Current value | Default | What it does |
|
|
32
|
-
|-----------|--------------|---------|--------------|
|
|
33
|
-
| `maxL1Chars` | … | 120 | Max characters for Level 1 summaries (the one-liner shown at session start). Keep short — this is what the agent always sees. |
|
|
34
|
-
| `maxLnChars` | … | 50000 | Max characters for deeper levels (L2–L5). Controls how much detail you can store per node. |
|
|
35
|
-
| `maxDepth` | … | 5 | How many nesting levels are available (1–5). 5 is the maximum. |
|
|
36
|
-
| `defaultReadLimit` | … | 100 | Max entries returned by a single `read_memory()` call. |
|
|
37
|
-
| `maxTitleChars` | … | 50 | Max characters for entry titles (auto-extracted from first line). Shown in `titles_only` mode and as navigation labels. |
|
|
38
|
-
| `accessCountTopN` | … | 5 | Top-N most-accessed entries always get L2 inlined in bulk reads ("organic favorites"). These are shown with a [★] marker. Set to 0 to disable. |
|
|
39
|
-
| `prefixes` | … | P,L,T,E,D,M,S,N,H,R | (P)roject, (L)esson, (T)ask, (E)rror, (D)ecision, (M)ilestone, (S)kill, (N)avigator, (H)uman. Custom prefixes merged with defaults. |
|
|
40
|
-
| `prefixDescriptions` | … | (see below) | Human-readable descriptions for each prefix category, used as group headers in bulk reads. |
|
|
41
|
-
| `bulkReadV2.topAccessCount` | … | 3 | Number of top-accessed entries to expand in V2 bulk reads. |
|
|
42
|
-
| `bulkReadV2.topNewestCount` | … | 5 | Number of newest entries to expand in V2 bulk reads. |
|
|
43
|
-
| `bulkReadV2.topObsoleteCount` | … | 3 | Number of obsolete entries to keep visible ("biggest mistakes"). |
|
|
44
|
-
| `bulkReadV2.topSubnodeCount` | … | 3 | Number of entries with the most sub-nodes to always expand. Shown with `[≡]` marker. |
|
|
45
|
-
|
|
46
|
-
### Bulk-Read Algorithm (V2.1)
|
|
47
|
-
|
|
48
|
-
The bulk-read algorithm groups entries by prefix category and uses smart expansion:
|
|
49
|
-
|
|
50
|
-
- **Expanded entries**: newest (top N), most-accessed (top N), and all favorites → show ALL L2 children + links
|
|
51
|
-
- **[♥] Favorites**: always expanded, marked with [♥]
|
|
52
|
-
- **[★] Top-accessed**: most-accessed entries per prefix, marked with [★]
|
|
53
|
-
- **Obsolete entries**: top N by weighted score shown with `[!]`, rest hidden
|
|
54
|
-
- **Per-prefix guarantee**: each category's youngest + most-accessed entry is always expanded
|
|
55
|
-
- **Time-weighted scoring**: "most-accessed" uses `access_count / log2(age_in_days + 2)` — newer entries with fewer accesses can outrank older ones. This prevents old entries from dominating just because they had more time to accumulate accesses.
|
|
56
|
-
|
|
57
|
-
**Compact title listing** — `read_memory(titles_only=true)`:
|
|
58
|
-
- V2 selection still applies (only the important entries are shown)
|
|
59
|
-
- But output is compact: one line per entry with `(N)` child count hints
|
|
60
|
-
- Expanded entries (favorites, top-accessed) show their L2 children titles inline
|
|
61
|
-
- Use for quick orientation or as a table of contents
|
|
62
|
-
|
|
63
|
-
Tune via `bulkReadV2`:
|
|
64
24
|
```json
|
|
65
25
|
{
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
"topNewestCount": 5,
|
|
69
|
-
"topObsoleteCount": 3,
|
|
70
|
-
"topSubnodeCount": 3
|
|
71
|
-
}
|
|
26
|
+
"memory": { ... },
|
|
27
|
+
"sync": { ... }
|
|
72
28
|
}
|
|
73
29
|
```
|
|
74
30
|
|
|
75
|
-
|
|
31
|
+
## Show current settings
|
|
32
|
+
|
|
33
|
+
Present a table of current values vs. defaults. Only highlight values that differ from defaults — the user cares about what they've customized, not the full list.
|
|
34
|
+
|
|
35
|
+
### Core parameters
|
|
36
|
+
|
|
37
|
+
| Parameter | Default | Purpose |
|
|
38
|
+
|-----------|---------|---------|
|
|
39
|
+
| `maxCharsPerLevel` | [200, 2500, 10000, 25000, 50000] | Character limits per tree level [L1–L5]. L1 is always loaded at startup, so keeping it short saves tokens across every session. L5 is raw data, rarely accessed. |
|
|
40
|
+
| `maxDepth` | 5 | Tree depth (1–5). Most users need 5. Lower values save storage but lose granularity. |
|
|
41
|
+
| `defaultReadLimit` | 100 | Max entries per bulk read. Lower = faster startup, higher = more complete overview. |
|
|
42
|
+
| `maxTitleChars` | 50 | Auto-extracted title length. Only applies to entries without explicit `>` body format — entries with `>` use the first non-body line as title verbatim. Titles are navigation labels — too short truncates meaning, too long wastes space. |
|
|
43
|
+
| `accessCountTopN` | 5 | Entries with highest access count get [★] and auto-expand in bulk reads. These are "organic favorites" — the things the agent keeps coming back to. |
|
|
44
|
+
|
|
45
|
+
### Checkpoint and session parameters (v5+)
|
|
76
46
|
|
|
77
|
-
|
|
47
|
+
These control the automatic knowledge extraction pipeline:
|
|
78
48
|
|
|
49
|
+
| Parameter | Default | Purpose |
|
|
50
|
+
|-----------|---------|---------|
|
|
51
|
+
| `checkpointMode` | `"remind"` | **`"auto"`** spawns a Haiku subagent in the background every N exchanges — it reads the conversation, extracts lessons/errors/decisions, and writes them via MCP tools. The main agent is never interrupted. **`"remind"`** injects a prompt asking the main agent to save manually — simpler but interrupts flow. |
|
|
52
|
+
| `checkpointInterval` | 20 | Exchanges between checkpoints. Counted in the active O-entry, not per session — so 10 messages on your laptop + 10 on your server = checkpoint fires at 20. Set to 0 to disable. |
|
|
53
|
+
| `recentOEntries` | 10 | How many recent session logs to show when loading a project. All entries include full user/agent exchanges (L4/L5), not just titles. Higher = more context but more tokens at project load. |
|
|
54
|
+
| `contextTokenThreshold` | 100000 | When cumulative hmem output exceeds this, the agent is told to flush context and /clear. Prevents runaway token usage in long sessions. Set to 0 to disable. |
|
|
55
|
+
|
|
56
|
+
### load_project display (v5.1.8+)
|
|
57
|
+
|
|
58
|
+
Controls which P-entry sections are expanded when loading a project:
|
|
59
|
+
|
|
60
|
+
| Parameter | Default | Purpose |
|
|
61
|
+
|-----------|---------|---------|
|
|
62
|
+
| `loadProjectExpand.withBody` | `[1]` | L2 section seq numbers where L3 children show title + body content. Default: `.1 Overview` — shows full architecture/state/goals detail. |
|
|
63
|
+
| `loadProjectExpand.withChildren` | `[6, 8]` | L2 section seq numbers where all L3 children are listed as titles. Default: `.6 Bugs`, `.8 Open Tasks` — all items visible at a glance. |
|
|
64
|
+
|
|
65
|
+
Sections not in either list show L3 titles only in compact mode. Example config:
|
|
79
66
|
```json
|
|
80
|
-
{
|
|
81
|
-
"prefixDescriptions": {
|
|
82
|
-
"P": "(P)roject experiences and summaries",
|
|
83
|
-
"L": "(L)essons learned and best practices",
|
|
84
|
-
"T": "(T)asks and work items",
|
|
85
|
-
"E": "(E)rrors encountered and their fixes",
|
|
86
|
-
"D": "(D)ecisions and their rationale",
|
|
87
|
-
"M": "(M)ilestones and achievements",
|
|
88
|
-
"S": "(S)kills and technical knowledge",
|
|
89
|
-
"N": "(N)avigation and context notes",
|
|
90
|
-
"H": "(H)uman — knowledge about the user",
|
|
91
|
-
"R": "(R)ules — user-defined rules and constraints"
|
|
92
|
-
}
|
|
93
|
-
}
|
|
67
|
+
{ "memory": { "loadProjectExpand": { "withBody": [1, 4], "withChildren": [6, 8, 9] } } }
|
|
94
68
|
```
|
|
69
|
+
This would expand Overview + Context with body, and list all Bugs + Tasks + Ideas as titles.
|
|
95
70
|
|
|
96
|
-
|
|
71
|
+
### Bulk-read tuning
|
|
97
72
|
|
|
98
|
-
|
|
73
|
+
The bulk-read algorithm decides which entries get expanded (full L2 detail) vs. compressed (title only). Most users don't need to touch these — the defaults work well up to ~500 entries.
|
|
99
74
|
|
|
100
|
-
|
|
75
|
+
| Parameter | Default | Purpose |
|
|
76
|
+
|-----------|---------|---------|
|
|
77
|
+
| `bulkReadV2.topNewestCount` | 5 | Newest entries expanded. Increase if you want more recent context at startup. |
|
|
78
|
+
| `bulkReadV2.topAccessCount` | 3 | Most-accessed entries expanded (time-weighted: `access_count / log2(age_days + 2)`). |
|
|
79
|
+
| `bulkReadV2.topObsoleteCount` | 3 | Obsolete entries kept visible — "biggest mistakes" are still worth seeing. |
|
|
80
|
+
| `bulkReadV2.topSubnodeCount` | 3 | Entries with most children expanded. These tend to be the most detailed/important. |
|
|
101
81
|
|
|
102
|
-
|
|
103
|
-
2. Show the current value and the recommended range
|
|
104
|
-
3. Ask for the new value
|
|
105
|
-
4. Validate the input (numbers must be positive integers, tiers must be valid JSON)
|
|
82
|
+
### Prefixes
|
|
106
83
|
|
|
107
|
-
|
|
84
|
+
Default: P, L, T, E, D, M, S, N, H, R, O, I. Custom prefixes are merged with defaults — they don't replace them. Each prefix can have a custom description used as group header in bulk reads.
|
|
108
85
|
|
|
109
|
-
|
|
110
|
-
|-----------|-----|-----|-------|
|
|
111
|
-
| `maxL1Chars` | 60 | 200 | Below 60: too terse. Above 200: wastes token budget at every spawn. |
|
|
112
|
-
| `maxLnChars` | 1000 | 100000 | Higher = more detail possible, but rarely read. |
|
|
113
|
-
| `maxDepth` | 2 | 5 | 3 is enough for most users. 5 for complex multi-agent setups. |
|
|
114
|
-
| `defaultReadLimit` | 20 | 500 | Lower if startup feels slow. Higher if you have many entries. |
|
|
115
|
-
| `maxTitleChars` | 20 | 100 | Below 30: titles truncated too aggressively. 50 is a good default. |
|
|
116
|
-
| `accessCountTopN` | 0 | 20 | 0 = disabled. 5 is a good default. Raise if you have many frequently-accessed entries you want always visible. |
|
|
117
|
-
| `bulkReadV2.topAccessCount` | 0 | 20 | How many most-accessed entries (by time-weighted score) get full expansion. |
|
|
118
|
-
| `bulkReadV2.topNewestCount` | 0 | 20 | How many newest entries get full expansion. |
|
|
119
|
-
| `bulkReadV2.topObsoleteCount` | 0 | 20 | How many obsolete entries stay visible in bulk reads. |
|
|
120
|
-
| `bulkReadV2.topSubnodeCount` | 0 | 20 | How many entries with the most sub-nodes always get expanded. 0 = disabled. |
|
|
86
|
+
## Help the user make changes
|
|
121
87
|
|
|
122
|
-
|
|
88
|
+
For each parameter the user wants to change:
|
|
123
89
|
|
|
124
|
-
|
|
90
|
+
1. **Explain the tradeoff** in plain language — what gets better, what gets worse
|
|
91
|
+
2. **Show the recommended range** (see below)
|
|
92
|
+
3. **Validate** before writing — numbers must be positive, arrays must be valid JSON
|
|
125
93
|
|
|
126
|
-
|
|
94
|
+
### Recommended ranges
|
|
127
95
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
96
|
+
| Parameter | Range | Guidance |
|
|
97
|
+
|-----------|-------|----------|
|
|
98
|
+
| `maxCharsPerLevel[0]` (L1) | 60–300 | Below 60 is too terse for useful summaries. Above 300 wastes tokens on every bulk read — L1 is loaded at every session start. |
|
|
99
|
+
| `maxCharsPerLevel[4]` (L5) | 1000–100000 | Raw data storage. Higher allows more verbatim content but L5 is rarely loaded. |
|
|
100
|
+
| `maxDepth` | 2–5 | 3 suffices for simple setups. 5 for multi-agent or complex projects. |
|
|
101
|
+
| `checkpointMode` | `"auto"` or `"remind"` | Recommend `"auto"` — it's non-disruptive and produces better results because Haiku has MCP access to check for duplicates. Auto-checkpoints also write rolling summaries (`[CP]` nodes) and tag skill-dialog exchanges for filtering. |
|
|
102
|
+
| `checkpointInterval` | 0–100 | 20 is a good balance. Lower = more frequent saves (more Haiku cost). 0 = disabled. |
|
|
103
|
+
| `recentOEntries` | 0–20 | 10 is the sweet spot. With checkpoint summaries, `load_project` shows summary + recent exchanges only — much more compact than raw exchange dumps. |
|
|
104
|
+
| `contextTokenThreshold` | 0–500000 | 100k is recommended for most models. Increase for 1M-context models. |
|
|
132
105
|
|
|
133
|
-
|
|
106
|
+
### Common recipes
|
|
134
107
|
|
|
135
|
-
|
|
108
|
+
**"I want auto-checkpoints":**
|
|
109
|
+
```json
|
|
110
|
+
{ "memory": { "checkpointMode": "auto", "checkpointInterval": 20 } }
|
|
111
|
+
```
|
|
136
112
|
|
|
137
|
-
|
|
113
|
+
**"Startup is too slow / uses too many tokens":**
|
|
114
|
+
Reduce `recentOEntries` (e.g., 5), `bulkReadV2.topNewestCount` (e.g., 3), or `maxCharsPerLevel[0]` (e.g., 150).
|
|
138
115
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
which hmem-sync 2>/dev/null || npx hmem-sync --help 2>/dev/null
|
|
142
|
-
```
|
|
116
|
+
**"I have 500+ entries and bulk reads are noisy":**
|
|
117
|
+
Increase `bulkReadV2.topAccessCount` and decrease `topNewestCount` — favor proven entries over new ones.
|
|
143
118
|
|
|
144
|
-
|
|
119
|
+
## Write the updated config
|
|
145
120
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
121
|
+
Write `hmem.config.json` with only non-default values. The config uses a `"memory"` wrapper:
|
|
122
|
+
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"memory": {
|
|
126
|
+
"checkpointMode": "auto"
|
|
127
|
+
},
|
|
128
|
+
"sync": { ... }
|
|
129
|
+
}
|
|
149
130
|
```
|
|
150
131
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
### If hmem-sync is NOT installed:
|
|
164
|
-
|
|
165
|
-
Tell the user:
|
|
166
|
-
|
|
167
|
-
> **hmem-sync** enables zero-knowledge encrypted sync between devices. Your memories are encrypted client-side with AES-256-GCM before leaving your machine — the server only sees opaque blobs.
|
|
168
|
-
>
|
|
169
|
-
> This lets you:
|
|
170
|
-
> - Work on your PC, then continue on your laptop with full memory
|
|
171
|
-
> - Back up your memories to a server you control
|
|
172
|
-
> - Share memories between Claude Code, Gemini CLI, and OpenCode
|
|
173
|
-
>
|
|
174
|
-
> Install: `npm install -g hmem-sync`
|
|
175
|
-
> Setup: `npx hmem-sync setup` (first device) or `npx hmem-sync restore` (additional devices)
|
|
176
|
-
>
|
|
177
|
-
> Want me to install it now?
|
|
178
|
-
|
|
179
|
-
If the user says yes:
|
|
132
|
+
After writing, tell the user:
|
|
133
|
+
- Which values changed
|
|
134
|
+
- Changes take effect **immediately** — no restart needed
|
|
135
|
+
- `maxCharsPerLevel` only affects new entries (existing entries are not reformatted)
|
|
136
|
+
|
|
137
|
+
## Check hmem-sync status
|
|
138
|
+
|
|
139
|
+
Run this check as part of every /hmem-config invocation.
|
|
140
|
+
|
|
141
|
+
**If installed** (`which hmem-sync`): run `npx hmem-sync status` and show server URL, user ID, last push/pull timestamps, and whether `HMEM_SYNC_PASSPHRASE` is set in `.mcp.json` (needed for auto-sync).
|
|
142
|
+
|
|
143
|
+
**If not installed**: explain that hmem-sync enables zero-knowledge encrypted cross-device sync (AES-256-GCM, server sees only opaque blobs), and offer to install it:
|
|
180
144
|
```bash
|
|
181
145
|
npm install -g hmem-sync
|
|
182
|
-
npx hmem-sync
|
|
146
|
+
npx hmem-sync connect
|
|
183
147
|
```
|
|
184
148
|
|
|
185
149
|
### Sync troubleshooting
|
|
186
150
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
151
|
+
| Problem | Fix |
|
|
152
|
+
|---------|-----|
|
|
153
|
+
| "Config not found" | Run `npx hmem-sync connect` |
|
|
154
|
+
| 401 Token verification failed | Passphrase has special chars — set `HMEM_SYNC_PASSPHRASE` in .mcp.json env |
|
|
155
|
+
| 0 entries after pull | `HMEM_AGENT_ID` must match between devices |
|
|
156
|
+
| Update | `npm update -g hmem-sync` (always global, never inside a project) |
|
|
@@ -94,14 +94,64 @@ fix_agent_memory(agent_name, "E0009", links=["P0001"])
|
|
|
94
94
|
|
|
95
95
|
Don't over-link: only add links where the connection adds real navigational value, not just topical similarity.
|
|
96
96
|
|
|
97
|
-
###
|
|
98
|
-
Entries should have a meaningful title (~50 chars, configurable via `maxTitleChars`) for navigation. If an entry has no explicit title (auto-extracted from first `maxTitleChars` chars), check whether the auto-extracted title is useful. If it's truncated mid-word or vague, write a proper title:
|
|
97
|
+
### Title/Body Quality (v5.1+)
|
|
99
98
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
Since v5.1, entries support explicit title/body separation via the `>` format. During curation:
|
|
100
|
+
|
|
101
|
+
**Root entries (L1):**
|
|
102
|
+
- Check if the auto-extracted title is meaningful. If it's truncated or vague, rewrite with explicit title + body:
|
|
103
|
+
```
|
|
104
|
+
fix_agent_memory(agent_name, id, content="Clear navigation title\n> Original detailed L1 text that was too long for a title")
|
|
105
|
+
```
|
|
106
|
+
- Old entries without `>` still work — the title is auto-extracted from `level_1`. Only rewrite if the auto-title is genuinely bad.
|
|
107
|
+
|
|
108
|
+
**Child nodes (L2+):**
|
|
109
|
+
- Same principle: if a node has dense content, split into title + body:
|
|
110
|
+
```
|
|
111
|
+
fix_agent_memory(agent_name, "L0003.2", content="Short node title\n> Detailed explanation\n> spanning multiple lines")
|
|
112
|
+
```
|
|
113
|
+
- Nodes with short, clear content don't need body separation — leave them as-is.
|
|
114
|
+
|
|
115
|
+
**When to rewrite old entries:**
|
|
116
|
+
- Auto-title is truncated mid-word or meaningless
|
|
117
|
+
- Node has >200 chars of content crammed into one line
|
|
118
|
+
- Content is valuable but hard to scan in listings (title = full text)
|
|
119
|
+
|
|
120
|
+
**When NOT to rewrite:**
|
|
121
|
+
- Title is already clear and navigable
|
|
122
|
+
- Entry has low access count and marginal value (not worth the effort)
|
|
123
|
+
|
|
124
|
+
### P-Entry Standard-Schema (R0009)
|
|
125
|
+
|
|
126
|
+
All P-entries must follow the standard L2 structure (see R0009):
|
|
127
|
+
`.1 Overview`, `.2 Codebase`, `.3 Usage`, `.4 Context`, `.5 Deployment`, `.6 Bugs`, `.7 Protocol`, `.8 Open tasks`, `.9 Ideas`
|
|
128
|
+
|
|
129
|
+
During curation, check P-entries against this schema:
|
|
130
|
+
- **Missing sections:** Add them using `append_agent_memory(agent_name, "P00XX", content="\tOverview\n\t\tCurrent state: ...")`
|
|
131
|
+
- **Wrong order:** Flag and restructure — order is fixed per R0009
|
|
132
|
+
- **Empty sections:** OK to omit, but if content exists it must be in the right section
|
|
133
|
+
- **L1 body:** Should be a one-line project summary in format `Name | Status | Stack | Description`
|
|
134
|
+
|
|
135
|
+
### O-entry curation (v5.1.2+)
|
|
136
|
+
|
|
137
|
+
O-entries may need curation for titles, tags, and summaries:
|
|
138
|
+
|
|
139
|
+
**Titles:**
|
|
140
|
+
- Old O-entries may have title "unassigned" or generic titles like "hmem-mcp". Fix with `fix_agent_memory(agent_name, id, content="Descriptive session title")`.
|
|
141
|
+
- Good title: "Title/Body Separation design + v5.1.0 release". Bad: "hmem-mcp".
|
|
142
|
+
|
|
143
|
+
**Tags:**
|
|
144
|
+
- O-entries should have a `#session` tag and optionally topic tags (e.g. `#npm`, `#release`, `#refactor`).
|
|
145
|
+
- Add missing tags: `fix_agent_memory(agent_name, id, tags=["#session", "#release"])`
|
|
146
|
+
|
|
147
|
+
**Checkpoint summaries:**
|
|
148
|
+
- O-entries with many exchanges (>10) should have a `[CP]` checkpoint summary. If missing, write one:
|
|
149
|
+
`append_agent_memory(agent_name, "O00XX", content="\t[CP] Factual 3-8 sentence summary of the session")`
|
|
150
|
+
Then tag it: the auto-tagger picks up `[CP]` prefixed nodes on the next checkpoint run.
|
|
103
151
|
|
|
104
|
-
|
|
152
|
+
**Special tagged nodes — do not modify:**
|
|
153
|
+
- **`#checkpoint-summary`** nodes: Auto-generated `[CP]` summaries. Leave as-is.
|
|
154
|
+
- **`#skill-dialog`** exchange nodes: Skill activations filtered from `load_project`. Leave as-is.
|
|
105
155
|
|
|
106
156
|
### Stale entries — auto-mark obsolete
|
|
107
157
|
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hmem-new-project
|
|
3
|
+
description: >
|
|
4
|
+
Create a new P-entry following the R0009 standard schema. Asks key questions,
|
|
5
|
+
optionally scans the codebase, and writes a complete project entry with all
|
|
6
|
+
required sections. Use when the user says "neues Projekt", "new project",
|
|
7
|
+
"Projekt anlegen", or "/hmem-new-project".
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# /hmem-new-project — New Project Entry
|
|
11
|
+
|
|
12
|
+
Create a complete P-entry following the R0009 standard schema. This skill ensures every project starts with a proper structure.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Step 1: Does a codebase exist?
|
|
17
|
+
|
|
18
|
+
Ask the user first:
|
|
19
|
+
|
|
20
|
+
> "Gibt es bereits eine Codebase für dieses Projekt? Wenn ja, in welchem Verzeichnis?"
|
|
21
|
+
|
|
22
|
+
**If yes (path provided):**
|
|
23
|
+
- Scan the directory: read README, CLAUDE.md, package.json/Cargo.toml/setup.py/etc.
|
|
24
|
+
- Detect language, framework, dependencies, entry points
|
|
25
|
+
- Use this to pre-fill Overview, Codebase, Usage, Deployment sections
|
|
26
|
+
- Continue to Step 2 for context the code can't tell us
|
|
27
|
+
|
|
28
|
+
**If no (new idea / planning phase):**
|
|
29
|
+
- Skip codebase scan
|
|
30
|
+
- All sections come from the user's answers
|
|
31
|
+
- Focus on Overview (.1) and Context (.4) — Codebase (.2) stays minimal
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Step 2: Quick questions (one at a time)
|
|
36
|
+
|
|
37
|
+
Ask these in order. Skip questions already answered by the codebase scan.
|
|
38
|
+
|
|
39
|
+
1. **Name** — "Wie soll das Projekt heißen?" (short name for the L1 title)
|
|
40
|
+
2. **Status** — "Status? Active / Paused / Planning / Mature / Archived"
|
|
41
|
+
3. **Stack** — "Welche Technologien? (z.B. TS/React, AHK v2, Python/Flask)"
|
|
42
|
+
4. **One-liner** — "Beschreib das Projekt in einem Satz"
|
|
43
|
+
5. **Goal** — "Was ist das Hauptziel?"
|
|
44
|
+
6. **Who/Why** — "Wer nutzt es und warum?" (target audience + motivation)
|
|
45
|
+
7. **GitHub/Repo** — "Gibt es ein Repo? (URL oder 'nein')"
|
|
46
|
+
8. **Deployment** — "Wie wird es deployed? (npm, exe, server, manual, noch nicht)"
|
|
47
|
+
|
|
48
|
+
Stop asking if the user says "reicht" or "das war's" — fill remaining sections from context or leave them minimal.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Step 3: Build the P-entry
|
|
53
|
+
|
|
54
|
+
Construct the entry following R0009 schema strictly:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
Name | Status | Stack | One-liner
|
|
58
|
+
> Goal and context in 1-2 sentences
|
|
59
|
+
\tOverview
|
|
60
|
+
\t\tCurrent state: ...
|
|
61
|
+
\t\tGoals: ...
|
|
62
|
+
\t\tArchitecture: ... (from codebase scan or user description)
|
|
63
|
+
\tCodebase
|
|
64
|
+
\t\tEntry point: ... (from scan)
|
|
65
|
+
\t\t... (key files/modules)
|
|
66
|
+
\tUsage
|
|
67
|
+
\t\tInstallation: ...
|
|
68
|
+
\t\tCLI/API: ...
|
|
69
|
+
\tContext
|
|
70
|
+
\t\tInitiator: User, date
|
|
71
|
+
\t\tTarget audience: ...
|
|
72
|
+
\t\tBusiness context: ...
|
|
73
|
+
\tDeployment
|
|
74
|
+
\t\t... (from scan or user answer)
|
|
75
|
+
\tBugs
|
|
76
|
+
\tProtocol
|
|
77
|
+
\tOpen tasks
|
|
78
|
+
\tIdeas
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Rules:**
|
|
82
|
+
- L1 format: `Name | Status | Stack | Description` (mandatory)
|
|
83
|
+
- L1 body (>): 1-2 sentence project summary
|
|
84
|
+
- All 9 sections must be present (.1 Overview through .9 Ideas)
|
|
85
|
+
- Empty sections get a placeholder child: e.g. `\t\tNone yet`
|
|
86
|
+
- If codebase was scanned: .2 Codebase lists key files with descriptions
|
|
87
|
+
- .7 Protocol starts empty (O-entries will fill it automatically)
|
|
88
|
+
- Tags: at least `#project` + language/framework tags
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Step 4: Write and activate
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
write_memory(prefix="P", content="...", tags=["#project", "#typescript", ...])
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Then activate it:
|
|
99
|
+
```
|
|
100
|
+
update_memory(id="P00XX", active=true)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Show the user the created entry:
|
|
104
|
+
```
|
|
105
|
+
read_memory(id="P00XX", depth=2)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Step 5: Link related entries
|
|
111
|
+
|
|
112
|
+
Check if there are existing L/D/E/T entries that should be linked:
|
|
113
|
+
```
|
|
114
|
+
read_memory(search="project name or keywords")
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
If found, add links:
|
|
118
|
+
```
|
|
119
|
+
update_memory(id="P00XX", links=["T0044", "L0095"])
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Codebase scan details
|
|
125
|
+
|
|
126
|
+
When scanning a codebase directory, read in this order:
|
|
127
|
+
1. `CLAUDE.md` or `AGENTS.md` — richest project context
|
|
128
|
+
2. `README.md` — overview, installation, usage
|
|
129
|
+
3. `package.json` / `Cargo.toml` / `setup.py` / `go.mod` — name, version, deps, scripts
|
|
130
|
+
4. `.github/workflows/` — CI/CD setup
|
|
131
|
+
5. `src/` or main source directory — entry points, key modules
|
|
132
|
+
6. `docs/` — any existing specs or designs
|
|
133
|
+
|
|
134
|
+
Extract:
|
|
135
|
+
- Project name and version
|
|
136
|
+
- Language and framework
|
|
137
|
+
- Entry point(s)
|
|
138
|
+
- Key modules/files (max 10-15)
|
|
139
|
+
- Build/run commands
|
|
140
|
+
- Test commands
|
|
141
|
+
- Dependencies (major ones only)
|
|
142
|
+
|
|
143
|
+
Do NOT read every file — scan directory structure and read key files only.
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## Example output
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
EasySAP | Active | AHK v2/SAP GUI Scripting | SAP Freigabeprozess Automatisierung
|
|
151
|
+
> Automatisiert Status-Übergänge, PDF-Prüfungen, Spezifikations-Verknüpfung und FPR-Erstellung via SAP GUI COM Scripting.
|
|
152
|
+
.1 Overview
|
|
153
|
+
.1.1 Current state: Production, läuft auf Server-VM mit 3 SAP-Sessions
|
|
154
|
+
.1.2 Goals: Vollautomatischer Freigabeprozess ohne manuelle SAP-Interaktion
|
|
155
|
+
.1.3 Architecture: Client/Server via Shared Network Drive (U:\ESAP\)
|
|
156
|
+
.2 Codebase
|
|
157
|
+
.2.1 Easy-SAP_Server.ahk — Haupt-Automations-Engine (Polling-Loop, SAP-Sessions, Status-Pipeline)
|
|
158
|
+
.2.2 Easy-SAP_Client.ahk — Lightweight Client (Hotkeys, Task-Erstellung)
|
|
159
|
+
.2.3 EasySAP_Shared.ahk — Shared Functions (Logging, Session-Management, Email)
|
|
160
|
+
.3 Usage
|
|
161
|
+
.3.1 Server: AutoHotkey64.exe Easy-SAP_Server.ahk
|
|
162
|
+
.3.2 Client: Alt+F (neue Aufgabe), Alt+X (beenden)
|
|
163
|
+
...
|
|
164
|
+
```
|