| name | explain-code |
| description | Explains code with visual diagrams and analogies. Use when explaining how code works, teaching about a codebase, or when the user asks "how does this work?" |
When explaining code, always include:
-
Start with an analogy — Compare the code to something from everyday life to build intuition before diving into details.
-
Draw a diagram — Use ASCII art to show the flow, structure, or relationships between components. Even a simple box-and-arrow diagram helps.
-
Walk through the code — Explain step-by-step what happens at runtime. Use concrete example inputs and trace them through the logic.
-
Highlight a gotcha — Call out one common mistake, misconception, or subtle behavior that someone reading this code for the first time might miss.
Keep explanations conversational. Avoid jargon unless you define it. For complex concepts, use multiple analogies at different levels of abstraction.