Skip to content

Real-World Schemas: Document Templates and Cross-Document Governance

Each example builds on the one before it — read the ladder in order, or jump to the rung you need. Every shipped artifact is regression-checked against the real CLI and library output.

  1. REAL-WORLD-SCHEMAS-01: ADR: require the four sections in order — A single document type whose body grammar pins required H2 sections in strict order.
  2. REAL-WORLD-SCHEMAS-02: Type the ADR frontmatter — Layering frontmatter typing onto the ADR: an enum status and a format-checked required date.
  3. REAL-WORLD-SCHEMAS-03: Typed table inside Consequences — A content leaf: a typed table with an enum cell required inside a named section.
  4. REAL-WORLD-SCHEMAS-04: Validate one ADR from the CLI — Running a single contract over one document and reading the exit code.
  5. REAL-WORLD-SCHEMAS-05: Custom rule: Decision must cite an alternative — A node-local rule() emitting a finding when a section’s prose lacks a required reference.
  6. REAL-WORLD-SCHEMAS-06: RFC with a rejected-alternatives section — A richer single type using recognized-relative order and a mandatory Rejected alternatives section.
  7. REAL-WORLD-SCHEMAS-07: Runbook with an oncall owner and a rollback checklist — An operational template binding a required owner field to a required Rollback checklist leaf.
  8. REAL-WORLD-SCHEMAS-08: Postmortem: timeline table plus action items — Two content leaves in one document: a required timeline table and an action-items checklist.
  9. REAL-WORLD-SCHEMAS-09: Prompt-library card for AI agents — A prompt card pinning a model enum and a fenced code block holding the system prompt.
  10. REAL-WORLD-SCHEMAS-10: Corpus config: route two types, first match wins — A meta-config mapping path globs to per-type contracts so a tree validates against the right contract.
  11. REAL-WORLD-SCHEMAS-11: Frontmatter governance across the whole tree — A catch-all rule with an exclude that enforces a baseline contract on every remaining document.
  12. REAL-WORLD-SCHEMAS-12: First cross-document check: dangling depends_on — A docRule that flags a task whose depends_on names an id no task defines.
  13. REAL-WORLD-SCHEMAS-13: Referential graph: membership and supersession — docRules asserting a milestone’s members all exist and no entity references a superseded id.
  14. REAL-WORLD-SCHEMAS-14: Scaffold and drift-check a corpus with init — Inferring a tight contract from existing docs and re-checking the tree for drift.
  15. REAL-WORLD-SCHEMAS-15: Validate the self-hosted SDLC corpus end to end — Running the whole planning tree against its per-type contracts via an auto-discovered config.
  16. REAL-WORLD-SCHEMAS-16: Retire an SDLC invariants.yaml prose linter onto a contract (planned) — The SDLC plugin’s required/forbidden-phrase, required-section and tool-ref linter becomes one declarative contract.