/wiki-compile reads all your configured source directories and produces synthesized topic articles in your wiki output folder. Run it after /wiki-init to build your first wiki, and again whenever your source files change.
The first compilation reads every source file and can take 5–10 minutes for large knowledge bases (100+ files). After that, incremental runs only recompile topics whose sources have changed — typically much faster.
Command variants
| Variant | When to use |
|---|---|
/wiki-compile | After adding or editing source files — recompiles only changed topics |
/wiki-compile --full | After editing article_sections in your config, or when you want a clean rebuild |
/wiki-compile --topic <slug> | To quickly refresh one topic without touching the rest |
/wiki-compile --dry-run | To preview what would be compiled before committing |
Compilation phases
When you run/wiki-compile, it works through these phases in order:
- Scan sources — reads
.wiki-compiler.json, validates source paths, and identifies which files have changed since the last compile - Classify and discover topics — groups source files into topics, using
schema.md(if it exists) to respect your naming conventions and existing topic boundaries - Compile topic articles — writes one article per topic using the
article_sectionsstructure from your config, with parallel agents where possible - Discover concept articles — looks for patterns that span 3 or more topics and compiles cross-cutting concept articles in
{output}/concepts/ - Generate or update
schema.md— on the first run, createsschema.mddefining your wiki’s topic list, naming conventions, and article format; on subsequent runs, logs any newly discovered topics - Update
INDEX.md— regenerates the index with all topics and concepts, source counts, and coverage summaries - Update log — appends a compile entry to
compile-log.mdwith topics created, updated, and source counts
First run
The first time you compile,schema.md is generated automatically in your output directory. This file defines your wiki’s structure and naming conventions. You can edit it to rename or merge topics — the compiler respects your changes on every subsequent run.
After compiling
- Open
{output}/INDEX.mdin Obsidian to browse all topics with backlinks - Run
/wiki-lintto check for stale articles, missing cross-references, or contradictions - Add the wiki path to your
AGENTS.mdso Claude reads it automatically each session