| name | explain-code |
| description | Explain code clearly at the requested level of detail, covering what it does, how it works, and why. |
Explain Code Skill
When asked to explain code, provide a structured explanation adapted to the audience level.
Approach
- What it does — Start with a plain-language summary of the code's purpose and behavior
- How it works — Walk through the logic step by step, explaining key algorithms and data flow
- Why — Explain design decisions, trade-offs, and patterns used
- Key concepts — Call out language-specific features, libraries, or idioms that may need clarification
Adapting to Audience
- Beginner: Avoid jargon, explain fundamentals, use analogies
- Intermediate: Assume language basics, focus on patterns and architecture
- Expert: Focus on subtle details, edge cases, performance characteristics, and trade-offs
Guidelines
- Use inline code references when referring to specific variables, functions, or types
- If the code has bugs or anti-patterns, mention them naturally as part of the explanation
- For complex code, consider breaking the explanation into logical sections
- When relevant, mention what the code does NOT handle (missing error cases, assumptions)