| name | llm-wiki |
| description | Create and manage LLM-compiled knowledge bases in Obsidian. You collect sources, Claude compiles them into an interlinked wiki. Every question makes it smarter. Use when asked to create a knowledge base, set up a research vault, or install llm-wiki. |
Entry point for the llm-wiki toolkit. Two modes:
- Install mode โ First time running from the cloned repo. Copies companion skills and slash commands to
~/.claude/, then falls through to create mode.
- Create mode โ Scaffolds a new Karpathy-style LLM knowledge base as an Obsidian vault, seeds it with real content, and hands the user a working wiki they can open immediately.
The Karpathy pattern: raw/ is append-only source archive, wiki/ is LLM-owned flat knowledge base with dense wikilinks, outputs/ is ephemeral scratch. Claude compiles sources into interlinked articles. Every question makes the wiki smarter.
<quick_start>
- Check if companion skills are installed (
~/.claude/skills/compile-vault/ exists)
- If not installed: detect repo, copy skills + commands, confirm
- Ask 3 setup questions: topic, location, domains
- Create directory structure, copy Obsidian settings, write configs
- Create indexes, domain pages, Bases views
- Offer to seed with first source
- Process whatever the user provides
</quick_start>
<essential_principles>
The Karpathy pattern:
raw/ is append-only. Sources never modified after ingestion (except processed: true flag).
wiki/ is LLM-owned. Flat directory, no subfolders. Claude writes and maintains everything.
outputs/ is ephemeral. Good outputs get promoted back into the wiki.
- Dense
[[wikilinks]] are essential โ graph view is core to the experience.
- No tags. Connections via wikilinks and
related frontmatter field only.
- Obsidian Bases for filtered views (by type, domain, status).
Frontmatter schema (every wiki article):
---
title: "Article Title"
type: concept | paper | tool | person | company | technique | framework
domains:
- domain-name
status: stub | draft | evergreen
created: YYYY-MM-DD
updated: YYYY-MM-DD
sources:
- "[[raw/articles/source.md]]"
related:
- "[[Related Article]]"
---
Three ingestion paths:
- Obsidian Web Clipper โ saves directly to
raw/articles/
- Paste a URL โ Claude fetches via WebFetch, saves to
raw/articles/
- Paste a screenshot โ Claude reads the image, saves content to
raw/articles/
Activity log:
wiki/log.md is an append-only chronological record of every ingest, query, and lint pass. Each entry follows the format ## [YYYY-MM-DD] type | Title. Created during vault setup and appended by compile-vault, query-vault, and lint-vault on every run.
Obsidian settings inheritance:
If the user has an existing Obsidian vault, offer to copy settings from it for a consistent experience.
Files to copy: appearance.json, core-plugins.json, hotkeys.json, community-plugins.json, plugins/ directory.
Files to skip: workspace.json, copilot-index-*, graph.json, bookmarks.json, daily-notes.json.
If no existing vault, create minimal .obsidian/ with Bases enabled.
</essential_principles>
**Phase 1: Install (first-time only)**
Check if ~/.claude/skills/compile-vault/SKILL.md exists. If it does, skip to Phase 2.
If not installed, determine where the repo files are. Two scenarios:
Scenario A โ Local repo: Check for skills/ and templates/ subdirectories in the current working directory (or the directory where this SKILL.md lives). If found, copy from there.
Scenario B โ GitHub URL: If the user provided a GitHub URL (e.g. https://github.com/CnxLuc/llm-wiki), clone it to a temp directory first, then copy from there.
git clone https://github.com/CnxLuc/llm-wiki /tmp/llm-wiki
REPO_DIR="."
cp -R "$REPO_DIR/skills/compile-vault" ~/.claude/skills/
cp -R "$REPO_DIR/skills/lint-vault" ~/.claude/skills/
cp -R "$REPO_DIR/skills/query-vault" ~/.claude/skills/
mkdir -p ~/.claude/skills/llm-wiki
cp "$REPO_DIR/SKILL.md" ~/.claude/skills/llm-wiki/
cp -R "$REPO_DIR/templates" ~/.claude/skills/llm-wiki/
mkdir -p ~/.claude/commands
cp "$REPO_DIR/commands/compile-vault.md" ~/.claude/commands/
cp "$REPO_DIR/commands/lint-vault.md" ~/.claude/commands/
cp "$REPO_DIR/commands/query-vault.md" ~/.claude/commands/
Confirm: "Installed 4 skills and 3 commands. Ready to create your first knowledge base."
If neither local repo nor GitHub URL is available, tell the user:
"Send me the llm-wiki GitHub link, or clone it locally and point me to it."
Fall through to Phase 2.
Phase 2: Gather requirements
Ask these 3 questions (one message, not three separate prompts):
- "What topic is this knowledge base for?"
- "Where should I create it?" โ suggest
~/Documents/ or the user's typical vault location as default
- "What domain categories matter for this topic?" โ provide concrete examples based on the topic. For example:
- AI: agents, models, applied, people, companies
- Crypto: protocols, defi, infrastructure, people, companies
- Biology: genomics, neuroscience, therapeutics, people, companies
- History: periods, events, figures, geography, culture
Wait for the user's answers before proceeding.
Phase 3: Create directory structure
{vault}/
โโโ raw/
โ โโโ articles/
โ โโโ papers/
โ โโโ repos/
โ โโโ images/
โ โโโ datasets/
โโโ wiki/
โโโ outputs/
โ โโโ research/
โ โโโ slides/
โ โโโ visuals/
โโโ docs/
โโโ specs/
Create all directories and add .gitkeep in each leaf directory.
After creating wiki/_index.md and all domain indexes, also create wiki/log.md:
---
title: "Log"
---
# Log
Chronological record of all wiki activity. Append-only.
Phase 4: Copy Obsidian settings
If the user has an existing Obsidian vault, copy settings from it to {vault}/.obsidian/:
appearance.json (theme, fonts, accent color)
core-plugins.json (enabled core plugins)
hotkeys.json (keyboard shortcuts)
community-plugins.json (community plugin list)
plugins/ directory (community plugin configs)
Skip: workspace.json, copilot-index-*, graph.json, bookmarks.json, daily-notes.json
After copying, read core-plugins.json and ensure "bases": true is present. If not, add it.
If the source vault is not found at the expected path, check these fallback locations:
~/Library/Mobile Documents/iCloud~md~obsidian/Documents/ (iCloud vaults)
~/Documents/ (local vaults)
If still not found, ask the user where their main Obsidian vault is.
Phase 5: Write CLAUDE.md
Use template from templates/claude-md.md in the repo directory. Replace:
{{TOPIC}} with the knowledge base topic
If the template is not available (running post-install, not from repo), write CLAUDE.md with this structure:
# {TOPIC} Vault
Personal knowledge base for {TOPIC} research. LLM-compiled wiki following Karpathy's approach.
## Structure
- `raw/` โ Source archive (append-only)
- `wiki/` โ LLM-owned knowledge base (flat .md files with typed frontmatter)
- `outputs/` โ Q&A scratch pad (good stuff gets filed back into wiki)
- `docs/conventions.md` โ **Full vault conventions. Read this before doing anything.**
## Quick Reference
- Frontmatter schema, article template, style guide: see `docs/conventions.md`
- Design spec: see `docs/specs/`
## Toolkit
- `/compile-vault` โ Process unprocessed raw sources into wiki articles and update indexes
- `/lint-vault` โ Run health checks: find stubs, orphans, redlinks, weak links, index gaps
- `/query-vault [question]` โ Research questions against the wiki, save outputs, file back into wiki
## Session Startup
1. Check `raw/` for unprocessed sources (missing `processed: true`)
2. Report wiki article count and any stubs/redlinks
3. Ask if there's anything to ingest or research
Phase 6: Write docs/conventions.md
Use template from templates/conventions-md.md in the repo directory. Replace:
If the template is not available, write conventions.md following the schema documented in essential_principles above, covering: directory structure, frontmatter schema, allowed values, article template, style guide, compilation rules, index maintenance, session startup checklist, Q&A output rules, and linting rules.
Phase 7: Create wiki indexes
Create wiki/_index.md:
---
title: "{TOPIC} Index"
type: concept
domains: []
status: draft
created: {TODAY}
updated: {TODAY}
sources: []
related: []
---
Master index for the {TOPIC} knowledge base.
## Domain Indexes
- [[_{domain1}]] โ {Domain1} articles
- [[_{domain2}]] โ {Domain2} articles
...
## All Articles
(empty โ will populate as sources are compiled)
For each domain, create wiki/_{domain}.md:
---
title: "{Domain}"
type: concept
domains:
- {domain}
status: draft
created: {TODAY}
updated: {TODAY}
sources: []
related:
- "[[_index]]"
- "[[_{other-domain}]]"
...
---
Overview of {domain} in {TOPIC}.
## Key Articles
(empty โ will populate as sources are compiled)
Phase 8: Create Obsidian Bases views
Use the obsidian-bases skill to create these .base files in wiki/:
- Articles by Type โ group by
type property, columns: title, type, domains, status, updated
- Articles by Domain โ columns: title, domains, type, status, updated
- Stubs โ filter to
status == stub, columns: title, type, domains, created
- Recently Updated โ sort by
updated descending, columns: title, type, domains, status, updated
Phase 9: Offer to seed
Present this message:
"Your knowledge base is ready. Let's seed it with your first source.
Got something specific? Paste a URL, screenshot, or topic for that chunky paper or article you've been meaning to get through. Claude will read it, break it down into wiki articles, and you'll have a structured summary you can build on.
Want inspiration? Pick a topic to explore:
- Personal AI agents โ how people are building their own assistants
- The AI scaling debate โ where are we on the path to AGI?
- Prediction markets โ how markets are becoming the new information layer"
Adjust the inspiration topics to match the user's chosen knowledge base topic. Make them specific and interesting, not generic.
Wait for the user to respond.
Phase 10: Process the seed content
Based on what the user provides:
-
URL: Use WebFetch to retrieve the content. Save the raw content to raw/articles/{slugified-title}.md with frontmatter including source_url, clipped_date, and processed: false. Then compile it: extract concepts, create wiki articles with proper frontmatter and dense wikilinks, update all indexes.
-
Screenshot/image: Read the image content. Save a transcription to raw/articles/{descriptive-name}.md with frontmatter including source_type: screenshot, clipped_date, and processed: false. Then compile it the same way.
-
Topic to research: Use WebSearch and WebFetch to gather 2-3 high-quality sources on the topic. Save each to raw/articles/. Then compile all of them into wiki articles.
After compilation, mark all raw sources processed: true and update all indexes.
Phase 11: Final message
"Open your vault in Obsidian (File > Open Vault > Open folder as vault, select {vault-path}).
Check the graph view โ your first nodes are there. Here are your commands:
/compile-vault โ process new sources into wiki articles
/lint-vault โ find stubs, orphans, and weak connections
/query-vault [question] โ research anything against your wiki
Drop more sources into raw/articles/ anytime โ via Obsidian Web Clipper, pasting URLs here, or screenshots."
<anti_patterns>
- Don't let users manually edit wiki/ articles. The wiki is Claude's domain. If the user wants to correct something, they should tell Claude and Claude updates the article. This keeps frontmatter consistent and wikilinks intact. Explain this gently: "wiki/ is LLM-maintained โ tell me what to change and I'll update it with proper links and frontmatter."
- Don't create empty knowledge bases without offering to seed them. An empty vault with no articles is discouraging. Always offer to seed with a first source โ the user should see nodes in their graph view on first open.
- Don't skip copying Obsidian settings. Consistent theme, hotkeys, and plugins across vaults matters for the experience. If the source vault can't be found, ask โ don't just skip.
- Don't overwhelm with questions. Three setup questions max (topic, location, domains), then build. Get to a working vault fast.
- Don't create sample/placeholder articles. Only real content from real sources. Seed with actual material the user cares about.
- Don't use tags anywhere. All connections are via
[[wikilinks]] and the related frontmatter field. Tags fragment the graph.
</anti_patterns>
<success_criteria>
Install complete when:
~/.claude/skills/compile-vault/SKILL.md exists
~/.claude/skills/lint-vault/SKILL.md exists
~/.claude/skills/query-vault/SKILL.md exists
~/.claude/commands/compile-vault.md exists
~/.claude/commands/lint-vault.md exists
~/.claude/commands/query-vault.md exists
Knowledge base complete when:
- All directories exist with
.gitkeep files
.obsidian/ config copied from main vault with bases: true enabled
CLAUDE.md exists at vault root, points to docs/conventions.md, lists toolkit commands
docs/conventions.md has complete frontmatter schema and compilation rules
wiki/_index.md and all domain indexes exist with proper frontmatter
- Obsidian Bases views created (by type, by domain, stubs, recently updated)
- At least one real source processed into wiki articles (from seeding)
- User can open the vault in Obsidian and see nodes in graph view
</success_criteria>