> ## Documentation Index
> Fetch the complete documentation index at: https://saydo-5cd0e3d7.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# /wiki-compile

> Compile your source markdown files into a topic-based wiki.

`/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.

<Note>
  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.
</Note>

## Command variants

<CodeGroup>
  ```bash Incremental (default) theme={null}
  /wiki-compile
  ```

  ```bash Force recompile all theme={null}
  /wiki-compile --full
  ```

  ```bash Single topic theme={null}
  /wiki-compile --topic <slug>
  ```

  ```bash Preview only theme={null}
  /wiki-compile --dry-run
  ```
</CodeGroup>

| 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:

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
