Agent skill
code-explanation
Explains complex code through clear narratives, visual diagrams, and step-by-step breakdowns. Use when user asks to explain code, understand algorithms, analyze design patterns, wants code walkthroughs, or mentions "explain this code", "how does this work", "code breakdown", or "understand this function".
Install this agent skill to your Project
npx add-skill https://github.com/joaquimscosta/arkhe-claude-plugins/tree/main/plugins/doc/skills/code-explanation
SKILL.md
Code Explanation
Expert skill for explaining complex code to developers at all levels through visual aids, step-by-step breakdowns, and progressive complexity.
Quick Start
1. Analyze Complexity First
Before explaining, assess the code:
- Lines of code and structural complexity
- Concepts used (async, decorators, generators, etc.)
- Design patterns present
- Difficulty level (beginner/intermediate/advanced)
2. Choose Explanation Depth
| Audience | Approach |
|---|---|
| Beginner | Start with analogies, avoid jargon, explain fundamentals |
| Intermediate | Focus on patterns and design decisions |
| Advanced | Deep dive into implementation details and trade-offs |
3. Use Visual Aids
Generate Mermaid diagrams for:
- Flow diagrams - Control flow and decision trees
- Class diagrams - Object relationships and inheritance
- Sequence diagrams - Method calls and interactions
4. Progressive Disclosure
Structure explanations from simple to complex:
- Overview - What does this code do? (1-2 sentences)
- Key Concepts - What programming concepts are used?
- Step-by-Step - Walk through the logic
- Deep Dive - Advanced details for those who want more
Output Format
Standard Explanation Structure
## What This Code Does
[1-2 sentence summary]
## Key Concepts
- Concept 1: Brief explanation
- Concept 2: Brief explanation
## Visual Overview
[Mermaid diagram if complexity warrants]
## Step-by-Step Breakdown
1. [First step with code reference]
2. [Second step with code reference]
...
## Common Questions
- Why is X done this way?
- What happens if Y?
## Related Patterns
[Links to similar patterns or alternatives]
Core Techniques
Explaining Algorithms
- State the problem being solved
- Show input → output transformation
- Visualize with step-by-step execution
- Analyze time/space complexity
Explaining Design Patterns
- Name the pattern
- Explain the problem it solves
- Show UML-style diagram
- List benefits and trade-offs
Explaining Complex Functions
- Signature and purpose
- Parameter meanings
- Return value
- Side effects (if any)
- Edge cases
Best Practices
- Use analogies - Compare to real-world concepts
- Show, don't just tell - Include code snippets
- Reference line numbers - Use
file_path:line_numberformat - Highlight gotchas - Point out non-obvious behavior
- Suggest improvements - When appropriate
Resources
- WORKFLOW.md - Detailed step-by-step methodology
- EXAMPLES.md - Comprehensive explanation examples
- TROUBLESHOOTING.md - Common issues and fixes
Integration
This skill auto-invokes when triggered by explanation-related keywords. For explicit control, use the /code-explain command.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
Skill Name
What this skill does. Use when user mentions "keyword1", "keyword2", or "keyword3". Keep under 1,024 characters and include specific trigger keywords.
plugin-release-checker
skill-validator
Validate skills against Anthropic best practices for frontmatter, structure, content, file organization, hooks, MCP, and security (62 rules in 8 categories). Use when creating new skills, updating existing skills, before publishing skills, reviewing skill quality, or when user mentions "validate skill", "check skill", "skill best practices", "skill review", or "lint skill".
sync-docs
Sync official Anthropic documentation and analyze impact on project components. Runs docs/reference/update-claude-docs.sh, computes diffs, and reports impacts on the skill validator, plugins, and project documentation. Use when user mentions "sync docs", "update reference docs", "refresh docs", or "check doc changes".
research-frontmatter
Enforce standard YAML frontmatter on research documents in docs/research/. Use when creating, editing, or promoting research files, when user mentions "research metadata", "research frontmatter", or "research staleness".
deep-research
Deep research on technical topics using EXA tools with intelligent two-tier caching. Use when user asks to research a topic, investigate best practices, look up information, find patterns, or explore architectures. Also invoked by /research command. Triggers: "research", "look up", "investigate", "deep dive", "find information about", "what are best practices for", "how do others implement".
Didn't find tool you were looking for?