---
title: template-definition-optional-placement-ambiguous
description: Reports optional Template boundaries that do not wrap one complete heading section.
---

[← All Rules](/rules/)

## What it does

Reports unmatched, repeated, overlapping, nested, or misplaced optional boundaries. Each pair must wrap one complete heading section and use a unique lower-case identifier.

## Why it matters

Presswork needs one clear section boundary to decide which declared headings may be omitted together.

## Examples

### Non-passing

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

<!-- presswork:optional-start detail -->

Text before any heading.
<!-- presswork:optional-end detail -->
```

### Passing

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

<!-- presswork:optional-start detail -->

## Detail

Optional authored detail.
<!-- presswork:optional-end detail -->
```

## When it applies

This Rule belongs to the configurable `document-types` group. Optional boundaries are interpreted while the Template definition is compiled.

## References

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