A portable template for building persistent, AI-maintained knowledge bases inside software projects.
Every AI coding agent starts every session cold. It reads a config file, greps some source files, and starts guessing. The bigger the codebase, the more context it loses. The LLM Code Wiki fixes this by giving agents a structured knowledge base that compounds over time. Decisions are recorded once. Architecture is mapped once. Domain logic is explained once. The agent reads the wiki to orient itself instead of scanning the entire codebase.
The template works with Claude Code, OpenAI Codex, Cursor, Gemini CLI, or anything else that reads markdown and writes to disk.
llm-code-wiki.md is a single file you copy into any project. It contains:
- A three-tier knowledge model that separates code-derivable facts, human decisions, and AI-synthesized understanding, so each type ages correctly instead of rotting together
- A concrete directory structure (
wiki/entities/,wiki/concepts/,wiki/flows/,wiki/decisions/) with YAML frontmatter conventions that work with Obsidian's Dataview plugin and graph view - A complete
SCHEMA.mdtemplate the agent reads on session start, with a two-level bootstrap that loads 3 files to orient, then 1 to 3 more for the current task - Operations for ingest, query, and lint that keep the wiki healthy as the codebase evolves
- Multi-agent wiring instructions for Claude Code, Codex, Cursor, and Gemini CLI
- Obsidian graph coloring by page type so entity, concept, flow, and decision pages are visually distinct
- Scaling guidance: when to add hybrid search (
qmd), when to split sub-wikis, when to add CI lint - A bootstrap script for applying the wiki to existing undocumented projects
cd /path/to/your-project
mkdir -p wiki/{entities,concepts,flows,decisions,open,raw,artifacts}
cp llm-code-wiki.md wiki/SCHEMA.md
# Edit wiki/SCHEMA.md: fill in [PROJECT_NAME] and paths
# Add to CLAUDE.md / AGENTS.md: "Read wiki/SCHEMA.md on session start"
# Open project root in Obsidian
# Tell the agent: "Read wiki/SCHEMA.md and bootstrap the wiki from the codebase"The agent will scan the project, create an index page, generate entity pages for the major modules, and seed decision records from git history. Typically takes 15 to 30 minutes for a project with 50 to 500 files.
The template draws on ideas from Cline's Memory Bank pattern, Microsoft's deep-wiki plugin, the CodeWiki paper (FSoft-AI4Code, ACL 2026), Karpathy's LLM Wiki pattern, and practical experience maintaining wikis across multiple TypeScript and Astro projects.