---
title: template-heading-structure-invalid
description: Reports an invalid H1 count or skipped heading level in a completed typed document.
---

[← All Rules](/rules/)

## What it does

Reports a completed typed document whose first heading is not an H1, that contains more than one H1, or that increases heading depth by more than one level.

## Why it matters

The document needs a coherent heading tree before its Template-specific headings can form a reliable structure.

## Examples

### Non-passing

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

# Second
```

### Passing

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

## Context

### Constraints
```

## When it applies

This Rule belongs to the configurable `document-types` group. It checks recognized documents that match a loaded Document Type, whether the Template is strict or non-strict.

## References

See [Presswork Configuration](/configuration/#documenttypes) for Document Types and [`src/template.ts`](https://github.com/evilkiwi/presswork/blob/main/src/template.ts) for heading-structure evaluation.
