# Fix: Markdown twin carries YAML frontmatter

> Web-audit fix skill for the `markdown-frontmatter` check (Content for agents, MAY).

## Goal

Prefix the markdown twin with a YAML frontmatter block so agents read page metadata without parsing the body.

## Fix

Open each markdown twin with a YAML frontmatter block: a `---` fence line, `title`, `description`, and a
canonical `url` key, then a closing `---` fence, before the first heading. An agent then lifts the page's
title, summary, and canonical URL from structured keys instead of inferring them from prose, which is both
cheaper and less error-prone. Keep the block well-formed: an opened fence with no terminator, or a fence pair
with no keys, is worse than no frontmatter because it misleads a parser.

## Resources

- [YAML front matter (Jekyll)](https://jekyllrb.com/docs/front-matter/)
- [RFC 7763 (text/markdown)](https://www.rfc-editor.org/rfc/rfc7763)

## Copy-paste prompt

Paste this into your coding agent. [Your audit](https://anc.dev/audit) adds what it observed for this check:

```text
Goal: Prefix the markdown twin with a YAML frontmatter block so agents read page metadata without parsing the body
Fix: Open each markdown twin with a YAML frontmatter block: a `---` fence line, `title`, `description`, and a canonical `url` key, then a closing `---` fence, before the first heading. An agent then lifts the page's title, summary, and canonical URL from structured keys instead of inferring them from prose, which is both cheaper and less error-prone. Keep the block well-formed: an opened fence with no terminator, or a fence pair with no keys, is worse than no frontmatter because it misleads a parser.
Skill: https://anc.dev/fix/markdown-frontmatter
Docs: https://jekyllrb.com/docs/front-matter/, https://www.rfc-editor.org/rfc/rfc7763
```

## Verify

Re-run the audit at [https://anc.dev/audit](https://anc.dev/audit) or call the `audit_website` MCP tool; the `markdown-frontmatter` check should report `pass`.
