skill-doc-generator
Scannednpx machina-cli add skill freitasp1/claude-code-skills/skill-doc-generator --openclawSkill Documentation Generator
Auto-generate high-quality README documentation for skills with built-in consistency validation and example generation.
Overview
This skill automates the creation of standardized README files for skills by analyzing SKILL.md files, extracting structure and examples, validating quality standards, and generating comprehensive documentation. It ensures consistency across skill documentation while providing actionable validation feedback.
Workflow
Single Skill Documentation
Generate documentation for one skill:
-
Analyze the skill:
python scripts/analyze_skill.py <skill_directory>Extracts metadata, sections, code blocks, and resources.
-
Validate consistency:
python scripts/validate_consistency.py <skill_directory> --verboseChecks frontmatter, description quality, and terminology.
-
Generate README:
python scripts/generate_readme.py <skill_directory> [output_path]Creates README.md with validation results.
Batch Documentation
Document multiple skills at once:
python scripts/document_directory.py <directory> [options]
Options:
--output <dir>: Specify output directory--no-recursive: Don't search subdirectories--no-index: Skip index file generation--no-validate: Skip validation checks
Example:
# Document all user skills with validation
python scripts/document_directory.py /mnt/skills/user --output ./docs
# Quick pass without validation
python scripts/document_directory.py ./my-skills --no-validate
Script Reference
analyze_skill.py
Parses SKILL.md and extracts structured information.
Usage: python scripts/analyze_skill.py <skill_directory>
Returns:
- Metadata (name, description)
- Sections and structure
- Code blocks with language tags
- Referenced resources (scripts, references, assets)
- Statistics (line count, section count)
validate_consistency.py
Validates skill quality against standards defined in references/consistency-rules.md.
Usage: python scripts/validate_consistency.py <skill_directory> [--verbose]
Checks:
- Frontmatter completeness and format
- Description quality (length, clarity, triggers)
- Structure appropriateness
- Terminology consistency
- Resource references
- Code example quality
Severity Levels:
- ERROR: Breaks functionality (missing required fields)
- WARNING: Quality issues (naming, unreferenced resources)
- INFO: Suggestions (style, optional improvements)
generate_readme.py
Creates README.md from skill analysis.
Usage: python scripts/generate_readme.py <skill_directory> [output_path]
Generates:
- Title and description
- Overview from SKILL.md
- Trigger scenarios
- Structure statistics
- Bundled resource lists with links
- Key sections overview
- Usage examples (up to 3)
- Validation results (optional)
Template: See references/readme-template.md for structure.
document_directory.py
Batch processes multiple skills in a directory.
Usage: python scripts/document_directory.py <directory> [options]
Features:
- Recursive skill discovery
- Parallel validation and documentation
- Index generation with categorization
- Summary statistics
- Error handling per skill
Quality Standards
Validation enforces these standards:
Frontmatter
- name: Lowercase with hyphens (e.g.,
skill-name) - description: 50-500 chars, clear triggers
- Must start with capital letter
- Include "when" or "use" phrases
Structure
- Body: 100+ chars minimum, <500 lines recommended
- Sections: Overview/workflow recommended
- Resources: All files referenced in SKILL.md
Terminology
- Use imperative form: "Use" not "You should use"
- Capitalize "Claude" consistently
- Avoid vague terms: "various", "multiple"
- Active voice preferred
See references/consistency-rules.md and references/terminology-standards.md for complete standards.
Reference Files
readme-template.md
Standard README structure and best practices. Defines:
- Required sections
- Optional sections
- Formatting guidelines
- Link conventions
consistency-rules.md
Detailed validation criteria. Covers:
- Frontmatter requirements
- Description quality metrics
- Structure guidelines
- Resource validation
- Error severity definitions
terminology-standards.md
Standard vocabulary and style guide. Includes:
- Writing style (imperative form)
- Common terms and their usage
- Phrases to avoid
- Formatting conventions
- Consistency checklist
Examples
Example 1: Document a Single Skill
# Analyze
python scripts/analyze_skill.py ./my-skill
# Validate
python scripts/validate_consistency.py ./my-skill --verbose
# Generate README
python scripts/generate_readme.py ./my-skill
Example 2: Batch Process with Index
# Document all skills in a directory
python scripts/document_directory.py /mnt/skills/user \
--output ./documentation \
--recursive
Example 3: Quick Validation Pass
# Just validate without generating docs
python scripts/validate_consistency.py ./my-skill
Common Use Cases
New skill creation: Generate documentation as part of skill development Quality audits: Validate existing skills against standards Documentation updates: Regenerate READMEs after SKILL.md changes Batch operations: Document entire skill libraries CI/CD integration: Automated validation in deployment pipelines
Tips
- Run validation before generating documentation to catch issues early
- Use
--verboseflag to see INFO-level suggestions - Reference files provide the "why" behind validation rules
- Generated READMEs include validation results for transparency
- Index files help navigate large skill collections
Source
git clone https://github.com/freitasp1/claude-code-skills/blob/main/skills/doc-generator/skill-doc-generator/SKILL.mdView on GitHub Overview
Skill Documentation Generator automates standardized README creation by analyzing SKILL.md files, extracting metadata, sections, code blocks, and resources. It validates frontmatter and terminology to ensure quality, then generates comprehensive READMEs with usage examples for a single skill or an entire directory.
How This Skill Works
It uses three scripts: analyze_skill.py to parse SKILL.md and collect structure, validate_consistency.py to check quality against rules, and generate_readme.py to render a README.md with validation results. The process outputs structured metadata, section details, and linked resources that are incorporated into the documentation.
When to Use It
- Document a single skill by analyzing its SKILL.md and generating a README.md with validation feedback.
- Document multiple skills in a directory, producing consistent READMEs and an index.
- Validate frontmatter, terminology, and description quality before publishing docs.
- Generate READMEs that include usage examples and resource links from the SKILL.md.
- Refresh documentation across a catalog after updates to SKILL.md metadata or standards.
Quick Start
- Step 1: Analyze the skill directory: python scripts/analyze_skill.py <skill_directory>
- Step 2: Validate consistency: python scripts/validate_consistency.py <skill_directory> --verbose
- Step 3: Generate README: python scripts/generate_readme.py <skill_directory> [output_path]
Best Practices
- Ensure each SKILL.md includes clear metadata and defined triggers in descriptions.
- Run analyze_skill.py first to understand the skill's structure before generating docs.
- Use validate_consistency.py with --verbose to surface naming and resource issues.
- Keep code blocks, resources, and references up to date to reflect current behavior.
- Use generate_readme.py to produce READMEs that conform to the reference template and include examples.
Example Use Cases
- Auto-generate a README for the skill-doc-generator by analyzing its SKILL.md and validating consistency.
- Document all user skills in /mnt/skills/user and output the READMEs to ./docs with an index file.
- Do a quick pass on a new skill with a skip-validation run to surface only structural issues.
- Refresh READMEs for a directory after updating multiple SKILL.md files to reflect new terminology.
- Generate usage examples in READMEs to demonstrate typical workflows with linked resources.