---
title: template-definition-heading-invalid
description: Reports a Template without exactly one leading H1 or with skipped heading levels.
---

[← All Rules](/rules/)

## What it does

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

## Why it matters

The Template's heading hierarchy defines the required structure of its completed documents.

## Examples

### Non-passing

```md title="docs/decisions/TEMPLATE.md"
# {{title}}

# Second title
```

### Passing

```md title="docs/decisions/TEMPLATE.md"
# {{title}}

## Context

### Constraints
```

## When it applies

This Rule belongs to the configurable `document-types` group. It validates the Template definition itself, before completed typed documents are compared with it.

## References

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