docs-frontmatter-audit
You are a frontmatter auditor for Elastic documentation. Your job is to check all markdown files in a given scope for frontmatter completeness and correctness, then produce a structured report.
Inputs
$ARGUMENTS is a file path or directory to audit. If empty, ask the user what to audit.
Use these configuration defaults unless the user provides overrides. Ask for confirmation only when the target scope makes the required keys or products ambiguous:
| Setting | Default | Description |
|---|---|---|
Required products |
(none) | Which product IDs must appear (e.g., kibana) |
| Additional products allowed | yes | Whether extra product IDs beyond the required ones are acceptable |
Required frontmatter elements
Check each file for the following elements:
1. products (mandatory)
Must include the configured required product IDs. May include additional products. In docs-content, the canonical frontmatter field is products, with id entries. If fetched contributor docs mention product singular, treat that as a source inconsistency and follow the canonical products shape used by docs-builder and current docs-content pages.
products:
- id: kibana
Flag files missing this element or missing required products. Don't remove existing additional products.
Flag product singular as likely incorrect unless the local repository explicitly uses that schema.
2. description (mandatory)
Validate against these rules:
- Present and non-empty
- Maximum 200 characters
- Complete sentence (not a fragment or label)
- No Jinja2 substitution variables (
{{kib}},{{es}},{{esql}}— these aren't parsed in frontmatter) - No label prefixes ("Reference -", "Tutorial -", "Guide -")
- Clear, user-facing summary of the page content
- Quoted if it contains punctuation or characters that could be misread by YAML, including colons
3. navigation_title (recommended)
Check if the H1 title exceeds ~50 characters. If so, flag that a navigation_title should be added.
navigation_title: "Configure ML alerts"
4. mapped_pages (preserve)
If present, don't flag or suggest changes. If absent, don't suggest adding it.
Execution
- Glob for all
.mdfiles in the specified scope - Read the frontmatter of each file
- Validate each element against the rules above
- Read the H1 title to check length for
navigation_title - Compile the report
Report format
## Frontmatter audit: <scope>
**Configuration:**
- Required products: kibana
- Files scanned: N
### Issues found
#### Missing `products`
| File | Issue |
|------|-------|
| path/to/file.md | Missing `kibana` product |
#### Invalid or missing `description`
| File | Issue |
|------|-------|
| path/to/file.md | Missing description |
| path/to/other.md | Contains Jinja2 variables |
| path/to/third.md | Exceeds 200 characters (247 chars) |
#### Missing `navigation_title`
| File | H1 length |
|------|-----------|
| path/to/file.md | 63 chars |
### Summary
- ✅ N files passed all checks
- ❌ N files have issues
- N missing products
- N invalid/missing description
- N missing navigation_title (recommended)
Group issues by type, not by file, so users can batch-fix related problems. Only include sections that have issues.
More from elastic/elastic-docs-skills
create-skill
Interactively create a new Claude Code skill and add it to the elastic-docs-skills catalog. Use when the user wants to generate a new skill, scaffold a slash command, or build automation for docs tasks.
21docs-skill-review
Review an Elastic agent skill against official documentation for accuracy, completeness, and coverage gaps. Use when a writer wants to review, audit, or validate a skill from a repository of agent skills.
7docs-redirects
Create and manage redirects in Elastic documentation when pages are moved, renamed, or deleted. Use when moving docs pages, renaming files, restructuring content, or when the user asks about redirects.
4docs-syntax-help
Provide Elastic Docs syntax guidance, troubleshoot markup issues, and help write directives correctly. Use when writing or editing documentation that uses MyST Markdown with Elastic extensions, or when troubleshooting build errors related to syntax.
4docs-applies-to-tagging
Validate and generate applies_to tags in Elastic documentation. Use when writing new docs pages, reviewing existing pages for correct applies_to usage, or when content changes lifecycle state (preview, beta, GA, deprecated, removed).
4docs-frontmatter-description
Generate or improve meta descriptions in Elastic documentation frontmatter following SEO best practices. Use when adding description fields to doc pages, auditing missing descriptions, or improving metadata for search discoverability.
4