Skip to main content
The schema layer is entirely optional. Without a schema file, llmwiki compiles every page as a concept and applies no cross-link minimums - existing wikis continue to work exactly as they did before the schema layer existed. You only need a schema when you want to enforce structure: typed page kinds, minimum wikilink counts per kind, or seed pages that the compiler should materialize automatically.

Initializing a schema

Run these commands from your project root:
schema init writes a template file you can edit. schema show always prints the fully-resolved schema, merging your file onto built-in defaults - useful for confirming what the compiler is actually using.

Schema file location

llmwiki searches for a schema file in the following order, using the first one found:
  1. .llmwiki/schema.json
  2. .llmwiki/schema.yaml
  3. .llmwiki/schema.yml
  4. wiki/.schema.yaml
  5. wiki/.schema.yml
The most common location is .llmwiki/schema.json (what schema init creates).

Page kinds

llmwiki supports four page kinds. The compiler uses the kind as context when generating a page, and lint enforces per-kind cross-link minimums. Pages that don’t declare a kind in frontmatter fall back to the schema’s defaultKind (which defaults to concept).

Schema structure

A schema file is a JSON (or YAML) document with the following shape:
Every field is optional - you only need to specify what you want to override. Missing fields inherit their built-in defaults, so a minimal schema that only raises minWikilinks for overview pages is perfectly valid.

Seed pages

seedPages declares pages the compiler should materialize on each compile run. Each seed page entry requires:

How the schema affects compile

When you run llmwiki compile:
  • Seed pages declared in seedPages are materialized automatically. For overview and comparison seeds with relatedSlugs, the compiler passes the named pages as the source material.
  • Pages without an explicit kind in frontmatter are assigned defaultKind (default: concept).

How the schema affects lint

llmwiki lint enforces per-kind cross-link minimums after compile:
  • A comparison page with fewer than minWikilinks wikilinks is flagged.
  • An overview page that doesn’t reach its minimum is flagged.
  • Violations are reported by slug and kind so you can find and fix them.

How the schema affects review

When a review policy is active with schema-violating in the hold array, any page that fails a schema cross-link rule is automatically held for review instead of written live. See Review Policy for how to configure that behavior.
A schema is most useful for large wikis, domain templates, and structured knowledge bases where you want consistent page structure enforced over time. For a personal notebook or exploratory wiki, you likely don’t need one - start without a schema and add one when you find yourself wanting to enforce cross-link density or generate overview pages automatically.

For more on how page kinds behave in the compiler, see Page Types. For holding schema-violating pages automatically during compile, see Review Policy.