From llm-wiki
Use when the user wants to initialize, ingest, query, lint, or maintain a durable interlinked Markdown LLM wiki or personal knowledge base. Inspired by Andrej Karpathy's llm-wiki methodology.
How this skill is triggered — by the user, by Claude, or both
Slash command
/llm-wiki:llm-wikiThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Build and maintain a persistent, compounding personal knowledge base as interlinked Markdown files.
Build and maintain a persistent, compounding personal knowledge base as interlinked Markdown files. Inspired by Andrej Karpathy's LLM Wiki pattern and the LLM Wiki Architecture paradigm.
Knowledge is compiled once and kept fresh — not re-derived from scratch on every query.
Traditional RAG scans from scratch on every question, with nothing persisting between queries. LLM Wiki's core insight: let the LLM handle all the bookkeeping (updating cross-references, keeping summaries current, marking contradictions), and humans only need to do three things: curate sources, guide analysis, and ask good questions.
Fundamental difference from RAG:
Use this skill when the user:
LLM Wiki is not software — it's a working paradigm. Three-layer separation achieves concern separation:
┌─────────────────────────────────────────────────────────────┐
│ Layer 3: Convention Layer (SCHEMA.md) │
│ Tells LLM how to maintain the wiki — configured once, │
│ internalized by LLM for all future sessions │
├─────────────────────────────────────────────────────────────┤
│ Layer 2: Persistent Knowledge Layer │
│ (entities/ concepts/ synthesis/ comparisons/ queries/) │
│ LLM-owned and maintained — primary workspace │
├─────────────────────────────────────────────────────────────┤
│ Layer 1: Raw Source Layer (raw/) │
│ Immutable ground truth — LLM read-only, always retained │
│ for re-ingestion │
└─────────────────────────────────────────────────────────────┘
Three-layer responsibilities:
WIKI_PATH env var > remembered path in ~/.llm-wiki > current working directory (when it already contains SCHEMA.md, index.md, and log.md) > ~/wiki.raw/.index.md) and history (log.md).confidence, contested, contradictions, and explicit open questions instead of smoothing over weak evidence.scripts/init-wiki.sh), but ingest/query/lint remain mostly agent-driven until scale proves more tooling is needed.wiki/
|-- SCHEMA.md # Domain, conventions, page thresholds, tag taxonomy
|-- index.md # Catalog of synthesized pages with one-line summaries
|-- log.md # Append-only action history
|-- raw/ # Immutable captured sources
| |-- articles/
| |-- papers/
| |-- transcripts/
| |-- notes/
| `-- assets/
|-- entities/ # People, organizations, products, projects, tools
|-- concepts/ # Concepts, methods, principles, reusable mental models
|-- comparisons/ # Side-by-side analysis and tradeoff records
|-- queries/ # Filed answers worth preserving
|-- synthesis/ # Higher-level maps, playbooks, and multi-source summaries
`-- _archive/ # Superseded pages kept for traceability
If an existing wiki uses a compatible but different structure, follow SCHEMA.md rather than forcing this layout. Only migrate structure when the user asks.
Before any ingest, query, lint, or edit workflow, resolve the wiki root in this order:
WIKI_PATH is set, use it.~/.llm-wiki exists, use the path stored there.SCHEMA.md, index.md, and log.md, treat the current working directory as the wiki root.~/wiki.Shell pattern for steps 2-5:
if [ -n "${WIKI_PATH:-}" ]; then
WIKI="$WIKI_PATH"
elif [ -f "$HOME/.llm-wiki" ]; then
WIKI="$(cat "$HOME/.llm-wiki")"
elif [ -f "SCHEMA.md" ] && [ -f "index.md" ] && [ -f "log.md" ]; then
WIKI="$PWD"
else
WIKI="$HOME/wiki"
fi
If the resolved root does not exist yet and the user is asking to ingest into a wiki, initialize it first. If the target directory exists but is non-empty and does not already look like a wiki, stop and ask before bootstrapping into it.
Before ingesting, querying, or editing an existing wiki:
SCHEMA.md if present.index.md if present.log.md if present.This prevents duplicate pages, broken conventions, and repeated work.
Useful shell patterns:
rg -n 'keyword|related term' "$WIKI" -g '*.md'
find "$WIKI" -maxdepth 3 -name '*.md' | sort
tail -80 "$WIKI/log.md"
When creating a new wiki:
Resolve the target root using the rules above.
If that root already contains SCHEMA.md, index.md, and log.md, treat it as already initialized; do not reinitialize unless the user explicitly asks.
If the target directory exists but is non-empty and does not already look like a wiki, stop and ask before modifying it.
Determine the domain. If the user has not specified one, use a broad personal knowledge base domain and note that it is easy to refine later.
Run the bootstrap helper (SKILL_DIR is injected by the agent runtime and points to the skill's directory):
bash "${SKILL_DIR}/scripts/init-wiki.sh" "$WIKI" "$DOMAIN"
Remember the chosen root for future sessions:
printf '%s\n' "$WIKI" > "$HOME/.llm-wiki"
Report the created files and suggest the first high-value sources to ingest.
scripts/init-wiki.sh is worth keeping because initialization is deterministic and repetitive:
SKILL_DIR means the directory containing this SKILL.md; use it when invoking bundled helpers.SCHEMA.md, index.md, and log.mdDo not add more scripts just because a workflow exists in prose. Add them only when a step becomes repetitive enough that the agent would otherwise keep re-implementing shell glue.
SCHEMA.md# Wiki Schema
## Domain
Personal knowledge base for research, projects, decisions, reusable workflows, and long-lived learning.
## Conventions
- File names use lowercase kebab-case.
- Every synthesized page starts with YAML frontmatter.
- Use `[[wikilinks]]` for internal links.
- New or updated pages should have at least two meaningful outbound links when possible.
- Add every synthesized page to `index.md`.
- Append every ingest, query filing, lint, archive, and schema change to `log.md`.
- Use provenance markers for specific claims when a page synthesizes multiple sources: `^[raw/articles/source-name.md]`.
## Frontmatter
```yaml
---
title: Page Title
created: YYYY-MM-DD
updated: YYYY-MM-DD
type: entity | concept | comparison | query | synthesis
tags: []
sources: []
confidence: high | medium | low
contested: false
contradictions: []
---
```
## Tag Taxonomy
Start with a small taxonomy and extend deliberately:
- knowledge-management
- ai
- engineering
- finance
- research
- writing
- workflow
- decision
- project
- person
- organization
- tool
- source
New tags must be added here before use.
## Page Thresholds
- Create a page when a concept/entity is central to a source, appears across multiple sources, or is likely to be reused.
- Add to an existing page for passing mentions or incremental facts.
- Do not create pages for trivia, one-off context, or material outside the wiki domain.
- Split pages around 200 lines when they mix distinct topics.
- Archive pages when superseded; do not silently delete knowledge.
## Update Policy
- Prefer newer primary sources over older secondary sources, but keep both when the conflict matters.
- Mark unresolved conflicts with `contested: true` and `contradictions`.
- Never overwrite a prior conclusion without preserving why it changed.
When the user provides a URL, PDF, local file, pasted text, transcript, or note:
Capture the raw source under raw/ with a descriptive kebab-case file name.
Add raw source frontmatter:
---
title: Source Title
source_url: https://example.com
ingested: YYYY-MM-DD
sha256: <body-hash>
source_type: article | paper | transcript | note | file
---
Compute sha256 over the body after frontmatter. On re-ingest, compare hashes and report unchanged or drifted content.
Search existing pages and index.md for relevant entities and concepts.
Update existing pages before creating new ones.
Create new pages only when they meet SCHEMA.md thresholds.
Cross-link pages with [[wikilinks]]; add backlinks where useful.
Use only tags from SCHEMA.md, adding taxonomy entries first when needed.
Update index.md once after page edits.
Append a log.md entry listing files created and updated.
For bulk ingest, read all sources first, identify shared entities/concepts, then update pages in one batch to avoid duplicate or inconsistent pages.
When answering from the wiki:
SCHEMA.md, index.md, and recent log.md.[[wikilinks]].queries/, comparisons/, or synthesis/ only if it would be expensive to reconstruct later.Do not file trivial lookups. Durable pages should encode reusable synthesis, decisions, or hard-won research.
When auditing the wiki, check:
[[wikilinks]].index.md.SCHEMA.md.confidence: low, contested: true, or non-empty contradictions.updated date is old.log.md size; rotate to log-YYYY.md when it grows beyond about 500 entries.Report findings by severity: broken navigation first, then schema/index defects, source integrity, contested/low-confidence knowledge, stale content, and style issues.
---
title: Entity Name
created: YYYY-MM-DD
updated: YYYY-MM-DD
type: entity
tags: [organization]
sources: [raw/articles/source.md]
confidence: medium
contested: false
contradictions: []
---
# Entity Name
## Summary
What this entity is and why it matters.
## Key Facts
- Fact with source/provenance.
## Relationships
- Related to [[other-page]] because ...
## Open Questions
- Question that still needs evidence.
---
title: Concept Name
created: YYYY-MM-DD
updated: YYYY-MM-DD
type: concept
tags: [research]
sources: []
confidence: medium
contested: false
contradictions: []
---
# Concept Name
## Definition
Short explanation.
## Why It Matters
Reusable insight.
## Evidence
- Source-backed details.
## Related
- [[related-concept]]
---
title: Synthesis Title
created: YYYY-MM-DD
updated: YYYY-MM-DD
type: synthesis
tags: [workflow]
sources: []
confidence: medium
contested: false
contradictions: []
---
# Synthesis Title
## Claim
The distilled conclusion.
## Supporting Evidence
| Evidence | Source | Weight |
| --- | --- | --- |
| ... | [[source-or-page]] | high/medium/low |
## Implications
- What should change because of this.
## Watch Items
- What evidence could overturn the conclusion.
Lint is the most overlooked but most critical operation for long-term quality. Run weekly or after accumulating enough new sources. A complete Lint checks:
[[X]] wikilinkReal scenario for Lint discovering contradictions:
Your wiki has a concept page about "Transformer attention mechanism computational complexity." An early 2022 paper says it's O(n²), while a recently ingested 2025 paper introduces a new linear attention variant with O(n) complexity. Lint discovers this contradiction, adds a warning to the concept page with both source citations, and suggests creating a "linear attention" sub-concept page.
Lint's essence is giving the knowledge base self-healing capability: contradictions don't quietly accumulate, stale claims don't persist long-term, and wiki quality improves over time rather than degrading.
index.md was checked.index.md and log.md drift from the filesystem.Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Applies a firm's KYC/AML rules grid to parsed onboarding records: assigns risk rating, checks required documents, outputs rule outcomes with citations, and routes for escalation.
Generates daily or weekly digests of activity from connected sources (chat, email, docs, tasks, CRM), highlighting action items, decisions, mentions, and project updates.
npx claudepluginhub yugasun/llm-wiki-skills --plugin llm-wiki-skills