Skip to main content
Schema validation lets you enforce structure on pages by type. When enabled, every write validates the page’s frontmatter against a JSON Schema before committing. This prevents agents and users from creating malformed pages.

How it works

  1. A page is written with a type field in its frontmatter.
  2. KiwiFS looks up .kiwi/schemas/{type}.json.
  3. If the schema exists and enforcement is on, the frontmatter is validated.
  4. Invalid pages are rejected before they reach git.

Enabling enforcement

When enforce = false (default), schemas are stored but not checked on writes.

Creating schemas

Schemas live in .kiwi/schemas/ as standard JSON Schema files. The filename (minus .json) matches the frontmatter type field.
Now any page with type: runbook in its frontmatter must have title, status, and owner:

Listing schemas

Reading a schema

Returns the raw JSON Schema document.

Validation errors

When a write fails validation, you get a 400 response with details:
Use schemas to standardize page types across your knowledge base. For example, define schemas for runbook, decision, episode, and concept to ensure agents always create well-formed pages.
Last modified on May 8, 2026