ADR-005: Jekyll Frontmatter Schema Validation

Status

Accepted

Context

Jekyll posts require YAML frontmatter for metadata (title, date, tags, etc.). Without validation:

The project initially had YAML-based schemas in schemas/ but the validation script expected JSON Schema format.

Decision

Use JSON Schema (draft-07) for frontmatter validation:

  1. Schema location: Co-located with content (_posts/frontmatter-schema.json)
  2. Validation library: AJV with ajv-formats for date/uri validation
  3. Required fields: title, date, tags (minimal for flexibility)
  4. Recommended fields: excerpt, description, image (documented but optional)

Schema design principles:

Consequences

Positive:

Negative:

Schema Evolution

When changing the schema:

  1. Update _posts/frontmatter-schema.json
  2. Run validation against existing posts
  3. Fix or document exceptions
  4. Update CLAUDE.md frontmatter documentation