llm-wiki
LLM Wiki for Codebases
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.
Mode Detection
Determine the mode based on current state:
- No
.llm-wiki/directory exists -> Full Build mode .llm-wiki/exists -> Update mode (diff and refresh)
Full Build Workflow
Phase 1: Reconnaissance
- Read top-level files: README, package.json/Cargo.toml/go.mod/pyproject.toml/build.gradle etc.
- Run
findor Glob to map the directory tree (ignore node_modules, .git, vendor, dist, build, pycache, .venv) - Identify: language(s), framework(s), build system, entry point(s), test framework
- Count files per directory to gauge module boundaries
- Read CLAUDE.md / AGENTS.md / .cursor/rules if present - they contain valuable architectural context
Record findings in .llm-wiki/_schema.md (see references/wiki-schema.md for format).
Phase 2: Skeleton
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)
Phase 3: Core Articles
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 tree
Priority 2 - Modules:
- One
modules/<name>.mdper major module/package/directory - Cover: purpose, key files, public interface, internal patterns, dependencies
Priority 3 - Concepts:
- Cross-cutting concerns that span modules (auth, logging, error handling, state management, config)
- One
concepts/<name>.mdper concept
Priority 4 - APIs:
- External-facing API surfaces (REST routes, CLI commands, SDK exports)
- One
apis/<name>.mdper API group
Priority 5 - Guides:
guides/setup.md- Dev environment setupguides/testing.md- How to run and write tests- Other guides as relevant
Phase 4: Index and Cross-link
- Build
_index.md- organized by category with one-line descriptions and links - Ensure every article has a
## See Alsosection linking to related articles - Add backlinks: if A references B, B should reference A
Phase 5: Lint
Run a health check over the wiki:
- Broken internal links (references to non-existent
.mdfiles) - Orphan pages (not linked from
_index.mdor any other page) - Missing coverage (directories/modules with no corresponding article)
- Stale references (mentions of files/functions that don't exist in codebase)
- Inconsistent terminology
Fix issues found. Log the lint run in _log.md.
Update Workflow
When .llm-wiki/ already exists:
- Read
_schema.mdto understand project metadata and conventions - Read
_log.mdto see last update timestamp - Detect changes since last wiki build:
git log --since="<last_update>" --name-statusif git available- Otherwise, compare directory tree against
architecture/directory-structure.md
- Triage changes:
- New files/directories -> create new articles or update existing ones
- Modified files -> re-read and update affected articles
- Deleted files -> remove references, mark articles for cleanup
- Renamed/moved files -> update paths in all referencing articles
- Update affected articles - re-read source, rewrite sections as needed
- Update
_index.mdif new articles added or old ones removed - Run lint (same as Phase 5 above)
- Append to
_log.mdwith timestamp, summary of changes
Writing Guidelines
- Be factual: describe what the code does, not what it should do. Cite file paths and line ranges.
- Use code snippets: short inline examples from actual source, not invented ones.
- Link aggressively: every mention of another module/concept should be a markdown link to its article.
- Keep articles focused: one topic per article, 100-500 lines. Split if longer.
- Frontmatter: every article starts with a YAML frontmatter block:
--- title: Module Name updated: 2026-04-09 sources: - src/module/index.ts - src/module/utils.ts --- - ASCII diagrams over external images - they live in version control and render anywhere.
- Language: match the project's primary language. If the codebase comments are in English, write in English. If Chinese, write in Chinese.
Agent Coordination
For large codebases (>500 source files), consider dispatching parallel agents:
- Agent per top-level module to write module articles concurrently
- One agent for architecture overview after modules are documented
- One agent for cross-linking and lint
Gitignore
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.
Key Principles (from Karpathy)
- The wiki is the LLM's domain - humans rarely edit it directly
- Knowledge compounds - each query and exploration enriches the wiki
- Index files are critical -
_index.mdenables the LLM to navigate efficiently - Lint regularly - catch rot before it spreads
- Log everything -
_log.mdprovides temporal context for future updates
More from staruhub/claudeskills
geek-skills-a-share-analyst
A股专业分析师助手,提供每日股价分析、选股策略和投资建议。适用于:(1) 获取A股实时行情和历史数据,(2) 技术面分析(K线形态、MACD、KDJ、RSI、布林带等),(3) 基本面分析(财务指标、估值分析),(4) 板块热点追踪,(5) 选股策略筛选,(6) 量化因子分析,(7) 生成每日股市分析报告。当用户询问"帮我分析股票"、"今日选股"、"A股行情分析"、"技术分析"、"基本面分析"、"量化选股"等相关问题时触发。
70geek-skills-product-manager
资深产品经理助手,提供PRD文档创作与评审、产品策略咨询、留存增长分析、竞品研究、功能优先级排序等全方位产品管理支持。适用于创作或评审PRD/MRD/BRD/用户故事等产品文档;诊断产品问题(留存低、转化差、增长瓶颈)并给出可执行策略;进行竞品分析和市场研究;设计功能方案和用户体验优化。当用户提到"PRD"、"需求文档"、"产品规划"、"用户留存"、"功能设计"、"竞品分析"、"产品指标"、"增长策略"、"用户体验优化"、"功能优先级"等产品管理相关话题时,使用此skill。即使用户没有明确说"产品",但在讨论App功能设计、用户增长、商业模式、需求分析等话题时也应触发。
40request-analyzer
Proactively analyze user requests at the start of conversations to determine task type, assess prompt quality, and intelligently recommend which skills to activate. Should activate for ALL user requests to ensure optimal workflow. Evaluates clarity, specificity, and completeness to suggest prompt-optimizer when needed. Identifies UI design tasks for ui-analyzer and component requests for react-component-generator. Acts as intelligent skill coordinator.
40geek-skills-c-drive-cleaner
Windows C盘清理和磁盘空间管理工具。当用户需要清理C盘、释放磁盘空间、查找大文件、分析磁盘占用、删除临时文件、清理缓存、管理Windows系统垃圾文件时使用此skill。适用于以下场景:(1)C盘空间不足需要清理;(2)查找和删除大文件;(3)分析磁盘空间占用;(4)清理系统临时文件和缓存;(5)清理浏览器缓存;(6)清理回收站;(7)清理系统日志;(8)优化Windows磁盘空间。
36geek-skills-gaokao-expert
资深高考命题专家助手,提供专业的命题指导和评审服务。适用于创作高考试题、评审试题质量、分析试卷结构、了解命题趋势等场景。结合文档工具提取解压文件,使用网络搜索了解最新命题趋势,使用分析工具评估题目质量和试卷结构。涵盖"一核四层四翼"评价体系、2025年命题趋势、题型规范、评分标准、命题流程等多个维度,符合高考命题最佳实践。
35geek-skills-mineru-pdf-parser
PDF解析工具,将复杂PDF文档转换为LLM友好的Markdown/JSON格式。适用于:(1) 将PDF转换为Markdown或JSON格式,(2) 提取PDF中的文本、表格、公式、图像,(3) 处理学术论文、技术文档、商业报告的PDF解析,(4) 为RAG应用准备高质量文档数据,(5) 批量处理PDF文件。触发关键词包括:"PDF解析"、"PDF转Markdown"、"PDF转JSON"、"提取PDF表格"、"提取PDF公式"、"MinerU"、"文档解析"、"PDF extraction"、"convert PDF"、"parse PDF"等。
33