@lh8ppl/claude-memory-kit 0.1.0 → 0.1.2

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.
Files changed (46) hide show
  1. package/README.md +77 -0
  2. package/bin/cmk-auto-extract.mjs +62 -0
  3. package/bin/cmk-capture-prompt.mjs +65 -0
  4. package/bin/cmk-capture-turn.mjs +76 -0
  5. package/bin/cmk-compress-lazy.mjs +0 -0
  6. package/bin/cmk-compress-session.mjs +64 -0
  7. package/bin/cmk-daily-distill.mjs +0 -0
  8. package/bin/cmk-inject-context.mjs +69 -0
  9. package/bin/cmk-observe-edit.mjs +57 -0
  10. package/bin/cmk-weekly-curate.mjs +0 -0
  11. package/bin/cmk.mjs +11 -11
  12. package/package.json +10 -2
  13. package/src/audit-log.mjs +1 -0
  14. package/src/claude-md.mjs +212 -212
  15. package/src/compressor.mjs +18 -18
  16. package/src/doctor.mjs +21 -8
  17. package/src/frontmatter.mjs +73 -73
  18. package/src/index-rebuild.mjs +26 -4
  19. package/src/inject-context.mjs +150 -10
  20. package/src/install.mjs +49 -1
  21. package/src/mcp-server.mjs +17 -0
  22. package/src/memory-write.mjs +18 -5
  23. package/src/merge-facts.mjs +213 -213
  24. package/src/provenance.mjs +217 -217
  25. package/src/reindex.mjs +134 -134
  26. package/src/repair.mjs +26 -96
  27. package/src/sanitize.mjs +39 -0
  28. package/src/settings-hooks.mjs +186 -0
  29. package/src/spawn-bin.mjs +83 -0
  30. package/src/subcommands.mjs +144 -10
  31. package/src/write-fact.mjs +46 -3
  32. package/template/.gitignore.fragment +12 -12
  33. package/template/CLAUDE.md.template +53 -49
  34. package/template/docs/journey/journey-log.md.template +292 -292
  35. package/template/project/memory/INDEX.md.template +47 -47
  36. package/template/support/cron-jobs/daily-memory-distill.md +15 -15
  37. package/template/support/cron-jobs/nightly-memsearch-index.md +17 -17
  38. package/template/support/cron-jobs/weekly-memory-curator.md +15 -15
  39. package/template/support/milvus-deploy/README.md +57 -57
  40. package/template/support/milvus-deploy/docker-compose.yml +66 -66
  41. package/template/support/scripts/auto-extract-memory.sh +102 -102
  42. package/template/support/scripts/memsearch-index-with-flush.sh +59 -59
  43. package/template/support/scripts/refresh-distill-timestamp.py +35 -35
  44. package/template/support/scripts/register-crons.py +242 -242
  45. package/template/support/scripts/run-daily-distill.sh +67 -67
  46. package/template/support/scripts/run-weekly-curate.sh +58 -58
@@ -1,292 +1,292 @@
1
- <!--
2
- ==================================================================
3
- JOURNEY LOG — narrative behind the spec
4
- ==================================================================
5
-
6
- What this file IS:
7
- The story of HOW you and your AI assistant figured out what to
8
- build, captured as it happens. Not WHAT you built (that's in
9
- specs/) — but WHY each decision was made, what you tried first
10
- that didn't work, what the AI got wrong, what you corrected.
11
-
12
- What this file is FOR:
13
- - Future-you, six months from now, asking "why did we decide X?"
14
- - A future AI session bootstrapping into the project cold
15
- - An article, talk, or retrospective derived from the build
16
-
17
- How to update it:
18
- Append, don't overwrite. New milestones go at the END of their
19
- phase section. Old entries don't get rewritten — they stay as
20
- the record of what was true at that point in time. When a
21
- decision changes, add an "Update: YYYY-MM-DD" entry rather
22
- than editing the original.
23
-
24
- For inspiration:
25
- See claude-memory-kit's own journey log as a worked example:
26
- https://github.com/LH8PPL/claude-memory-kit/blob/main/docs/journey/v0.1.0-build-log.md
27
-
28
- This template uses HTML comments (like this one) to coach the
29
- user through each section. The comments are stripped from
30
- Claude's context per Anthropic docs, so they don't waste tokens.
31
- Delete a comment block once you've filled in that section.
32
- ==================================================================
33
- -->
34
-
35
- # {{PROJECT_NAME}} — journey log (v{{VERSION}})
36
-
37
- **Started**: {{TODAY}}
38
- **Status**: in progress
39
-
40
- <!--
41
- Pin the high-level "what is this project" in 1-2 sentences here.
42
- Update when the project's mission changes.
43
- -->
44
-
45
- [One-paragraph project summary. Update on major mission changes.]
46
-
47
- ---
48
-
49
- ## 0. The frustration that started this
50
-
51
- <!--
52
- Why does this project exist? What pain were you in, what failed
53
- attempt prompted it, what's the emotional/practical seed?
54
-
55
- This section ages well. Future-you wants to remember why it
56
- mattered. Be specific — "I was tired of re-explaining context
57
- every morning" beats "the AI needed memory."
58
-
59
- Length: 2-4 short paragraphs.
60
- -->
61
-
62
- [Write about the motivating frustration. Be honest, specific.]
63
-
64
- ---
65
-
66
- ## 1. The starting state
67
-
68
- <!--
69
- What existed before you started? Prior versions, existing tooling,
70
- constraints inherited from elsewhere.
71
-
72
- Honest about both what worked and what didn't in the prior state.
73
- This grounds the rest of the log — readers see where you started.
74
-
75
- Format suggestion: a bullet list of what existed + a short
76
- paragraph on what was missing or broken.
77
- -->
78
-
79
- [What existed before; what worked; what was missing.]
80
-
81
- ---
82
-
83
- ## 2. Research
84
-
85
- <!--
86
- What did you read, what projects did you examine, what patterns
87
- did you find converging?
88
-
89
- Most useful pattern to record: specific corrections you made
90
- along the way. "I initially thought X, then found out Y by
91
- reading the actual source" — these become the article's anchor
92
- moments and they decay from memory faster than anything else.
93
-
94
- Tip: maintain a SOURCES.md alongside this file with verification
95
- status (✓ verified primary source / ~ partial / ✗ retracted)
96
- for every external claim you make in the spec.
97
- -->
98
-
99
- ### Articles read
100
-
101
- - [link or title] — what stuck with you in one sentence
102
-
103
- ### Projects examined (primary-source verified)
104
-
105
- - [link] — pattern relevant to yours; what they got right; what you'd do differently
106
-
107
- ### Lessons that emerged
108
-
109
- - **[The rule that crystallized]** — [the specific incident that taught it]
110
-
111
- ---
112
-
113
- ## 3. Design decisions
114
-
115
- <!--
116
- For each major architectural choice: what alternatives were on
117
- the table, what you picked, why. Record the REJECTED options
118
- too — they're more interesting than the chosen ones.
119
-
120
- When a decision changes later: append "Update: YYYY-MM-DD"
121
- rather than rewriting. The history is the value.
122
-
123
- Format suggestion: one sub-section per decision, with the
124
- 4-field structure below.
125
- -->
126
-
127
- ### Decision: [name]
128
-
129
- - **Considered**: A / B / C
130
- - **Chose**: B
131
- - **Why**: [rationale, including what made B's tradeoffs preferable]
132
- - **Tradeoff accepted**: [what you gave up by not picking A or C]
133
-
134
- ---
135
-
136
- ## 4. Working with an AI assistant
137
-
138
- <!--
139
- Skip this section if you're working solo or with humans only.
140
-
141
- If you're using Claude / GPT / Cursor / Copilot / etc., this
142
- section captures:
143
- - Where the AI added the most value
144
- - Where it failed and how you corrected it
145
- - Specific corrections that became durable rules
146
-
147
- This is the section most useful to a future AI session
148
- bootstrapping into your project. Specific incidents beat
149
- general principles every time — quote actual user messages
150
- that became load-bearing.
151
-
152
- Don't sanitize the failures. They're the article material.
153
- -->
154
-
155
- ### Where the AI added value
156
-
157
- - [pattern of value-add — drafting, synthesis, exhaustive comparison, etc.]
158
-
159
- ### Where the AI failed (and what corrected it)
160
-
161
- - **[The failure mode]** — *"[verbatim user correction]"* — [what changed afterward]
162
-
163
- ### Durable rules that emerged
164
-
165
- - **[rule]** — *Why*: [the incident that taught it]. *How to apply*: [when to invoke this rule]
166
-
167
- ---
168
-
169
- ## 5. Implementation log
170
-
171
- <!--
172
- One sub-section per major milestone (task, PR, sprint, layer).
173
-
174
- Keep entries short. The discipline:
175
- - What landed (3-5 bullets, file paths and counts)
176
- - TDD evidence (real bugs caught vs test relaxations)
177
- - Surprises or pivots (anything that didn't go as planned)
178
- - Cumulative test count (so progress is visible)
179
-
180
- Append; don't overwrite. The log grows.
181
- -->
182
-
183
- ### [Task / Milestone N] — [title] ([YYYY-MM-DD])
184
-
185
- **What landed**:
186
-
187
- - [file or feature 1]
188
- - [file or feature 2]
189
-
190
- **TDD evidence**:
191
-
192
- - Tests written first
193
- - [N] real bugs caught by tests; [M] test relaxations resisted
194
- - [cumulative test count] green
195
-
196
- **Surprises**:
197
-
198
- - [anything that didn't go as planned]
199
-
200
- ---
201
-
202
- ## 6. Open questions / things deferred
203
-
204
- <!--
205
- Things you considered and explicitly deferred (with reasons),
206
- so future-you knows why something ISN'T in the current version.
207
-
208
- Format: bullet list with deferral reason.
209
- -->
210
-
211
- - **[thing]** — deferred to vX.Y because [reason]
212
-
213
- ---
214
-
215
- ## 7. Working-style preferences (for future-AI sessions)
216
-
217
- <!--
218
- This section is the most important for AI-assisted projects.
219
- A new AI reading this section should be able to calibrate to
220
- your style without you having to re-explain it.
221
-
222
- Capture:
223
- - Tone preferences (terse / verbose / formal / casual)
224
- - Action signals ("go" = start immediately, etc.)
225
- - Anti-patterns you've explicitly rejected
226
- - Specific corrections that landed (quote them verbatim)
227
- - What you're OK with the AI doing without asking
228
- - What you want the AI to confirm first
229
-
230
- For inspiration, see how claude-memory-kit's CLAUDE.md
231
- captures this:
232
- https://github.com/LH8PPL/claude-memory-kit/blob/main/CLAUDE.md
233
- -->
234
-
235
- ### Tone
236
-
237
- - [preference 1]
238
- - [preference 2]
239
-
240
- ### Action signals
241
-
242
- - "[your signal word]" = [meaning]
243
-
244
- ### Anti-patterns I've rejected
245
-
246
- - **[pattern]** — *why*: [reason; ideally a quoted user correction]
247
-
248
- ### What the AI can do without asking
249
-
250
- - [low-stakes action 1]
251
- - [low-stakes action 2]
252
-
253
- ### What the AI should confirm first
254
-
255
- - [high-stakes action 1 — git push, destructive ops, etc.]
256
-
257
- ---
258
-
259
- ## 8. Conversation as raw material
260
-
261
- <!--
262
- The meta-thread: AI conversations don't persist by default.
263
- If your context window rolls or you start a new session, you
264
- lose everything that's only in conversation memory.
265
-
266
- This file is the bridge. What you write here survives. What
267
- you only said in chat doesn't.
268
-
269
- When something important comes up in conversation that you'd
270
- want a future-you (or future-AI) to know, the discipline is:
271
- write it here. Don't trust the conversation buffer.
272
-
273
- This applies to: design rationale, working-style corrections,
274
- surprising findings, anti-patterns discovered, anything that
275
- took more than a few turns to figure out.
276
- -->
277
-
278
- [Add observations as they emerge. This section grows the most
279
- of any — it's the running notebook.]
280
-
281
- ---
282
-
283
- **Last updated**: {{TODAY}}
284
-
285
- <!--
286
- ==================================================================
287
- End of journey-log scaffold.
288
-
289
- When you've filled in enough that the comments feel like noise,
290
- delete them. The file is yours.
291
- ==================================================================
292
- -->
1
+ <!--
2
+ ==================================================================
3
+ JOURNEY LOG — narrative behind the spec
4
+ ==================================================================
5
+
6
+ What this file IS:
7
+ The story of HOW you and your AI assistant figured out what to
8
+ build, captured as it happens. Not WHAT you built (that's in
9
+ specs/) — but WHY each decision was made, what you tried first
10
+ that didn't work, what the AI got wrong, what you corrected.
11
+
12
+ What this file is FOR:
13
+ - Future-you, six months from now, asking "why did we decide X?"
14
+ - A future AI session bootstrapping into the project cold
15
+ - An article, talk, or retrospective derived from the build
16
+
17
+ How to update it:
18
+ Append, don't overwrite. New milestones go at the END of their
19
+ phase section. Old entries don't get rewritten — they stay as
20
+ the record of what was true at that point in time. When a
21
+ decision changes, add an "Update: YYYY-MM-DD" entry rather
22
+ than editing the original.
23
+
24
+ For inspiration:
25
+ See claude-memory-kit's own journey log as a worked example:
26
+ https://github.com/LH8PPL/claude-memory-kit/blob/main/docs/journey/v0.1.0-build-log.md
27
+
28
+ This template uses HTML comments (like this one) to coach the
29
+ user through each section. The comments are stripped from
30
+ Claude's context per Anthropic docs, so they don't waste tokens.
31
+ Delete a comment block once you've filled in that section.
32
+ ==================================================================
33
+ -->
34
+
35
+ # {{PROJECT_NAME}} — journey log (v{{VERSION}})
36
+
37
+ **Started**: {{TODAY}}
38
+ **Status**: in progress
39
+
40
+ <!--
41
+ Pin the high-level "what is this project" in 1-2 sentences here.
42
+ Update when the project's mission changes.
43
+ -->
44
+
45
+ [One-paragraph project summary. Update on major mission changes.]
46
+
47
+ ---
48
+
49
+ ## 0. The frustration that started this
50
+
51
+ <!--
52
+ Why does this project exist? What pain were you in, what failed
53
+ attempt prompted it, what's the emotional/practical seed?
54
+
55
+ This section ages well. Future-you wants to remember why it
56
+ mattered. Be specific — "I was tired of re-explaining context
57
+ every morning" beats "the AI needed memory."
58
+
59
+ Length: 2-4 short paragraphs.
60
+ -->
61
+
62
+ [Write about the motivating frustration. Be honest, specific.]
63
+
64
+ ---
65
+
66
+ ## 1. The starting state
67
+
68
+ <!--
69
+ What existed before you started? Prior versions, existing tooling,
70
+ constraints inherited from elsewhere.
71
+
72
+ Honest about both what worked and what didn't in the prior state.
73
+ This grounds the rest of the log — readers see where you started.
74
+
75
+ Format suggestion: a bullet list of what existed + a short
76
+ paragraph on what was missing or broken.
77
+ -->
78
+
79
+ [What existed before; what worked; what was missing.]
80
+
81
+ ---
82
+
83
+ ## 2. Research
84
+
85
+ <!--
86
+ What did you read, what projects did you examine, what patterns
87
+ did you find converging?
88
+
89
+ Most useful pattern to record: specific corrections you made
90
+ along the way. "I initially thought X, then found out Y by
91
+ reading the actual source" — these become the article's anchor
92
+ moments and they decay from memory faster than anything else.
93
+
94
+ Tip: maintain a SOURCES.md alongside this file with verification
95
+ status (✓ verified primary source / ~ partial / ✗ retracted)
96
+ for every external claim you make in the spec.
97
+ -->
98
+
99
+ ### Articles read
100
+
101
+ - [link or title] — what stuck with you in one sentence
102
+
103
+ ### Projects examined (primary-source verified)
104
+
105
+ - [link] — pattern relevant to yours; what they got right; what you'd do differently
106
+
107
+ ### Lessons that emerged
108
+
109
+ - **[The rule that crystallized]** — [the specific incident that taught it]
110
+
111
+ ---
112
+
113
+ ## 3. Design decisions
114
+
115
+ <!--
116
+ For each major architectural choice: what alternatives were on
117
+ the table, what you picked, why. Record the REJECTED options
118
+ too — they're more interesting than the chosen ones.
119
+
120
+ When a decision changes later: append "Update: YYYY-MM-DD"
121
+ rather than rewriting. The history is the value.
122
+
123
+ Format suggestion: one sub-section per decision, with the
124
+ 4-field structure below.
125
+ -->
126
+
127
+ ### Decision: [name]
128
+
129
+ - **Considered**: A / B / C
130
+ - **Chose**: B
131
+ - **Why**: [rationale, including what made B's tradeoffs preferable]
132
+ - **Tradeoff accepted**: [what you gave up by not picking A or C]
133
+
134
+ ---
135
+
136
+ ## 4. Working with an AI assistant
137
+
138
+ <!--
139
+ Skip this section if you're working solo or with humans only.
140
+
141
+ If you're using Claude / GPT / Cursor / Copilot / etc., this
142
+ section captures:
143
+ - Where the AI added the most value
144
+ - Where it failed and how you corrected it
145
+ - Specific corrections that became durable rules
146
+
147
+ This is the section most useful to a future AI session
148
+ bootstrapping into your project. Specific incidents beat
149
+ general principles every time — quote actual user messages
150
+ that became load-bearing.
151
+
152
+ Don't sanitize the failures. They're the article material.
153
+ -->
154
+
155
+ ### Where the AI added value
156
+
157
+ - [pattern of value-add — drafting, synthesis, exhaustive comparison, etc.]
158
+
159
+ ### Where the AI failed (and what corrected it)
160
+
161
+ - **[The failure mode]** — *"[verbatim user correction]"* — [what changed afterward]
162
+
163
+ ### Durable rules that emerged
164
+
165
+ - **[rule]** — *Why*: [the incident that taught it]. *How to apply*: [when to invoke this rule]
166
+
167
+ ---
168
+
169
+ ## 5. Implementation log
170
+
171
+ <!--
172
+ One sub-section per major milestone (task, PR, sprint, layer).
173
+
174
+ Keep entries short. The discipline:
175
+ - What landed (3-5 bullets, file paths and counts)
176
+ - TDD evidence (real bugs caught vs test relaxations)
177
+ - Surprises or pivots (anything that didn't go as planned)
178
+ - Cumulative test count (so progress is visible)
179
+
180
+ Append; don't overwrite. The log grows.
181
+ -->
182
+
183
+ ### [Task / Milestone N] — [title] ([YYYY-MM-DD])
184
+
185
+ **What landed**:
186
+
187
+ - [file or feature 1]
188
+ - [file or feature 2]
189
+
190
+ **TDD evidence**:
191
+
192
+ - Tests written first
193
+ - [N] real bugs caught by tests; [M] test relaxations resisted
194
+ - [cumulative test count] green
195
+
196
+ **Surprises**:
197
+
198
+ - [anything that didn't go as planned]
199
+
200
+ ---
201
+
202
+ ## 6. Open questions / things deferred
203
+
204
+ <!--
205
+ Things you considered and explicitly deferred (with reasons),
206
+ so future-you knows why something ISN'T in the current version.
207
+
208
+ Format: bullet list with deferral reason.
209
+ -->
210
+
211
+ - **[thing]** — deferred to vX.Y because [reason]
212
+
213
+ ---
214
+
215
+ ## 7. Working-style preferences (for future-AI sessions)
216
+
217
+ <!--
218
+ This section is the most important for AI-assisted projects.
219
+ A new AI reading this section should be able to calibrate to
220
+ your style without you having to re-explain it.
221
+
222
+ Capture:
223
+ - Tone preferences (terse / verbose / formal / casual)
224
+ - Action signals ("go" = start immediately, etc.)
225
+ - Anti-patterns you've explicitly rejected
226
+ - Specific corrections that landed (quote them verbatim)
227
+ - What you're OK with the AI doing without asking
228
+ - What you want the AI to confirm first
229
+
230
+ For inspiration, see how claude-memory-kit's CLAUDE.md
231
+ captures this:
232
+ https://github.com/LH8PPL/claude-memory-kit/blob/main/CLAUDE.md
233
+ -->
234
+
235
+ ### Tone
236
+
237
+ - [preference 1]
238
+ - [preference 2]
239
+
240
+ ### Action signals
241
+
242
+ - "[your signal word]" = [meaning]
243
+
244
+ ### Anti-patterns I've rejected
245
+
246
+ - **[pattern]** — *why*: [reason; ideally a quoted user correction]
247
+
248
+ ### What the AI can do without asking
249
+
250
+ - [low-stakes action 1]
251
+ - [low-stakes action 2]
252
+
253
+ ### What the AI should confirm first
254
+
255
+ - [high-stakes action 1 — git push, destructive ops, etc.]
256
+
257
+ ---
258
+
259
+ ## 8. Conversation as raw material
260
+
261
+ <!--
262
+ The meta-thread: AI conversations don't persist by default.
263
+ If your context window rolls or you start a new session, you
264
+ lose everything that's only in conversation memory.
265
+
266
+ This file is the bridge. What you write here survives. What
267
+ you only said in chat doesn't.
268
+
269
+ When something important comes up in conversation that you'd
270
+ want a future-you (or future-AI) to know, the discipline is:
271
+ write it here. Don't trust the conversation buffer.
272
+
273
+ This applies to: design rationale, working-style corrections,
274
+ surprising findings, anti-patterns discovered, anything that
275
+ took more than a few turns to figure out.
276
+ -->
277
+
278
+ [Add observations as they emerge. This section grows the most
279
+ of any — it's the running notebook.]
280
+
281
+ ---
282
+
283
+ **Last updated**: {{TODAY}}
284
+
285
+ <!--
286
+ ==================================================================
287
+ End of journey-log scaffold.
288
+
289
+ When you've filled in enough that the comments feel like noise,
290
+ delete them. The file is yours.
291
+ ==================================================================
292
+ -->
@@ -1,47 +1,47 @@
1
- # Granular Memory Archive — Index
2
-
3
- This file lists every per-fact memory file in `context/memory/`. **NOT auto-loaded at session start** — read this index when looking up whether a topic has a saved memory.
4
-
5
- ## Purpose vs. the bounded scratchpad
6
-
7
- | File | Purpose | Loaded at startup? | Cap |
8
- |---|---|---|---|
9
- | `../MEMORY.md` | Hot working state (current threads, environment, pending decisions) | Yes | 2,500 chars |
10
- | `../USER.md` | User profile and preferences | Yes | 1,375 chars |
11
- | `./<type>_<slug>.md` (this dir) | Durable typed facts with reasoning | No | none |
12
-
13
- ## When to write where
14
-
15
- - **Durable typed fact** (user role, project decision with rationale, feedback rule, external system pointer) → new file here, plus one-line entry below.
16
- - **Working state** (current threads, today's environment notes, open decisions) → `../MEMORY.md`.
17
- - If a fact graduates from working state to durable archive, MOVE it (don't duplicate).
18
-
19
- ## Frontmatter format for granular files
20
-
21
- ````markdown
22
- ---
23
- name: short-kebab-case-slug
24
- description: one-line summary used for retrieval
25
- metadata:
26
- type: user | feedback | project | reference
27
- ---
28
-
29
- [Body. For feedback / project entries, lead with the rule or fact, then:
30
- **Why:** the reason / context / past incident
31
- **How to apply:** when this guidance kicks in, edge cases to watch]
32
-
33
- Link related entries with [[their-slug]].
34
- ````
35
-
36
- ## Type taxonomy
37
-
38
- - `user_*.md` — facts about the user (role, goals, knowledge, responsibilities).
39
- - `feedback_*.md` — corrections or confirmations about how to approach work. Always include Why + How to apply.
40
- - `project_*.md` — facts about ongoing initiatives or decisions specific to a project. Time-bound.
41
- - `reference_*.md` — pointers to external systems (Linear, Slack, dashboards, repos).
42
-
43
- ## Files
44
-
45
- <!-- (No granular files yet. As you accumulate, add one line per file:
46
- - [type] [Title](filename.md) — short hook
47
- -->
1
+ # Granular Memory Archive — Index
2
+
3
+ This file lists every per-fact memory file in `context/memory/`. **NOT auto-loaded at session start** — read this index when looking up whether a topic has a saved memory.
4
+
5
+ ## Purpose vs. the bounded scratchpad
6
+
7
+ | File | Purpose | Loaded at startup? | Cap |
8
+ |---|---|---|---|
9
+ | `../MEMORY.md` | Hot working state (current threads, environment, pending decisions) | Yes | 2,500 chars |
10
+ | `../USER.md` | User profile and preferences | Yes | 1,375 chars |
11
+ | `./<type>_<slug>.md` (this dir) | Durable typed facts with reasoning | No | none |
12
+
13
+ ## When to write where
14
+
15
+ - **Durable typed fact** (user role, project decision with rationale, feedback rule, external system pointer) → new file here, plus one-line entry below.
16
+ - **Working state** (current threads, today's environment notes, open decisions) → `../MEMORY.md`.
17
+ - If a fact graduates from working state to durable archive, MOVE it (don't duplicate).
18
+
19
+ ## Frontmatter format for granular files
20
+
21
+ ````markdown
22
+ ---
23
+ name: short-kebab-case-slug
24
+ description: one-line summary used for retrieval
25
+ metadata:
26
+ type: user | feedback | project | reference
27
+ ---
28
+
29
+ [Body. For feedback / project entries, lead with the rule or fact, then:
30
+ **Why:** the reason / context / past incident
31
+ **How to apply:** when this guidance kicks in, edge cases to watch]
32
+
33
+ Link related entries with [[their-slug]].
34
+ ````
35
+
36
+ ## Type taxonomy
37
+
38
+ - `user_*.md` — facts about the user (role, goals, knowledge, responsibilities).
39
+ - `feedback_*.md` — corrections or confirmations about how to approach work. Always include Why + How to apply.
40
+ - `project_*.md` — facts about ongoing initiatives or decisions specific to a project. Time-bound.
41
+ - `reference_*.md` — pointers to external systems (Linear, Slack, dashboards, repos).
42
+
43
+ ## Files
44
+
45
+ <!-- (No granular files yet. As you accumulate, add one line per file:
46
+ - [type] [Title](filename.md) — short hook
47
+ -->