klappy.dev

The RecordMeta

Frontmatter Schema

The Authoritative Reference for All Document Metadata

SummaryOne Schema, All Documents, No Guessing

The canon has over 400 documents with no authoritative frontmatter schema. Fields, types, and quoting rules have been copied ad-hoc from whatever document an agent finds first. This has produced: unquoted values that parse as wrong types (dates as date objects, tiers as integers, booleans as booleans), inconsistent field presence across documents of the same audience, and silent rendering failures when the site's build system encounters unexpected types.

This document fixes the problem by defining the schema once. Templates (canon/meta/TEMPLATE.md, docs/TEMPLATE.md) define document structure. This document defines field requirements. When they disagree, this document wins.


The Universal RuleQuote Only What Needs Quoting

YAML frontmatter values follow a simple pattern derived from the working corpus: quote strings that contain special characters, leave simple identifiers and native types unquoted.

# Simple identifiers — unquoted
audience: canon
exposure: nav
voice: neutral
stability: semi_stable
type: essay
author: Klappy
slug: my-article-slug
epoch: E0007
status: active

# Integers — unquoted
tier: 2

# Booleans — unquoted
public: true
archived: false

# Dates — unquoted
date: 2026-04-04

# URIs — unquoted
uri: klappy://canon/principles/example

# Strings with special characters — quoted
title: "My Title — With Dashes and Colons: Like This"
subtitle: "Why it matters"
description: "A sentence with punctuation, dashes — and other characters."
hook: "The one-liner that grabs attention."
derives_from: "canon/values/axioms.md, canon/principles/other.md"
complements: "docs/path/to/sibling.md"
governs: "All documents in this scope"

# Arrays — inline with quoted strings
tags: ["canon", "principle", "example"]

The test is simple: if the value is a single word or simple identifier (no spaces, no special characters), leave it unquoted. If it contains spaces, punctuation, or special characters, quote it. Booleans, integers, and dates are always unquoted — the renderer expects native YAML types, not strings.


Universal Required Fields — Every Document, Every Audience

These eight fields are required on every document in the knowledge base, regardless of audience:

FieldFormatDescription
uri"klappy://path/to/slug"Canonical URI. Must match the file's logical location.
title"Full Title — With Stance"Document title. Must name concept and signal position (Writing Canon Tier 1).
audience"canon" "docs" "public" "odd" "operators" "apocrypha"Which audience this document serves. Determines required fields below.
exposure"nav" "public" "draft" "hidden" "internal"Visibility level. nav = navigable but not promoted. public = published on site. draft = work in progress. hidden = exists but not listed. internal = team-only.
tier"1" "2" "3" "4"Epistemic obligation level. 1 = foundational. 2 = governance. 3 = operational. 4 = ephemeral. See canon/definitions/epistemic-obligation-and-document-tiers.md.
voice"first_person" "neutral" "direct" "narrative" "conversational" "authoritative"Writing voice. first_person = Klappy speaks. neutral = system documentation.
stability"stable" "semi_stable" "evolving" "draft" "experimental"How likely this document is to change. Governs how confidently agents should rely on it.
tags["tag1", "tag2"]Inline array of quoted strings. Used for search and categorization. Must not be empty — at minimum include the audience and one topic tag.

Audience-Specific Fields

audience: "canon"

Canon documents define program-level constraints.

FieldRequired?FormatNotes
epochrecommended"E0007"Which epoch introduced this document
daterecommended"2026-04-04"Date created or last substantively revised
derives_fromrecommended"path/to/source.md, path/to/other.md"What this document is grounded in. Full file paths, not floating names.
complementsoptional"path/to/sibling.md"Related documents that work alongside this one
governsoptional"description of what this constrains"What behavior or documents this constrains
statusoptional"active" "proposed" "final" "superseded"Lifecycle status
supersedesoptional"path/to/old.md"What this replaces
superseded_byoptional"path/to/replacement.md"The replacement document (back-pointer; pair with status: superseded)

audience: "docs"

Docs documents define implementation details, planning, and operational guides.

FieldRequired?FormatNotes
epochrecommended"E0007"Which epoch this belongs to
daterecommended"2026-04-04"Date created
derives_fromoptional"path/to/source.md"What this is grounded in
complementsoptional"path/to/sibling.md"Related documents
governsoptional"description"What this constrains
statusoptional"active" "proposed" "superseded" "archived"Lifecycle status
supersedesoptional"path or description"What this replaces
superseded_byoptional"path/to/replacement.md"The replacement document (back-pointer; pair with status: superseded)
forcing_faultepoch docs only"description"What friction triggered this epoch
new_invariantepoch docs only"statement"What's now true that wasn't before
core_shiftepoch docs only"old → new"What changed
documents_introducedepoch docs only["path1.md", "path2.md"]Files added in this epoch
extendssub-epoch docs"Epoch N (description)"Parent epoch this extends

audience: "public"

Public documents include essays, articles, about pages, and website navigation pages. Essays and articles have additional required fields for site rendering.

All public documents:

FieldRequired?FormatNotes
epochrecommended"E0007"Which epoch
daterecommended"2026-04-04"Publication or creation date
derives_fromrecommended"path/to/source.md"Grounding
complementsoptional"path/to/sibling.md"Related content

Additional fields required when type is "essay" or "article":

FieldRequired?FormatNotes
slugrequired"kebab-case-url-slug"URL path. Used by the site renderer to generate page URLs. Without this, pages render blank.
authorrequired"Klappy"Author name. Always "Klappy" for this project.
typerequired"essay" or "article"Content type. Used by the renderer to select template.
publicrequired"true" or "false"Whether this is published on the site. "false" = draft, not visible.
descriptionrequired"1-2 sentence description"Used for SEO meta description and social sharing.
hookrequired"One compelling sentence"Used for teaser text in listings and cards.
subtitlerecommended"Explanatory subtitle"Appears below title on the page
og_titlerecommended"Title for social sharing"OpenGraph title. Defaults to title if omitted.
og_descriptionrecommended"Description for social sharing"OpenGraph description. Defaults to description if omitted.
og_typeoptional"article"OpenGraph type
og_imageoptional"/images/slug-og.png"OpenGraph image path
twitter_cardoptional"summary_large_image"Twitter card type
twitter_titleoptional"Title for Twitter"Twitter title
twitter_descriptionoptional"Description for Twitter"Twitter description
twitter_imageoptional"/images/slug-og.png"Twitter image path
relatedoptional[{uri, label, relationship}]Related content links (YAML object array)
provenanceoptional{trigger, author_interventions, ...}Detailed authorship record (YAML object)
book_partbook chapters only"Part N — Title"Book section
book_chapterbook chapters only"5"Chapter number (quoted)

About pages, indexes, and navigation pages (about/, READMEs, positioning docs) do not need slug, author, type, or social metadata. They render through structural routes, not content templates.

audience: "operators"

Operator documents are tool references and MCP server documentation.

FieldRequired?FormatNotes
epochoptional"E0007"Which epoch
dateoptional"2026-04-04"Date
derives_fromoptional"path/to/source.md"Grounding
complementsoptional"path/to/sibling.md"Related docs
governsoptional"description"What this constrains

audience: "apocrypha"

Apocrypha documents are system-voice fragments, predocumentaries, and reconstructions.

FieldRequired?FormatNotes
epochrecommended"E0005"Origin epoch
typerecommended"fragment" "predocumentary" "reconstruction"Apocrypha subtype
depends_onoptional["path1.md", "path2.md"]Source dependencies
confidenceoptional"experiential" "unknown"Interpretive confidence
provenanceoptional"cinematic" "disputed" "uncertain"Origin classification
classificationoptional"post-stability record"Temporal classification

audience: "odd"

ODD documents define universal philosophy and methodology.

FieldRequired?FormatNotes
epochoptional"E0005"Which epoch
dateoptional"2026-04-04"Date
derives_fromoptional"path/to/source.md"Grounding
complementsoptional"path/to/sibling.md"Related documents
governsoptional"description of what this handoff/ledger covers"What scope this document governs. Common on handoffs and ledgers.
statusoptional"active" "draft" "superseded" "archived"Lifecycle status
session_spanoptional"2026-04-19 closed" or "2026-04-19 to 2026-04-20"For session ledgers and handoffs: which session(s) the document records
versionoptional"1.0" (quoted)Document version
slugif site-rendered"kebab-case"URL slug for public-facing ODD docs

Archived Documents

Any document can be archived by adding:

archived: "true"
archived_reason: "E0005.1 — superseded by description"

Archived documents remain in the knowledge base for history but are excluded from active navigation and search prioritization.


Repo Routingtarget_repo

target_repo is an optional, cross-cutting field (it applies to documents of any audience) that declares which repository a file belongs to once the klappy.dev knowledge base bifurcates. It is the only routing signal extraction relies on: a later move is git grep target_repo plus copy, never a re-organization.

FieldRequired?FormatNotes
target_repooptional"outcomes-driven-development" "oddkit" "undecided"Destination repo for this file. Quoted string, one of the three enum values. Absent = stays in klappy.dev — the default home is the absence of a tag, so routing never depends on a file's path.

Values:

  • "outcomes-driven-development" — the portable core: universal governance and canon an outside adopter needs.
  • "oddkit" — the engine's own documentation and engine/release/telemetry governance.
  • "undecided" — contested; resolved deliberately before the file moves. Used for cross-cutting files and genuine judgment calls.
  • Absent — stays in klappy.dev (the personal overlay, the default home).

Only files that leave klappy.dev carry the tag; the overlay's own files stay untagged. Non-markdown files cannot carry frontmatter, so their routing is recorded in canon/meta/scope-map.json instead. A malformed value is a merge-gate failure (the validator enum-checks this field), so a bad route never reaches the renderer. Governing document: klappy://docs/repo-bifurcation-and-target-repo-routing.


Smell TestHow to Detect a Frontmatter Violation

  • Type mismatches. If a boolean field like public is quoted as "false" (a truthy string) instead of false (a boolean), the renderer behaves incorrectly. If an integer field like tier is quoted as "2" instead of 2, type comparisons fail.
  • Blank pages in PR previews. The most common symptom of frontmatter errors. Usually caused by quoted booleans/integers that should be native types, missing slug on public essays, or missing type on essays.
  • Copying frontmatter from another document. The smell itself. If the source of truth for frontmatter is "whatever document I found first," the schema is not being consulted. Consult this document instead.
  • Fields that don't appear in this schema. If you're adding a field that doesn't appear here, either this schema needs updating (propose the addition) or the field is ad-hoc and shouldn't be added.

Required Response When a Violation Is Detected

  1. Match the type the renderer expects. Booleans unquoted (true/false), integers unquoted (2), dates unquoted (2026-04-04), simple identifiers unquoted (canon, nav), complex strings quoted ("Title — With Special Characters").
  2. Check required fields. Consult the audience-specific table above. If required fields are missing, add them.
  3. Consult this document, not other documents. Do not copy frontmatter from another file to fix the problem. This schema is the source of truth.
  4. If this schema is incomplete, update it. If a legitimate field is missing from this schema, add it here first, then use it. The schema must stay current with actual usage.

Enforcement

This schema is a preflight and validate checkpoint. When the deliverable is a document, frontmatter compliance is a Definition of Done requirement alongside the Writing Canon checklist.

The schema was derived from corpus analysis of 389 documents on April 4, 2026, and should be maintained as the canon evolves. Fields that appear in fewer than 5% of documents within an audience are not listed unless they serve a specific structural purpose.


See Also

Markdown · RSS · built from klappy/klappy.dev@b750d7d