Skip to content

SEC-001 Required sections

Validates that documents contain every required section heading. If any heading listed in sections is missing, an error is reported.

Even when documents like ADRs, requirement specs, or design docs are expected to follow a shared template, individual writers can drop sections such as ## Background or ## Decision. AI-generated drafts and rushed updates make this especially common, and reviewers often miss the omission. This rule detects missing headings mechanically.

FieldTypeRequiredDescription
sectionsstring[]YesArray of required section heading texts
filesstringGlob of files this rule applies to
# ADR-001 Authentication mechanism
## Background
We need to choose an authentication mechanism.
## Decision
Adopt JWT.

With sections: ["Background", "Decision", "Consequences"], the missing Consequences section triggers a violation.

docs/adr/001.md
line 0 error Missing required section "Consequences" SEC-001
# ADR-001 Authentication mechanism
## Background
We need to choose an authentication mechanism.
## Decision
Adopt JWT.
## Consequences
We no longer need a session store.
{
"rule": "sec001",
"options": {
"sections": ["Background", "Decision", "Consequences"],
"files": "adr/*.md"
}
}

Use files to enforce a template only on documents in a specific directory, such as ADRs or requirement specs.