Skip to content
Documentation
Skill

/karpathy-llm-wiki

Use when building or maintaining a personal LLM-powered knowledge base. Triggers: ingesting sources into a wiki, querying wiki knowledge, linting wiki quality, 'add to wiki', 'what do I know about', or any mention of 'LLM wiki' or 'Karpathy wiki'.

From plugin
karpathy-llm-wiki
1.8k1 skill
Install
$ npx -y skills add Astro-Han/karpathy-llm-wiki --skill karpathy-llm-wiki --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/karpathy-llm-wiki

Context preview

The summary Claude sees to decide when to auto-load this skill.

Use when building or maintaining a personal LLM-powered knowledge base. Triggers: ingesting sources into a wiki, querying wiki knowledge, linting wiki quality, 'add to wiki', 'what do I know about', or any mention of 'LLM wiki' or 'Karpathy wiki'.

SKILL.md

karpathy-llm-wiki.SKILL.md
name: karpathy-llm-wiki
description: "Use when building or maintaining a personal LLM-powered knowledge base. Triggers: ingesting sources into a wiki, querying wiki knowledge, linting wiki quality, 'add to wiki', 'what do I know about', or any mention of 'LLM wiki' or 'Karpathy wiki'."

Karpathy LLM Wiki

Build and maintain a personal knowledge base using LLMs. You manage two directories: `raw/` (immutable source material) and `wiki/` (compiled knowledge articles). Sources go into raw/, you compile them into wiki articles, and the wiki compounds over time.

Core ideas from Karpathy:

  • "The LLM writes and maintains the wiki; the human reads and asks questions."
  • "The wiki is a persistent, compounding artifact."

Architecture

Three layers, all under the user's project root:

**raw/** — Immutable source material. You read, never modify. Organized by topic subdirectories (e.g., `raw/machine-learning/`).

**wiki/** — Compiled knowledge articles. You have full ownership. Organized by topic subdirectories, one level only: `wiki/<topic>/<article>.md`. Contains two special files:

  • `wiki/index.md` — Global index. One row per article, grouped by topic, with link + summary + Updated date.
  • `wiki/log.md` — Append-only operation log.

**SKILL.md** (this file) — Schema layer. Defines structure and workflow rules.

Templates live in `references/` relative to this file. Read them when you need the exact format for raw files, articles, archive pages, or the index.

Initialization

Triggers only on the first Ingest. Check whether `raw/` and `wiki/` exist. Create only what is missing; never overwrite existing files:

  • `raw/` directory (with `.gitkeep`)
  • `wiki/` directory (with `.gitkeep`)
  • `wiki/index.md` — heading `# Knowledge Base Index`, empty body
  • `wiki/log.md` — heading `# Wiki Log`, empty body

If Query or Lint cannot find the wiki structure, tell the user: "Run an ingest first to initialize the wiki." Do not auto-create.

The Grounding Invariant

Every load-bearing fact in wiki/ — numbers, dates, direct quotes — exists verbatim in the raw/ files linked by that article's Raw field. Compile *establishes* this invariant (locate before you write); lint *verifies* it (`scripts/check_evidence.py` greps the high-signal literals — suffixed or large numbers, decimals, ISO dates, longer quotes — in the linked raws; the compile-time locate-before-write rule covers the rest). Because raw/ is immutable, a verified article stays verified; the script re-checks the whole wiki in seconds, so there is no incremental state to maintain.

---

Ingest

Fetch a source into raw/, then compile it into wiki/ — unless the source adds nothing new. Always fetch; whether to compile depends on the triage below.

Fetch (raw/)

1. Get the source content using whatever web or file tools your environment provides. If nothing can reach the source, ask the user to paste it directly.

2. Pick a topic directory. Check existing `raw/` subdirectories first; reuse one if the topic is close enough. Create a new subdirectory only for genuinely distinct topics.

3. Save as `raw/<topic>/YYYY-MM-DD-descriptive-slug.md`.

  • Slug from source title, kebab-case, max 60 characters.
  • Published date unknown → omit the date prefix from the file name (e.g., `descriptive-slug.md`). The metadata Published field still appears; set it to `Unknown`.
  • If a file with the same name already exists, append a numeric suffix (e.g., `descriptive-slug-2.md`).
  • Include metadata header: source URL, collected date, published date.
  • Preserve original text. Clean formatting noise. Do not rewrite opinions.

See `references/raw-template.md` for the exact format.

Triage

After saving the raw file and before editing wiki/, search wiki/ with the source's key entities and synonyms, then state the disposition:

  • **New** — creates one or more new articles.
  • **Update** — merges into existing article(s).
  • **Disputed** — contradicts existing content; may combine with New or Update (see Compile for conflict annotation).
  • **No material** — adds no knowledge beyond what the wiki already holds. Keep the raw file, log it (see Post-Ingest), and stop. Do not force an article out of a thin source.

New, Update, and Disputed may be combined. No material is exclusive.

Compile (wiki/)

Determine where the new content belongs:

  • **Same core thesis as existing article** → Merge into that article. Add the new source to Sources/Raw. Update affected sections.
  • **New concept** → Create a new article in the most relevant topic directory. Name the file after the concept, not the raw file.
  • **Spans multiple topics** → Place in the most relevant directory. Add See Also cross-references to related articles elsewhere.

These are not mutually exclusive. A single source may warrant merging into one article while also creating a separate article for a distinct concept it introduces. In all cases, check for factual conflicts: if the new source contradicts existing content, mark the contested claims with a **Status: Disputed** block (see `references/article-template.md`). When the conflicting content lives in separate articles, mark both and cross-link them.

**Source fidelity.** Every number, date, and direct quote must be located in the raw file (grep or read) *before* it is written; write the value exactly as found — if the source says 42K, write 42K, not 42,000. Derived values (sums, deltas, counts you computed) must show their components so each component is findable in raw. If you cannot locate a value, do not write its exact form; drop it or state it without precision.

See `references/article-template.md` for article format. Key points:

  • Sources field: author, organization, or publication name + date, semicolon-separated.
  • Raw field: markdown links to raw/ files, semicolon-separated.
  • Relative paths from `wiki/<topic>/` use `../../raw/<topic>/<file>.md` (two levels up to project root).

Cascade Updates

After the primary art

Read more
Ships withkarpathy-llm-wiki

A reusable skill for building Karpathy-style LLM wikis with Claude Code, Cursor, Codex, and other Agent Skills tools. karpathy-llm-wiki packages Karpathy's LLM Wiki idea into one installable Agent Skills skill.

Get the whole plugin
Stats
1,832
Stars
213
Forks
Active
Maintenance
Python
Language
MIT
License
17d ago
Last commit
4mo ago
Created

Repo: Astro-Han/karpathy-llm-wiki