Skip to main content
/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

/wiki-compile
VariantWhen to use
/wiki-compileAfter adding or editing source files — recompiles only changed topics
/wiki-compile --fullAfter 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-runTo preview what would be compiled before committing

Compilation phases

When you run /wiki-compile, it works through these phases in order:
  1. Scan sources — reads .wiki-compiler.json, validates source paths, and identifies which files have changed since the last compile
  2. Classify and discover topics — groups source files into topics, using schema.md (if it exists) to respect your naming conventions and existing topic boundaries
  3. Compile topic articles — writes one article per topic using the article_sections structure from your config, with parallel agents where possible
  4. Discover concept articles — looks for patterns that span 3 or more topics and compiles cross-cutting concept articles in {output}/concepts/
  5. Generate or update schema.md — on the first run, creates schema.md defining your wiki’s topic list, naming conventions, and article format; on subsequent runs, logs any newly discovered topics
  6. Update INDEX.md — regenerates the index with all topics and concepts, source counts, and coverage summaries
  7. Update log — appends a compile entry to compile-log.md with 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.md in Obsidian to browse all topics with backlinks
  • Run /wiki-lint to check for stale articles, missing cross-references, or contradictions
  • Add the wiki path to your AGENTS.md so Claude reads it automatically each session