Skip to content

madr/metadata-format

Reports an ADR whose metadata is written in a format that the configured madrVersion does not read.

madrVersion decides where metadata comes from. v2 reads the list under the title (* Status: accepted), and v3/v4 read YAML frontmatter. Metadata in the other format is not read at all, so its fields (status, date, …) would go unchecked with no message. This rule reports that case.

Under madrVersion: 'auto' (the default), the version is detected from each file’s format, so this rule never reports.

  • expectedFrontmatter — madrVersion is v3 or v4, and the file has a metadata list under the title but no MADR frontmatter.
  • expectedList — madrVersion is v2, and the file has MADR frontmatter.

Both are file-level diagnostics with data.version set to the configured version. A file with no metadata is valid: every metadata field is optional in the MADR templates.

Frontmatter counts as MADR frontmatter when it holds at least one MADR field: status, date, deciders, decision-makers, consulted, or informed. Frontmatter with only site-generator keys, such as Jekyll’s title and nav_order, is not MADR metadata, so a v2 ADR can keep it beside its metadata list.

With madrVersion: 'v4':

---
status: accepted
date: 2026-11-11
---
# Use PostgreSQL

With madrVersion: 'v2':

# Use PostgreSQL
* Status: accepted
* Date: 2026-11-11

With madrVersion: 'v4':

# Use PostgreSQL
* Status: accepted
* Date: 2026-11-11

Emits 1 diagnostic: Metadata is written as a body list, but madrVersion "v4" reads YAML frontmatter.

None.

VersionApplies
v2yes
v3yes
v4yes

The v2 template (2.1.2) puts metadata in a list under the title. The v3 (3.0.0) and v4 (4.0.0) templates use YAML frontmatter.

Fix the mismatch instead: move the metadata to the format your madrVersion reads, or set madrVersion to 'auto' for a repository that mixes formats. Disabling the rule leaves the mismatched files’ metadata unchecked.

Like all rules, this rule can be suppressed inline — see Suppressing rules.