Markdown content validator

From lightspeedwp/.github · View interactive version

Markdown content validator is an AI agent skill from the GitHub repository lightspeedwp/.github. The Markdown Content Validator helps ensure your markdown files and their YAML frontmatter meet necessary standards before publication or handoff, providing a detailed report on any issues found. Use this skill when you need to validate documentation, templates, or prompts for errors, missing fields

How to use this skill

Skill file

Markdown Content Validator

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

When to Use This Skill

Use this skill when the request involves any of the following:

Do not modify content files unless the user explicitly requests auto-fix behaviour.

What This Skill Scans

Target markdown-oriented content files recursively from a supplied root path.

By default, treat these as in scope when they match include globs:

Allow the user to narrow or widen the file set with include and exclude globs.

Workflow

  1. Identify the target directory, schema path, report path, and whether version-increment enforcement is requested.
  2. Read references/frontmatter.schema.yaml as the default source of truth for frontmatter requirements unless the project already has a stronger compatible schema.
  3. Use references/markdown-validation-rules.md to decide which markdown checks should be blocking errors, warnings, or style suggestions.
  4. Run scripts/validate_markdown_content.py with explicit CLI arguments rather than relying on hard-coded defaults.
  5. Review the consolidated markdown report before presenting results.
  6. Suggest low-risk fixes, but do not modify source files unless the user explicitly asks for auto-fix behaviour.
  7. If the user asks for auto-fix, limit automatic changes to low-risk formatting and missing metadata that can be added safely. Do not infer a SemVer bump type without user confirmation when it materially affects meaning.

How Markdown Validation Is Defined

The validator should use practical, project-appropriate checks instead of over-prescribing style rules.

Treat the default rules in references/markdown-validation-rules.md as the baseline. They separate checks into:

Prefer blocking checks for structural problems that make content unreliable or invalid, such as missing frontmatter, invalid YAML, invalid schema values, invalid SemVer strings, unclosed code fences, or missing linked internal files.

Prefer warnings or suggestions for editorial consistency checks such as long headings, duplicate headings, mixed bullet markers, repeated blank lines, or inconsistent table structure.

How Frontmatter Validation Works

Every validated file must start with YAML frontmatter bounded by triple dashes.

The validator must confirm that frontmatter:

If frontmatter is missing, misplaced, malformed, or incompatible with the schema, report it clearly and include a suggested fix when one is practical.

How SemVer Version Checks Work

Require a version frontmatter field in every validated file.

Validate the value using SemVer MAJOR.MINOR.PATCH.

When --enforce-version-increment is enabled and a base reference is available, compare the current file against the prior version from Git. If the file changed but the version field did not change, report that as a blocking issue.

If a previous file state is unavailable, warn instead of guessing. Use this wording:

Version increment could not be verified because no previous version was available.

Use references/semver-versioning-rules.md when explaining how to choose a major, minor, or patch bump.

How To Customise The Schema

The default schema lives at references/frontmatter.schema.yaml.

If the project already has a stronger compatible schema, preserve it or merge in only the missing compatible defaults.

Use references/schema-customisation.md when the user asks to:

Do not hard-code project-specific schema rules into the script. Keep them in the schema file.

How To Interpret Reports

The validator produces one consolidated markdown report with:

Use references/example-validation-report.md as the reference shape for the final report.

Suggesting Fixes

Suggest fixes when the validator finds:

Prefer suggestions and examples over direct file edits unless the user explicitly requests auto-fix behaviour.

When Not To Modify Files

Do not modify files when:

Running The Script

Example:

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

Use explicit include and exclude globs whenever the folder contains mixed content.

Supporting Files


Maintained by the 🤖 LightSpeedWP Automation Team

_Maintained with ❤️ by the 🚀 LightSpeedWP Automation Team_

Org Profile

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.