SEC-001 Required sections
Overview
Section titled “Overview”Validates that documents contain every required section heading. If any heading listed in sections is missing, an error is reported.
Why it matters
Section titled “Why it matters”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.
Options
Section titled “Options”| Field | Type | Required | Description |
|---|---|---|---|
sections | string[] | Yes | Array of required section heading texts |
files | string | — | Glob of files this rule applies to |
Bad example
Section titled “Bad example”# 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-001After fix
Section titled “After fix”# ADR-001 Authentication mechanism
## Background
We need to choose an authentication mechanism.
## Decision
Adopt JWT.
## Consequences
We no longer need a session store.Configuration example
Section titled “Configuration example”{ "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.
Related rules
Section titled “Related rules”- SEC-002 Section order — Once required sections exist, validates their order
- STR-001 Required files — Validates that the required files exist in the first place