---
title: template-heading-undeclared
description: Reports a heading occurrence that a Strict Template does not declare.
---

[← All Rules](/rules/)

## What it does

Reports each heading in a strict typed document that cannot be matched to one declared Template heading occurrence. This includes duplicate occurrences beyond the declaration count.

## Why it matters

A Strict Template permits authored prose but limits the completed document to its declared heading structure.

## Examples

For a Strict Template that declares `Context` and `Decision`:

### Non-passing

```md title="docs/decisions/0001-choice.md"
# Choice

## Context

### Extra

## Decision
```

### Passing

```md title="docs/decisions/0001-choice.md"
# Choice

## Context

Authored context may still appear here.

## Decision
```

## When it applies

This Rule belongs to the configurable `document-types` group and applies only when the matching Document Type has `strict: true`.

## References

See [Presswork Configuration](/configuration/#documenttypes) for strictness and [`src/template.ts`](https://github.com/evilkiwi/presswork/blob/main/src/template.ts) for declaration matching.
