karpathy-wiki
Build, ingest, query, and lint an LLM wiki using the Karpathy knowledge-graph pattern.
- License 许可
- MIT
- 最近更新
- 2026-11-11
- Stars
- ★ 6
- Forks
- 0
01 前言 Front Matter
- name
- karpathy-wiki
- description
- Build, ingest, query, and lint an LLM wiki using the Karpathy knowledge-graph pattern.
03 SKILL.md 正文
karpathy-wiki Skill
When to use
When working with an LLM wiki (Karpathy pattern) - ingesting sources, querying, linting, or building the knowledge graph.
What it does
Enforces the exact Karpathy LLM Wiki pattern from https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f
Pattern Requirements
Directory Structure (MUST FOLLOW EXACTLY)
llm_wiki/
├── raw/ # Immutable source documents (NEVER edit these)
├── wiki/ # LLM owns this layer entirely - single source of truth
│ ├── index.md # Catalog of ALL pages with curated one-line summaries
│ ├── log.md # Append-only chronological record (format: ## [YYYY-MM-DD] operation | title)
│ ├── overview.md # Living synthesis across all sources
│ ├── sources/ # Source summary pages (kebab-case.md)
│ ├── entities/ # Entity pages (TitleCase.md - people, companies, projects)
│ ├── concepts/ # Concept pages (TitleCase.md - ideas, methods, theories)
│ └── syntheses/ # Saved query answers
└── (no root-level wiki files - ALL must be under wiki/)
Frontmatter (REQUIRED on every page)
---
title: "Page Title"
type: source | entity | concept | synthesis
tags: []
sources: [] # list of source slugs that inform this page
last_updated: YYYY-MM-DD
---
Page Naming
- Sources: kebab-case (e.g.,
json-display-bugs-analysis-report.md) - Entities: TitleCase (e.g.,
PR278.md,OpenAI.md,SamAltman.md) - Concepts: TitleCase (e.g.,
StructuredResponse.md,RAG.md)
Wikilinks
Use [[PageName]] for internal links - these become the knowledge graph edges.
Index Format
# Wiki Index
## Overview
- [Overview](overview.md) — one-line synthesis
## Sources
- [Source Title](sources/slug.md) — CURATED one-line summary (NOT raw email subject)
## Entities
- [Entity Name](entities/EntityName.md) — one-line description
## Concepts
- [Concept Name](concepts/ConceptName.md) — one-line description
## Syntheses
- [Analysis Title](syntheses/slug.md) — what question it answers
Log Format
## [YYYY-MM-DD] operation | title
Key claims: ...
Operations: ingest, query, lint, graph
Ingest Workflow
- Read source document from
raw/ - Read
wiki/index.mdandwiki/overview.mdfor context - Write
wiki/sources/<slug>.mdwith Source Page Format - Update
wiki/index.md— add entry under correct section - Update
wiki/overview.md— revise synthesis - Create/update entity pages for key people/companies/projects
- Create/update concept pages for key ideas/methods
- Flag any contradictions
- Append to
wiki/log.md
Source Page Format
---
title: "Source Title"
type: source
tags: []
date: YYYY-MM-DD
source_file: raw/...
sources: []
last_updated: YYYY-MM-DD
---
## Summary
2–4 sentence summary.
## Key Claims
- Claim 1
- Claim 2
## Key Quotes
> "Quote here" — context
## Connections
- [[EntityName]] — how they relate
- [[ConceptName]] — how it connects
## Contradictions
- Contradicts [[OtherPage]] on: ...
Query Workflow
- Read
wiki/index.mdto find relevant pages - Read those pages
- Synthesize answer with
[[PageName]]citations - Offer to save as
wiki/syntheses/<slug>.md
Lint Workflow
Check for:
- Orphans: pages with no inbound
[[links]] - Broken links:
[[WikiLinks]]to non-existent pages - Contradictions: conflicting claims across pages
- Stale summaries: pages not updated after newer sources
- Missing entities: entities mentioned 3+ times without own page
- Missing concepts: concepts discussed without own page
- Data gaps: questions wiki can't answer
Graph Workflow
- Grep all
[[wikilinks]]→ deterministicEXTRACTEDedges - Infer implicit relationships →
INFERREDedges with confidence - Run Louvain community detection
- Output
graph/graph.json+graph/graph.html
Common Issues to Fix
Dual Structure Problem
If wiki exists in both root AND wiki/ subdirectory:
- Move all wiki content to
wiki/subdirectory only - Delete root-level
index.md,log.md,overview.mdif duplicates exist - Update ingest.py to write to
wiki/subdirectory
Index Quality Problem
If index contains raw email subjects instead of curated summaries:
- Re-ingest with instruction to create proper summaries
- Edit index entries to be content-oriented, not raw titles
Entity/Concept Gap
If few entity/concept pages created:
- Force extraction: prompt must explicitly create entity pages for EVERY person/company/project mentioned
- Force extraction: prompt must explicitly create concept pages for EVERY idea/method/theory
- Track entity/concept ratio - should be roughly 1:1 with sources or higher
04 同仓库更多 Skills
instinct
Use when the user invokes /instinct or /in, or asks to "message Instinct", "ask Instinct", "tell Instinct", "check Instinct", or read replies from the configured peer assistant. iMessage first, WhatsApp Web as fallback.
hr
Compatibility alias for history-resume; produce the same fresh-state, provenance-aware resume briefing.
history-resume
Resume briefing for the current repository branch or worktree using fresh state and admitted history sources.
grok
Alias for the canonical grokbot browser conversation workflow; /grok talks to the Grok bot the same way /dot talks to Dot.
codexa-bench
Compare `codexa` and normal `codex` on a fair split of comparable work by default; use `--strict` for duplicate runs of the exact same task.
frontend-design
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.