---
title: document-type-filename-invalid
description: Reports a direct typed-document child that does not match its Document Type filename pattern.
---

[← All Rules](/rules/)

## What it does

Reports a direct child of a Document Type directory when its basename does not match that type's canonical Markdown filename pattern.

## Why it matters

Canonical filenames carry the fields used to recognize and evaluate typed documents.

## Examples

For the Matt Pocock Profile's `docs/adr/{{number}}-{{slug}}.md` pattern:

### Non-passing

```text title="Repository tree"
docs/adr/
├── 0000-zero.md
└── one-bad-name.md
```

### Passing

```text title="Repository tree"
docs/adr/
└── 0001-record-the-decision.md
```

## When it applies

This Rule belongs to the configurable `document-types` group. It excludes support files such as the type's `TEMPLATE.md` and configured Index Documents.

## References

See [Presswork Configuration](/configuration/#documenttypes) for filename patterns and [`src/document-type.ts`](https://github.com/evilkiwi/presswork/blob/main/src/document-type.ts) for matching semantics.
