Validates documentation against type-specific rules and schemas loaded dynamically, checking frontmatter, structure, content, and schema compliance
Validates documentation against type-specific rules and schemas loaded dynamically. Used when you need to check markdown files for frontmatter, structure, content, and schema compliance before committing or publishing.
/plugin marketplace add fractary/claude-plugins/plugin install fractary-docs@fractaryThis skill inherits all available tools. When active, it can use any tool Claude has access to.
docs/validation-rules.mdscripts/check-frontmatter.shscripts/check-links.shscripts/lint-markdown.shscripts/validate-structure.shPurpose: Validate documentation against type-specific rules and schemas.
Architecture: Operation-specific skill (Layer 3) - loads validation rules from types/{doc_type}/validation-rules.md.
Refactored: 2025-01-15 - Now type-agnostic, loads validation rules dynamically. </CONTEXT>
<CRITICAL_RULES>
Type Context Loading
types/{doc_type}/validation-rules.mdtypes/{doc_type}/schema.jsonComprehensive Validation
Single Document Focus
Existing Scripts
{
"validation": {
"lint_on_generate": true,
"check_links_on_generate": false,
"required_sections": {
"adr": ["Status", "Context", "Decision", "Consequences"],
"design": ["Overview", "Architecture", "Implementation"],
"runbook": ["Purpose", "Prerequisites", "Steps", "Troubleshooting"],
"api-spec": ["Overview", "Endpoints", "Authentication"],
"test-report": ["Summary", "Test Cases", "Results"],
"deployment": ["Overview", "Infrastructure", "Deployment Steps"]
},
"status_values": {
"adr": ["proposed", "accepted", "deprecated", "superseded"]
}
}
}
</CONFIGURATION>
<WORKFLOW>
For each validation request, execute these steps:
Start Message:
π― STARTING: Documentation Validation
Target: {file_or_directory}
Checks: {checks_list}
βββββββββββββββββββββββββββββββββββββββ
Check required parameters:
target: File path or directory (required)checks: Array of checks to run (optional, default: all)doc_type: Expected document type (optional, for structure validation)strict: Treat warnings as errors (optional, default: false)Validation Checks Available:
markdown-lint: Markdown syntax and stylefrontmatter: Front matter structure and required fieldsstructure: Required sections per document typelinks: Internal and external link validityall: Run all checks (default)Single File:
if [[ -f "$TARGET" ]]; then
validate_single_file "$TARGET"
fi
Directory:
if [[ -d "$TARGET" ]]; then
find "$TARGET" -name "*.md" -type f | while read file; do
validate_single_file "$file"
done
fi
For each file, run requested checks:
Invoke lint-markdown.sh:
./skills/doc-validator/scripts/lint-markdown.sh --file "$FILE_PATH"
Checks:
Returns:
{
"success": true,
"file": "/path/to/doc.md",
"issues": [
{
"line": 42,
"rule": "MD013",
"severity": "warning",
"message": "Line length exceeds 120 characters"
}
]
}
Invoke check-frontmatter.sh:
./skills/doc-validator/scripts/check-frontmatter.sh --file "$FILE_PATH"
Checks:
Returns:
{
"success": true,
"file": "/path/to/doc.md",
"has_frontmatter": true,
"issues": [
{
"field": "status",
"severity": "error",
"message": "Invalid status value 'draft' for type 'adr'. Valid: proposed, accepted, deprecated, superseded"
}
]
}
Invoke validate-structure.sh:
./skills/doc-validator/scripts/validate-structure.sh \
--file "$FILE_PATH" \
--doc-type "$DOC_TYPE" \
--required-sections "$REQUIRED_SECTIONS_JSON"
Checks:
Returns:
{
"success": true,
"file": "/path/to/doc.md",
"doc_type": "adr",
"sections_found": ["Status", "Context", "Decision", "Consequences"],
"issues": [
{
"section": "Alternatives Considered",
"severity": "warning",
"message": "Recommended section missing"
}
]
}
Invoke check-links.sh:
./skills/doc-validator/scripts/check-links.sh \
--file "$FILE_PATH" \
--check-external "$CHECK_EXTERNAL"
Checks:
Returns:
{
"success": true,
"file": "/path/to/doc.md",
"links_checked": 12,
"issues": [
{
"line": 45,
"link": "../api/missing-api.md",
"severity": "error",
"message": "Broken internal link: file not found"
}
]
}
Collect all issues from all checks:
{
"files_checked": 15,
"files_passed": 12,
"files_failed": 3,
"total_issues": 8,
"issues_by_severity": {
"error": 2,
"warning": 4,
"info": 2
},
"issues": [...]
}
Logic:
"failed""warnings""passed""passed"Strict Mode:
"failed" if errors OR warningsβ
COMPLETED: Documentation Validation
Files Checked: {count}
Status: {passed/warnings/failed}
Issues: {total} ({errors} errors, {warnings} warnings)
βββββββββββββββββββββββββββββββββββββββ
Next: Review issues and fix errors
Return JSON with all issues:
{
"success": true,
"operation": "validate-directory",
"target": "docs/",
"files_checked": 15,
"files_passed": 12,
"files_failed": 3,
"total_issues": 8,
"issues_by_severity": {
"error": 2,
"warning": 4,
"info": 2
},
"validation_status": "warnings",
"issues": [
{
"file": "docs/architecture/adrs/ADR-001.md",
"line": 42,
"severity": "error",
"check": "structure",
"message": "Missing required section: Consequences"
},
{
"file": "docs/api/user-api.md",
"line": 15,
"severity": "warning",
"check": "markdown-lint",
"rule": "MD013",
"message": "Line length exceeds 120 characters"
}
],
"timestamp": "2025-01-15T12:00:00Z"
}
</WORKFLOW>
<VALIDATION_RULES>
Required Sections:
Recommended Sections:
Required Front Matter Fields:
Validation Rules:
Required Sections:
Recommended Sections:
Required Front Matter Fields:
Validation Rules:
Required Sections:
Recommended Sections:
Required Front Matter Fields:
Validation Rules:
Required Sections:
Recommended Sections:
Required Front Matter Fields:
Validation Rules:
Required Sections:
Recommended Sections:
Required Front Matter Fields:
Validation Rules:
Required Sections:
Recommended Sections:
Required Front Matter Fields:
Validation Rules:
</VALIDATION_RULES>
<SCRIPTS> This skill uses 4 scripts in skills/doc-validator/scripts/:lint-markdown.sh:
check-frontmatter.sh:
validate-structure.sh:
check-links.sh:
All scripts return structured JSON. </SCRIPTS>
<OUTPUTS> **Success Response (No Issues)**: ```json { "success": true, "operation": "validate-single", "file": "docs/architecture/adrs/ADR-001.md", "validation_status": "passed", "checks_run": ["markdown-lint", "frontmatter", "structure", "links"], "total_issues": 0, "issues": [] } ```Success Response (With Issues):
{
"success": true,
"operation": "validate-directory",
"target": "docs/",
"files_checked": 15,
"files_passed": 12,
"files_failed": 3,
"validation_status": "warnings",
"total_issues": 8,
"issues_by_severity": {
"error": 2,
"warning": 4,
"info": 2
},
"issues": [
{
"file": "docs/architecture/adrs/ADR-001.md",
"line": null,
"severity": "error",
"check": "structure",
"message": "Missing required section: Consequences"
},
{
"file": "docs/api/user-api.md",
"line": 42,
"severity": "warning",
"check": "markdown-lint",
"rule": "MD013",
"message": "Line length exceeds 120 characters"
}
]
}
Error Response:
{
"success": false,
"operation": "validate-single",
"error": "File not found: docs/missing.md",
"error_code": "FILE_NOT_FOUND"
}
</OUTPUTS>
<ERROR_HANDLING>
<BEST_PRACTICES>
Use when working with Payload CMS projects (payload.config.ts, collections, fields, hooks, access control, Payload API). Use when debugging validation errors, security issues, relationship queries, transactions, or hook behavior.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.