name: content-reviewer description: >- Review MDX content files for the f5-sales-demo documentation pipeline. Checks for bare < characters, unescaped {}, broken image references, incomplete frontmatter, invalid imports, and component attribute issues. Use this skill when the user asks to review MDX, check docs, validate content, lint MDX files, mentions MDX errors or build failures, or wants to check documentation quality before committing. Also use when working in any f5-sales-demo content repository's docs/ directory.
MDX Content Reviewer
Review MDX files in docs/ for errors that cause Astro/Starlight build
failures. Report findings grouped by severity: ERROR (build-breaking),
WARNING (likely issues), INFO (style suggestions).
Scoping
If the repository has recent uncommitted or staged changes, scope the review to changed MDX files only:
git diff --name-only --diff-filter=ACMR HEAD -- 'docs/**/*.mdx'
If no changes exist or the user requests a full review, check all
docs/**/*.mdx files.
Use parallel tool calls throughout — read multiple files, run multiple Grep/Glob searches in a single turn wherever possible.
Check 1: Frontmatter Validation
Read each MDX file and parse the YAML block between the opening and
closing --- delimiters.
Regular pages (any file except docs/index.mdx):
| Field | Required | Type | Notes |
|---|---|---|---|
title |
yes | string | Page title shown in browser tab and sidebar |
sidebar.order |
yes | number | Controls sidebar sort order |
sidebar.label |
recommended | string | Short label for sidebar (INFO if missing) |
Landing page (docs/index.mdx):
| Field | Required | Type | Notes |
|---|---|---|---|
title |
yes | string | |
template |
yes | splash |
Must be the literal string splash |
hero.title |
yes | string | |
hero.tagline |
yes | string | |
hero.image.html |
yes | string | HTML string with an <img> tag |
sidebar.hidden |
recommended | true |
Hides splash page from sidebar |
Severities:
- Missing
title→ ERROR - Missing
sidebar.orderon a non-index page → WARNING - Missing
sidebar.label→ INFO - Missing
template: splashon index → WARNING - Missing
hero.taglineorhero.image.htmlon index → WARNING
Read the reference file references/frontmatter-schema.md for the
complete schema.
Check 2: MDX Syntax Pitfalls
Scan each file line by line. Track whether you are inside a fenced
code block (lines between ``` delimiters) or an inline code span
(text between backticks on the same line). Skip lines inside code
fences and inline code spans.
Outside code blocks, flag:
Bare
<— A<character that is NOT:- Part of an opening/closing component tag (
<Aside,</Aside>,<Screenshot,<Code,<Steps>,<CardGrid>,<Card>,<Tabs>,<TabItem>,<LinkCard,<Badge>,<Icon>,<FileTree>,<Banner>) - Part of a self-closing HTML tag (
<br />,<hr />,<img) - Part of an HTML entity (
<,>,&,→) - Inside a Markdown link
[text](url) - Inside an
export constblock (JavaScript) - Inside a
{/* comment */}JSX comment
Bare
<→ ERROR (causes JSX parse failure)- Part of an opening/closing component tag (
Unescaped
{or}— A brace that is NOT:- Part of a component attribute (
type="caution",code={varName}) - Part of an
export conststatement - Part of an
importstatement - Part of a JSX comment
{/* ... */} - Part of a JSX expression inside a component tag
Unescaped braces in prose → ERROR
- Part of a component attribute (
Curly braces in filenames — Any
.mdxfile whose name contains{or}→ ERROR
Read references/mdx-pitfalls.md for detailed examples.
Check 3: Import Validation
Collect all import statements from each file. Validate against the
allowlist:
Allowed import sources:
| Source | Named exports |
|---|---|
@astrojs/starlight/components |
Aside, Code, Steps, CardGrid, Card, Tabs, TabItem, LinkCard, Badge, Icon, FileTree |
@f5-sales-demo/docs-theme/components/Screenshot.astro |
default import (Screenshot) |
@f5-sales-demo/docs-theme/components/LinkCard.astro |
default import (LinkCard) |
@f5-sales-demo/docs-theme/components/Banner.astro |
default import (Banner) |
@f5-sales-demo/docs-theme/components/Icon.astro |
default import (Icon) |
Severities:
- Import from an unknown source → WARNING
- Named export not in the allowlist for that source → WARNING
- Unused import (imported but never referenced in the file body) → INFO
Read references/allowed-imports.md for the full allowlist.
Check 4: Component Attribute Validation
For each component usage found in the file, validate required attributes:
| Component | Required attributes | Optional |
|---|---|---|
Screenshot |
alt + at least one of light or dark |
light, dark (both accepted) |
Aside |
type (one of: caution, note, tip, danger) |
title |
Code |
code + lang |
title, frame, mark, ins, del |
LinkCard |
title + href |
description, icon |
Card |
title |
icon |
Badge |
text |
variant |
Severities:
- Missing required attribute → WARNING
Screenshotmissingalt→ WARNING (accessibility)Asidewith invalidtypevalue → WARNINGCodewithcode={varName}but no matchingexport const→ ERROR
Read references/component-signatures.md for the full attribute
reference.
Check 5: Image Reference Validation
Find all image references in each file:
- Markdown syntax:
 - Component attributes:
light="/images/filename.png",dark="/images/filename.png" - Hero image HTML:
<img src="/images/filename.png"
For each reference, resolve the root-relative path against
docs/images/. Use Glob to verify the file exists:
Glob pattern: docs/images/<filename>
Severities:
- Image file not found → WARNING
- Image path not root-relative (missing leading
/) → INFO
Check 6: Structure Checks
docs/index.mdxmust exist — Use Glob to check fordocs/index.mdx. If missing → ERROR.Image directories must not contain MDX files — Glob for
docs/images/**/*.mdx. Any matches → WARNING.No orphan MDX files outside
docs/— Glob for*.mdxin the repo root. Any matches → INFO.
Check 7: Export/Code Block Validation
When a <Code> component uses a variable reference
(code={variableName}), verify that a matching
export const variableName = ... exists earlier in the same file.
Severity:
- Variable referenced in
<Code code={var}>without a matchingexport const var→ ERROR
Also check that export const blocks contain valid JavaScript
string literals (template literals or quoted strings). Malformed
exports will cause build failures.
Output Format
After running all checks, present findings in this format:
## MDX Content Review — <repo-name>
Reviewed N file(s). Found X error(s), Y warning(s), Z info(s).
### ERRORS (build-breaking)
- **file.mdx:L12** — Bare `<` outside code block: `< comparison`
- **file.mdx:L1** — Missing required `title` in frontmatter
### WARNINGS (likely issues)
- **file.mdx:L45** — Image not found: `/images/missing.png`
- **file.mdx:L8** — Unknown import source: `some-package`
### INFO (style suggestions)
- **file.mdx:L3** — Missing `sidebar.label` in frontmatter
- **file.mdx:L10** — Unused import: `Badge`
---
No errors found. ✓ (if clean)
If all files pass all checks, report:
## MDX Content Review — <repo-name>
Reviewed N file(s). No issues found. ✓