Refactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component...
npx skills add trotsky1997/My-Claude-Agent-Skills --skill "doc-to-skill"
Install specific skill from multi-skill repository
# Description
Convert documentation into structured Agent Skills following progressive disclosure principles. Use when (1) Converting user documentation or guides into skills, (2) Creating skills from existing technical documentation, (3) Organizing knowledge into skill format with references, (4) Applying skill design principles to documentation, (5) Structuring information for AI agent consumption, (6) Creating skills that follow best practices for context efficiency
# SKILL.md
name: doc-to-skill
description: Convert documentation into structured Agent Skills following progressive disclosure principles. Use when (1) Converting user documentation or guides into skills, (2) Creating skills from existing technical documentation, (3) Organizing knowledge into skill format with references, (4) Applying skill design principles to documentation, (5) Structuring information for AI agent consumption, (6) Creating skills that follow best practices for context efficiency
metadata:
short-description: Convert documentation to Agent Skills format
Documentation to Skill Converter
Transform documentation into structured Agent Skills using progressive disclosure and context-efficient design principles.
Quick Start
Conversion workflow:
- Analyze source document structure and content
- Extract core workflows (20% that solves 80%)
- Create SKILL.md with essential content (<500 lines)
- Move detailed content to references/ files
- Write comprehensive description with trigger scenarios
- Validate and package
Key principle: Progressive disclosure - metadata β SKILL.md β references/ (loaded only when needed)
Core Conversion Process
Step 1: Analyze Source Document
Identify structure:
- Document length and sections
- Information hierarchy (intro β basics β advanced)
- Most frequently used content (80/20 rule)
- Detailed reference material
Questions to answer:
- What are the core workflows? (most common tasks)
- What's reference material? (complete command lists, detailed specs)
- What triggers this skill? (when would someone need this?)
Step 2: Extract Core Content
For SKILL.md (keep essential only):
- Quick start / getting started
- Core workflows (most common tasks)
- Essential commands/operations
- Basic configuration
- Common patterns
- Troubleshooting basics
- References to detailed docs
Extraction criteria:
- Used in 80% of cases β SKILL.md
- Used in 20% of cases β references/
- Quick reference needed β SKILL.md
- Complete reference β references/
Step 3: Write Frontmatter
Description format:
description: [What it does]. Use when (1) [Scenario 1], (2) [Scenario 2], (3) [Scenario 3]...
Requirements:
- Clear "what it does" statement
- Numbered list of trigger scenarios
- Include all use cases (this is the trigger mechanism)
- No colons in description field
Example:
description: Comprehensive guide for using GitHub CLI (gh) to interact with GitHub from the command line. Use when (1) Managing GitHub repositories, issues, pull requests, or releases from terminal, (2) Automating GitHub workflows in scripts, (3) Creating or managing pull requests, (4) Working with GitHub issues, (5) Creating releases or managing repository operations, (6) Integrating GitHub operations into development workflows, (7) Using GitHub CLI commands in automation scripts
Step 4: Structure SKILL.md
Recommended structure:
# [Title]
[Brief overview - 1-2 sentences]
## Quick Start
[Most common operations - 5-10 examples]
## Core Workflows
[Organized by task category]
## Configuration
[Essential settings]
## Advanced Usage
[Optional - only if needed]
## Common Patterns
[Best practices]
## Troubleshooting
[Common issues]
## References
[Links to references/ files]
Guidelines:
- Keep under 500 lines (ideally 200-300)
- Prioritize actionable content (commands, examples)
- Use code blocks for all examples
- Reference detailed docs, don't duplicate
Step 5: Create References
When to create references/ files:
- Complete command/API reference
- Detailed workflow scenarios
- Advanced patterns and examples
- Large reference material (>100 lines)
File organization:
references/commands.md- Complete command/API referencereferences/workflows.md- Detailed workflow scenariosreferences/advanced.md- Advanced patterns (if needed)
Reference file structure:
# [Title]
## [Category 1]
[Detailed content]
## [Category 2]
[Detailed content]
Step 6: Link References
In SKILL.md, add references section:
## References
For detailed information, see:
- [commands.md](references/commands.md) - Complete command reference
- [workflows.md](references/workflows.md) - Detailed workflow scenarios
Design Principles
1. Progressive Disclosure
Three-level loading:
- Metadata (name + description) - Always loaded (~100 words)
- SKILL.md body - Loaded when skill triggers (<500 lines)
- references/ - Loaded only when needed (unlimited)
Benefit: Minimizes context window usage while maintaining completeness.
2. 80/20 Rule
- 20% of content (most common) β SKILL.md
- 80% of content (detailed) β references/
Example:
- SKILL.md:
gh pr create,gh pr list,gh pr merge(most common) - references/: All PR commands with all flags and options
3. Actionability First
Prioritize:
- β Executable commands/code
- β Real-world examples
- β Common patterns
- β Theoretical explanations
- β Edge cases (move to references)
4. No Duplication
Rule: Information lives in ONE place only.
- SKILL.md = Quick reference, essential workflows
- references/ = Complete documentation, detailed specs
Avoid: Copying same content to both places.
5. Trigger Clarity
Description must include:
- What the skill does
- When to use it (numbered scenarios)
- All relevant use cases
Why: Description is the ONLY trigger mechanism - Codex uses it to decide when to load the skill.
Conversion Checklist
Pre-Conversion
- Analyzed source document structure
- Identified core workflows (80/20)
- Listed all trigger scenarios
- Planned file organization
Frontmatter
namefield (lowercase, hyphenated)descriptionwith "Use when" scenariosmetadata.short-description- No colons in description
- All use cases listed
SKILL.md
- Under 500 lines (ideally 200-300)
- Quick Start section
- Core workflows organized
- Actionable examples (code blocks)
- References section linking to references/
- No duplication with references/
References
- Created references/ directory
- Detailed content moved to references/
- Files properly named and organized
- Linked from SKILL.md
Validation
- Frontmatter format correct
- All references valid
- Code examples tested
- Skill packages successfully
Common Patterns
Pattern 1: Command-Line Tool Documentation
Source: CLI tool manual (e.g., gh, git, docker)
Structure:
- SKILL.md: Most common commands, basic workflows
- references/commands.md: Complete command reference with all flags
- references/workflows.md: Common usage patterns
Pattern 2: API Documentation
Source: API reference documentation
Structure:
- SKILL.md: Quick start, common operations, authentication
- references/api.md: Complete API reference
- references/examples.md: Code examples
Pattern 3: Framework Guide
Source: Framework documentation (e.g., React, Django)
Structure:
- SKILL.md: Core concepts, common patterns
- references/concepts.md: Detailed concepts
- references/patterns.md: Advanced patterns
- references/api.md: API reference
Pattern 4: Workflow Documentation
Source: Process/workflow documentation
Structure:
- SKILL.md: Main workflow steps, decision points
- references/workflows.md: Detailed workflow scenarios
- references/troubleshooting.md: Common issues
Examples
Before (Documentation)
# Tool Guide (500 lines)
## Introduction (50 lines)
## Installation (100 lines)
## Basic Usage (150 lines)
## Advanced Features (200 lines)
After (Skill)
SKILL.md (200 lines)
βββ Quick Start
βββ Core Workflows
βββ Common Patterns
βββ References β references/
references/
βββ installation.md (100 lines)
βββ advanced.md (200 lines)
βββ complete-reference.md (150 lines)
Tools and Commands
Initialize skill:
python init_skill.py <skill-name> --path <path> --resources references
Package skill:
python package_skill.py <path/to/skill>
Validate frontmatter:
python quick_validate.py <path/to/SKILL.md>
References
For detailed conversion methodology and examples, see:
- methodology.md - Complete conversion methodology
- checklist.md - Detailed conversion checklist
- examples.md - Real conversion examples
- patterns.md - Common conversion patterns
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.