Markdown File Validation

VerifiedSafe

Validates Markdown files with YAML frontmatter against JSON Schema definitions. Run a Python script in a directory containing a schema.yaml file to check all Markdown files for errors. Useful for maintaining consistent structured content.

Sby Skills Guide Bot
DocumentationBeginner
306/2/2026
Claude Code
#markdown-validation#yaml-frontmatter#json-schema#content-quality

Recommended for

Our review

Validates Markdown files with YAML frontmatter against JSON Schema definitions.

Strengths

  • Automates quality checks for structured content in Markdown files.
  • Provides clear error messages with field path and file location.
  • Simple single-command usage.

Limitations

  • Requires a schema.yaml file in the target directory.
  • Depends on Python and the pyyaml and jsonschema libraries.
  • Only validates YAML frontmatter, not the Markdown body.
When to use it

To validate structured Markdown files with YAML metadata (e.g., CRM entries, documentation pages) in a repeatable manner.

When not to use it

For validating free-form Markdown content without frontmatter or when the schema is unknown.

Security analysis

Safe
Quality score85/100

The skill instructs running a Python validation script on markdown files; no destructive, exfiltrating, or obfuscated actions are present. The script is not included, but the skill itself contains no malicious instructions.

No concerns found

Examples

Validate all files in a directory
Run validation on the crm/contacts directory to check all markdown files against the schema.
Fix a missing required field
Validate the crm/opportunities directory and fix any missing required fields like 'stage'.

name: validate-md description: Validates markdown files with YAML frontmatter against JSON Schema definitions. allowed-tools: [Bash, Read, Glob]

Validating Markdown Files

Instructions

  1. Run validation script for the target directory containing a schema.yaml file:

    python validate-md.py <directory>
    
  2. Review results:

    • Success: ✓ OK: filename.md is valid
    • Errors: Shows validation error, field path, and file location

Examples

Example 1: Validate contacts directory

python validate-md.py crm/contacts

Output:

✓ OK: smith-john.md is valid
✓ OK: doe-jane.md is valid
✓ SUCCESS: All 2 files are valid!

Example 2: Validation error - missing required field

python validate-md.py crm/opportunities

Output:

❌ deal-2024-q1.md validation error: 'stage' is a required property
   In file: crm/opportunities/deal-2024-q1.md

Fix: Add stage: qualified to the frontmatter.

Scripts

  • validate-md.py the python validation script

Required Python Packages

  • pyyaml - for parsing YAML frontmatter
  • jsonschema - for validating against JSON Schema
Related skills