Validate markdown documentation files for formatting issues, syntax errors, broken links, and quality standards...
This skill provides comprehensive markdown validation capabilities for documentation files.
Use markdown-validation when:
The validation script runs automatically when triggered by hooks on markdown file edits.
Validate a single file:
./docs/skills/markdown-validation/scripts/validate-markdown.py path/to/file.md
Validate multiple files:
./docs/skills/markdown-validation/scripts/validate-markdown.py file1.md file2.md file3.md
Validate a directory:
find docs/ -name "*.md" -exec ./docs/skills/markdown-validation/scripts/validate-markdown.py {} +
Validation results are returned in structured format:
✅ path/to/file.md - PASS
❌ path/to/other.md - FAIL
Line 15: Header level skipped (h1 -> h3)
Line 42: Broken internal link: [docs/missing.md](docs/missing.md)
Line 87: Unclosed code fence
This skill works best when integrated with PostToolUse hooks:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [{
"type": "command",
"command": "if echo \"$CLAUDE_TOOL_INPUT\" | grep -q '\\.md\"'; then $CLAUDE_PROJECT_DIR/docs/skills/markdown-validation/scripts/validate-markdown.py \"$(echo \"$CLAUDE_TOOL_INPUT\" | grep -o '\"[^\"]*\\.md\"' | tr -d '\"')\"; fi"
}]
}
]
}
}
Problem: # Header 1 followed by ### Header 3 (skipped h2)
Fix: Maintain sequential header hierarchy
Problem: Link points to non-existent file Fix: Update link target or create missing file
Problem: opened but not closed **Fix**: Add closing after code block
Problem: Code fence missing language identifier
Fix: Add language: python, bash, ```javascript
Create .markdown-validation.json in project root to customize validation:
{
"checkLinks": true,
"checkSyntax": true,
"requireFrontmatter": false,
"allowedHeaderLevels": [1, 2, 3, 4, 5, 6],
"requireLanguageTags": true,
"maxLineLength": null
}
references/markdown-spec.mdreferences/documentation-standards.md