compile-knowledge
GitHub将知识编译为原子化、相互链接的Markdown文件,采用Karpathy方法。适用于保存非显而易见的事实、研究结果或经验教训,通过维护索引和关联链接构建持久记忆库,避免重复和冗余。
Trigger Scenarios
Install
npx skills add NeverSight/learn-skills.dev --skill compile-knowledge -g -y
SKILL.md
Frontmatter
{
"name": "compile-knowledge",
"description": "Compile durable knowledge into interlinked-markdown stores the \"karpathy method\" way — atomic files, [[wiki-links]], a maintained index. Use after producing research, intel, a digest, a learned non-obvious fact, or finishing any knowledge-shaped task, BEFORE you close it. Also when asked to \"save this\", \"write this to the wiki\", \"update the wiki\/memory\", \"log this finding\", \"structure this knowledge\", or \"follow the karpathy method\"."
}
compile-knowledge
Durable knowledge is worth keeping 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. This skill makes compiling consistent so your agent gets smarter over time instead of relearning the same things.
Where it goes — pick the right store
- Agent memory (default, always available): your
.claude/.../memory/folder withMEMORY.mdas the index. This is the per-agent store and it survives restarts — it's the karpathy "external memory" that keeps you sharp across sessions. Governed by the memory rules already in your system prompt — follow them. For most agents this is the only store you need. - Shared wiki (only if you work as a team): a
wiki/folder in your project with awiki/index.md. For knowledge the whole team benefits from — domain facts, research findings, reference material multiple agents would re-derive. Skip this entirely if you're a solo agent; don't manufacture team ceremony.
Rule of thumb: "only I act on this" → memory. "Anyone on my team might need
this" → shared 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 for memory
(
feedback_…,project_…,reference_…,user_…) or a clear topic slug for the 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 atype/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. Forfeedback/project, follow with Why: and How to apply: lines. - Index. Add or update a ONE-LINE pointer in the index (
MEMORY.mdfor memory;wiki/index.mdfor the wiki):- [Title](slug.md) — hook. Keep it under ~200 chars; detail lives in the file, never the index. If the wikiindex.mddoesn't exist yet, create it 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
notes.mdthat never gets folded in — that's working notes, not knowledge. Compile the durable parts into the store. - 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?
Version History
- e0220ca Current 2026-07-05 21:21


