compile-knowledge
The team runs on the karpathy method: knowledge is kept as many small,
interlinked markdown files, compiled over time, and surfaced through an index —
not as one giant doc, a chat log, or a one-off file that rots. Two production
stores already work this way; this skill makes compiling into them consistent.
The two stores — pick the right one
- Agent memory (per-agent, personal + operational): your
.claude/.../memory/ folder with MEMORY.md as the index. For things only
you need: user preferences, feedback you were given, your project state.
Governed by the memory rules already in your system prompt — follow them.
- Team wiki (shared domain knowledge):
wiki/ with an index
(index.md). For knowledge the whole fleet benefits from: competitor/market
intel, Anthropic/ecosystem state, durable reference facts, research findings.
Rule of thumb: "only I act on this" → memory. "Anyone on the team might need
this" → wiki. Cross-link between them with [[slug]] when they relate.
Before you write — the hygiene gate
Compile ONLY a durable, non-obvious fact. Skip and move on if it is:
- routine / derivable from the repo, git history, or existing docs,
- true only for this one conversation,
- already covered by an existing file (→ UPDATE that file instead, don't duplicate).
Most tasks (a deploy, a restart, a one-line fix) produce nothing durable. That is
fine — do not manufacture a memory to "have written something." Filler is worse
than nothing; it pollutes recall.
The procedure
- Search first. Look for an existing file on this topic (grep the store +
skim the index). If one exists, edit it — never create a near-duplicate.
- Atomic. One fact / one topic per file. If you're tempted to add a second
unrelated fact, that's a second file.
- Name it. kebab-case slug with a type prefix:
feedback_…, project_…, reference_…, user_… (memory) or a clear topic
slug (wiki). The slug is the link target.
- Frontmatter.
name (= the slug), description (ONE line — this is what
gets matched during recall, make it specific), and a type/category.
- Body. State the fact plainly. Link related entries with
[[slug]] —
liberally; a link to a file that doesn't exist yet is a fine TODO marker. For
feedback/project, follow with Why: and How to apply: lines.
- Index. Add or update a ONE-LINE pointer in the index
(
MEMORY.md for memory; wiki/index.md for the wiki):
- [Title](slug.md) — hook. Keep it under ~200 chars; detail lives in the
file, never in the index. If the wiki index.md doesn't exist yet, create
it (one line per existing wiki page) so the store stays discoverable.
- Hygiene. Delete files that turned out wrong. Convert relative dates to
absolute. If the index is getting long, tighten lines — don't let it bloat.
Anti-patterns
- A wall-of-text doc instead of atomic files.
- Research left as a standalone
DIVE-NNN-notes.md that never gets folded in —
that's working notes, not knowledge. Compile the durable parts into the wiki.
- Duplicating a fact across memory AND wiki — pick one home, cross-link.
- Index entries that restate the whole file.
- Writing filler to satisfy a habit/checklist.
Quick checklist
[ ] durable & non-obvious? [ ] right store? [ ] updated existing vs new?
[ ] atomic + named + frontmatter? [ ] [[links]]? [ ] index line added?
1---2name: compile-knowledge-33description: Compile durable knowledge into the team's interlinked-markdown stores the "karpathy method" way — atomic files, [[wiki-links]], a maintained index. Use after producing research, market/competitor intel, a digest, a learned non-obvious fact, or finishing any knowledge-shaped task, BEFORE you close it. Also when asked to "write this to the wiki", "save this", "update the wiki/memory", "log this finding", "structure this knowledge", or "follow the karpathy method".4---56# compile-knowledge78The team runs on the **karpathy method**: knowledge is kept as many small,9interlinked markdown files, compiled over time, and surfaced through an index —10not as one giant doc, a chat log, or a one-off file that rots. Two production11stores already work this way; this skill makes compiling into them consistent.1213## The two stores — pick the right one1415- **Agent memory** (per-agent, personal + operational): your16 `.claude/.../memory/` folder with `MEMORY.md` as the index. For things only17 *you* need: user preferences, feedback you were given, your project state.18 Governed by the memory rules already in your system prompt — follow them.19- **Team wiki** (shared domain knowledge): `wiki/` with an index20 (`index.md`). For knowledge the *whole fleet* benefits from: competitor/market21 intel, Anthropic/ecosystem state, durable reference facts, research findings.2223Rule of thumb: "only I act on this" → memory. "Anyone on the team might need24this" → wiki. Cross-link between them with [[slug]] when they relate.2526## Before you write — the hygiene gate2728Compile ONLY a durable, non-obvious fact. Skip and move on if it is:29- routine / derivable from the repo, git history, or existing docs,30- true only for this one conversation,31- already covered by an existing file (→ UPDATE that file instead, don't duplicate).3233Most tasks (a deploy, a restart, a one-line fix) produce nothing durable. That is34fine — do not manufacture a memory to "have written something." Filler is worse35than nothing; it pollutes recall.3637## The procedure38391. **Search first.** Look for an existing file on this topic (grep the store +40 skim the index). If one exists, edit it — never create a near-duplicate.412. **Atomic.** One fact / one topic per file. If you're tempted to add a second42 unrelated fact, that's a second file.433. **Name it.** kebab-case slug with a type prefix:44 `feedback_…`, `project_…`, `reference_…`, `user_…` (memory) or a clear topic45 slug (wiki). The slug is the link target.464. **Frontmatter.** `name` (= the slug), `description` (ONE line — this is what47 gets matched during recall, make it specific), and a `type`/category.485. **Body.** State the fact plainly. Link related entries with `[[slug]]` —49 liberally; a link to a file that doesn't exist yet is a fine TODO marker. For50 `feedback`/`project`, follow with **Why:** and **How to apply:** lines.516. **Index.** Add or update a ONE-LINE pointer in the index52 (`MEMORY.md` for memory; `wiki/index.md` for the wiki):53 `- [Title](slug.md) — hook`. Keep it under ~200 chars; detail lives in the54 file, never in the index. **If the wiki `index.md` doesn't exist yet, create55 it** (one line per existing wiki page) so the store stays discoverable.567. **Hygiene.** Delete files that turned out wrong. Convert relative dates to57 absolute. If the index is getting long, tighten lines — don't let it bloat.5859## Anti-patterns6061- A wall-of-text doc instead of atomic files.62- Research left as a standalone `DIVE-NNN-notes.md` that never gets folded in —63 that's working notes, not knowledge. Compile the durable parts into the wiki.64- Duplicating a fact across memory AND wiki — pick one home, cross-link.65- Index entries that restate the whole file.66- Writing filler to satisfy a habit/checklist.6768## Quick checklist6970`[ ] durable & non-obvious? [ ] right store? [ ] updated existing vs new?`71`[ ] atomic + named + frontmatter? [ ] [[links]]? [ ] index line added?`