Documentation Update Skill
This skill automatically regenerates documentation files in the docs/ directory by reading the marketplace catalog and applying Jinja2 templates.
Purpose
Maintain synchronized documentation by:
- Generating agent reference documentation
- Creating skill catalog documentation
- Building plugin directory
- Updating usage guides
- Ensuring consistency across all docs
When to Use
Use this skill when:
- A new plugin is added to the marketplace
- An existing plugin is updated (components added/removed)
- Agent or skill metadata changes
- Documentation needs to be regenerated
- Ensuring docs match marketplace state
Documentation Files
This skill generates four main documentation files:
1. agents.md
Complete reference of all agents across all plugins:
- Organized by plugin
- Lists agent name, description, and model
- Includes links to agent files
- Shows agent capabilities and use cases
2. agent-skills.md
Catalog of all skills with progressive disclosure details:
- Organized by plugin
- Lists skill name and description
- Shows "Use when" triggers
- Includes skill structure information
3. plugins.md
Directory of all plugins in the marketplace:
- Organized by category
- Shows plugin name, description, and version
- Lists components (agents, commands, skills)
- Provides installation and usage information
4. usage.md
Usage guide and command reference:
- Getting started instructions
- Command usage examples
- Workflow patterns
- Integration guides
Template Structure
Templates are stored in assets/ using Jinja2 syntax:
Template Variables
All templates receive the following context:
Python Script
The skill includes a Python script doc_generator.py that:
-
Loads marketplace.json
- Reads the marketplace catalog
- Validates structure
- Builds component index
-
Scans Plugin Files
- Reads agent/command frontmatter
- Extracts skill metadata
- Builds comprehensive component list
-
Prepares Template Context
- Organizes plugins by category
- Creates component indexes
- Calculates statistics
-
Renders Templates
- Applies Jinja2 templates
- Generates documentation files
- Writes to docs/ directory
Usage
Integration with Commands
The /claude-plugin:create and /claude-plugin:update commands should invoke this skill automatically after marketplace updates:
Workflow
Example Integration
Template Examples
agents.md.j2
agent-skills.md.j2
Error Handling
Marketplace Not Found
Template Not Found
Invalid Plugin Structure
Frontmatter Parse Error
Best Practices
-
Always Regenerate After Changes
- Run after every plugin add/update/remove
- Ensure docs stay synchronized
- Commit documentation with plugin changes
-
Validate Before Generation
- Run marketplace validation first
- Fix any errors or warnings
- Ensure all files exist
-
Review Generated Output
- Check generated files for correctness
- Verify formatting and links
- Test any code examples
-
Template Maintenance
- Keep templates simple and readable
- Use consistent formatting
- Document template variables
-
Version Control
- Commit documentation changes
- Include in pull requests
- Document significant changes
Template Customization
Adding New Sections
To add a new section to a template:
-
Modify Template
-
Update Context (if needed)
- Add new data to template context in doc_generator.py
- Process additional metadata
-
Test Output
- Run generator with dry-run
- Verify formatting
- Check for errors
Creating New Templates
To add a new documentation file:
-
Create Template
- Add
assets/newdoc.md.j2
- Define structure and content
-
Update Script
- Add to doc_generator.py template list
- Define output path
-
Test Generation
- Run generator
- Verify output
- Commit template and output
File Structure
Requirements
- Python 3.8+
- No external dependencies (uses standard library only)
- Access to
.claude-plugin/marketplace.json
- Read access to plugin directories
- Write access to
docs/ directory
Success Criteria
After running this skill:
- ✓ All documentation files generated
- ✓ Content matches marketplace state
- ✓ All links are valid
- ✓ Formatting is consistent
- ✓ Statistics are accurate
- ✓ No template rendering errors
Maintenance
Updating Templates
When marketplace structure changes:
-
Assess Impact
- Identify affected templates
- Determine required changes
-
Update Templates
- Modify Jinja2 templates
- Test with current data
-
Update Script
- Adjust context preparation if needed
- Add new data processing
-
Validate Output
- Regenerate all docs
- Review changes
- Test links and formatting
Version Compatibility
- Templates should handle missing fields gracefully
- Use Jinja2 default filters for optional data
- Validate marketplace version compatibility
Example Output
The skill generates comprehensive, well-formatted documentation:
- agents.md: ~500-1000 lines for 20-30 agents
- agent-skills.md: ~300-600 lines for 30-50 skills
- plugins.md: ~400-800 lines for 10-20 plugins
- usage.md: ~200-400 lines of usage information
All files include:
- Clear structure and headings
- Formatted tables where appropriate
- Links to source files
- Statistics and metadata
- Last updated timestamp