Markdown content validator

From lightspeedwp/.github · View interactive version

Markdown content validator is an AI agent skill from the GitHub repository lightspeedwp/.github. validate markdown and documentation files for formatting quality, heading structure, yaml frontmatter schema compliance, required semver version fields, version increments, malformed links, missing metadata, invalid values, and consolidated content quality reporting.

How to use this skill

Skill file

Markdown Content Validator

Use this skill when the user wants to create, update, run, or adapt a reusable validator for markdown-based documentation, templates, prompts, handoff packs, and other content files before they are shipped, committed, published, or handed to another agent.

When to use it

Use this skill for requests such as:

What it scans

By default, validate markdown-oriented files recursively under the requested target path.

Treat .md, .markdown, and .mdx as the default file types unless the project already uses a stronger documented convention. Respect include and exclude globs when the user or project provides them.

Workflow

  1. Identify the target directory, the schema path, whether version-increment checks should be enforced, and whether a base reference is available.
  2. Read references/frontmatter.schema.yaml as the default schema unless the project already has a stronger compatible schema.
  3. Read references/markdown-validation-rules.md to understand which checks are blocking errors, warnings, or style suggestions.
  4. Run scripts/validate_markdown_content.py with the requested target and options.
  5. Produce or update one consolidated markdown report.
  6. Suggest fixes without modifying files unless the user explicitly asks for auto-fix behavior.

Markdown validation

Define markdown validation rules from project context first, then fall back to the practical defaults in references/markdown-validation-rules.md.

The validator should prefer maintainable, testable checks that catch common content-quality problems, especially:

Not every issue must be a hard failure. Keep the distinction between blocking errors, warnings, and style suggestions.

Frontmatter validation

Require YAML frontmatter at the very top of each validated file.

Apply these rules:

Read schema rules from references/frontmatter.schema.yaml instead of hard-coding project-specific frontmatter rules in the script.

SemVer version checks

Require a version frontmatter field and validate it against the schema pattern.

When version-increment checking is enabled and a previous file state is available, compare the current file with the base reference. Warn or fail when the file changed without a version increment.

Use these interpretation rules when suggesting the next version:

If no previous file state is available, do not guess. Report that version-increment verification could not be completed.

Reports

Always produce one consolidated markdown report with:

Follow references/example-validation-report.md for the default report shape.

Auto-fix behavior

Do not modify files unless the user explicitly asks for auto-fix behavior.

If auto-fix is explicitly requested, only apply low-risk fixes such as:

Do not increment versions automatically unless the user provides or confirms the intended change type: major, minor, or patch.

Supporting Files

How to run it

Typical CLI usage:

python scripts/validate_markdown_content.py \
  --target files \
  --schema references/frontmatter.schema.yaml \
  --report markdown-content-validation-report.md \
  --enforce-version-increment \
  --base-ref main

Exit codes:

Have questions? Ping us on GitHub! 🐙 Made with 💚 by LightSpeedWP

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.