staruhub/llm-wiki
Build and maintain a structured LLM-generated wiki for any codebase. Use when the user asks to analyze/understand/document a codebase, build a code wiki, create project documentation from source, or update an existing .llm-wiki. Triggers on phrases like "build wiki", "analyze this codebase", "document this project", "update wiki", "llm-wiki", or when entering an unfamiliar project that has no .llm-wiki yet.
npx skills add https://github.com/staruhub/ClaudeSkills --skill llm-wiki
Build a persistent, interlinked markdown wiki that captures the architecture, modules, patterns, and APIs of a codebase. The wiki lives in .llm-wiki/ at the project root. Humans curate and direct; the LLM handles all bookkeeping.
Based on Andrej Karpathy's LLM Wiki pattern: raw sources are "compiled" into a structured wiki that compounds over time.
Determine the mode based on current state:
.llm-wiki/ directory exists -> Full Build mode.llm-wiki/ exists -> Update mode (diff and refresh)find or Glob to map the directory tree (ignore node_modules, .git, vendor, dist, build, __pycache__, .venv)Record findings in .llm-wiki/_schema.md (see references/wiki-schema.md for format).
Create the directory structure:
.llm-wiki/
_schema.md # Wiki conventions and project metadata
_index.md # Content-oriented catalog by category
_log.md # Chronological build/update log
architecture/ # High-level design docs
modules/ # Per-module deep dives
concepts/ # Cross-cutting concepts (auth, caching, error handling...)
apis/ # API surface docs (REST endpoints, CLI commands, exported functions)
guides/ # How-to guides (setup, deployment, testing)
Write articles in priority order. See references/article-templates.md for templates.
Priority 1 - Architecture:
architecture/overview.md - System architecture, component diagram (ASCII), tech stackarchitecture/data-flow.md - How data flows through the systemarchitecture/directory-structure.md - Annotated directory treePriority 2 - Modules:
modules/<name>.md per major module/package/directoryPriority 3 - Concepts:
concepts/<name>.md per conceptPriority 4 - APIs:
apis/<name>.md per API groupPriority 5 - Guides:
guides/setup.md - Dev environment setupguides/testing.md - How to run and write tests_index.md - organized by category with one-line descriptions and links## See Also section linking to related articlesRun a health check over the wiki:
.md files)_index.md or any other page)Fix issues found. Log the lint run in _log.md.
When .llm-wiki/ already exists:
_schema.md to understand project metadata and conventions_log.md to see last update timestampgit log --since="<last_update>" --name-status if git availablearchitecture/directory-structure.md_index.md if new articles added or old ones removed_log.md with timestamp, summary of changes ---
title: Module Name
updated: 2026-04-09
sources:
- src/module/index.ts
- src/module/utils.ts
---
For large codebases (>500 source files), consider dispatching parallel agents:
Add .llm-wiki/ to .gitignore only if the user prefers it. By default, the wiki is intended to be committed alongside the code so the team benefits.
_index.md enables the LLM to navigate efficiently_log.md provides temporal context for future updatesTake staruhub/llm-wiki from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.