Skip to content

Route a whole tree with one config

author-05 · YAML

A kind: config document maps globs to contracts — by name, by path, or inline — so validating an entire docs tree is configuration.

Builds on: Frontmatter and required sections

The declarative YAML artifact, verbatim — no code required.

markdown-contract.yaml
mcVersion: 2
kind: config
contracts:
decision: ./decision.contract.yaml
runbook: ./runbook.contract.yaml
rules:
- include: ["decisions/**/*.md"]
contract: decision # by name
- include: ["runbooks/**/*.md"]
exclude: ["runbooks/_archive/**"]
contract: runbook
- include: ["**/*.md"] # catch-all last: first match wins
contract: # inline contract, no separate file
frontmatter:
type: object
required: [title]
properties:
title: { type: string, minLength: 1 }
  • kind: config envelope
  • glob routing with first-match precedence
  • named, path, and inline contract refs