$npx -y skills add adityahimaone/hermes-agent-rtk-caveman --skill llm-wikiKarpathy's LLM Wiki — build and maintain a persistent, interlinked markdown knowledge base. Ingest sources, query compiled knowledge, and lint for consistency.
| 1 | # Karpathy's LLM Wiki |
| 2 | |
| 3 | Build and maintain a persistent, compounding knowledge base as interlinked markdown files. |
| 4 | Based on [Andrej Karpathy's LLM Wiki pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f). |
| 5 | |
| 6 | Unlike traditional RAG (which rediscovers knowledge from scratch per query), the wiki |
| 7 | compiles knowledge once and keeps it current. Cross-references are already there. |
| 8 | Contradictions have already been flagged. Synthesis reflects everything ingested. |
| 9 | |
| 10 | **Division of labor:** The human curates sources and directs analysis. The agent |
| 11 | summarizes, cross-references, files, and maintains consistency. |
| 12 | |
| 13 | ## When This Skill Activates |
| 14 | |
| 15 | Use this skill when the user: |
| 16 | - Asks to create, build, or start a wiki or knowledge base |
| 17 | - Asks to ingest, add, or process a source into their wiki |
| 18 | - Asks a question and an existing wiki is present at the configured path |
| 19 | - Asks to lint, audit, or health-check their wiki |
| 20 | - References their wiki, knowledge base, or "notes" in a research context |
| 21 | |
| 22 | ## Wiki Location |
| 23 | |
| 24 | Configured via `skills.config.wiki.path` in `~/.hermes/config.yaml` (prompted |
| 25 | during `hermes config migrate` or `hermes setup`): |
| 26 | |
| 27 | ```yaml |
| 28 | skills: |
| 29 | config: |
| 30 | wiki: |
| 31 | path: ~/wiki |
| 32 | ``` |
| 33 | |
| 34 | Falls back to `~/wiki` default. The resolved path is injected when this |
| 35 | skill loads — check the `[Skill config: ...]` block above for the active value. |
| 36 | |
| 37 | The wiki is just a directory of markdown files — open it in Obsidian, VS Code, or |
| 38 | any editor. No database, no special tooling required. |
| 39 | |
| 40 | ## Architecture: Three Layers |
| 41 | |
| 42 | ``` |
| 43 | wiki/ |
| 44 | ├── SCHEMA.md # Conventions, structure rules, domain config |
| 45 | ├── index.md # Sectioned content catalog with one-line summaries |
| 46 | ├── log.md # Chronological action log (append-only, rotated yearly) |
| 47 | ├── raw/ # Layer 1: Immutable source material |
| 48 | │ ├── articles/ # Web articles, clippings |
| 49 | │ ├── papers/ # PDFs, arxiv papers |
| 50 | │ ├── transcripts/ # Meeting notes, interviews |
| 51 | │ └── assets/ # Images, diagrams referenced by sources |
| 52 | ├── entities/ # Layer 2: Entity pages (people, orgs, products, models) |
| 53 | ├── concepts/ # Layer 2: Concept/topic pages |
| 54 | ├── comparisons/ # Layer 2: Side-by-side analyses |
| 55 | └── queries/ # Layer 2: Filed query results worth keeping |
| 56 | ``` |
| 57 | |
| 58 | **Layer 1 — Raw Sources:** Immutable. The agent reads but never modifies these. |
| 59 | **Layer 2 — The Wiki:** Agent-owned markdown files. Created, updated, and |
| 60 | cross-referenced by the agent. |
| 61 | **Layer 3 — The Schema:** `SCHEMA.md` defines structure, conventions, and tag taxonomy. |
| 62 | |
| 63 | ## Resuming an Existing Wiki (CRITICAL — do this every session) |
| 64 | |
| 65 | When the user has an existing wiki, **always orient yourself before doing anything**: |
| 66 | |
| 67 | ① **Read `SCHEMA.md`** — understand the domain, conventions, and tag taxonomy. |
| 68 | ② **Read `index.md`** — learn what pages exist and their summaries. |
| 69 | ③ **Scan recent `log.md`** — read the last 20-30 entries to understand recent activity. |
| 70 | |
| 71 | ```bash |
| 72 | WIKI="${wiki_path:-$HOME/wiki}" |
| 73 | # Orientation reads at session start |
| 74 | read_file "$WIKI/SCHEMA.md" |
| 75 | read_file "$WIKI/index.md" |
| 76 | read_file "$WIKI/log.md" offset=<last 30 lines> |
| 77 | ``` |
| 78 | |
| 79 | Only after orientation should you ingest, query, or lint. This prevents: |
| 80 | - Creating duplicate pages for entities that already exist |
| 81 | - Missing cross-references to existing content |
| 82 | - Contradicting the schema's conventions |
| 83 | - Repeating work already logged |
| 84 | |
| 85 | For large wikis (100+ pages), also run a quick `search_files` for the topic |
| 86 | at hand before creating anything new. |
| 87 | |
| 88 | ## Initializing a New Wiki |
| 89 | |
| 90 | When the user asks to create or start a wiki: |
| 91 | |
| 92 | 1. Determine the wiki path (from config, env var, or ask the user; default `~/wiki`) |
| 93 | 2. Create the directory structure above |
| 94 | 3. Ask the user what domain the wiki covers — be specific |
| 95 | 4. Write `SCHEMA.md` customized to the domain (see template below) |
| 96 | 5. Write initial `index.md` with sectioned header |
| 97 | 6. Write initial `log.md` with creation entry |
| 98 | 7. Confirm the wiki is ready and suggest first sources to ingest |
| 99 | |
| 100 | ### SCHEMA.md Template |
| 101 | |
| 102 | Adapt to the user's domain. The schema constrains agent behavior and ensures consistency: |
| 103 | |
| 104 | ```markdown |
| 105 | # Wiki Schema |
| 106 | |
| 107 | ## Domain |
| 108 | [What this wiki covers — e.g., "AI/ML research", "personal health", "startup intelligence"] |
| 109 | |
| 110 | ## Conventions |
| 111 | - File names: lowercase, hyphens, no spaces (e.g., `transformer-architecture.md`) |
| 112 | - Every wiki page starts with YAML frontmatter (see be |