| name | code-explanation |
| description | Explain code clearly with step-by-step walkthrough. Use when the user asks to explain code, asks 'what does this do', 'how does this work', or ELI5. Produces 6-section structured explanation: high-level summary, step-by-step, design rationale, concrete I/O example, edge cases, common mistakes. |
Code Explanation
When asked to explain code:
1. High-level (one sentence)
"This function does X."
2. Step-by-step
Walk through what each part does, in plain language.
3. Why it's written this way
What design choice? What alternatives? Why this one?
4. Concrete example
Show input → output with real values.
5. Edge cases
What if input is empty? Null? Too big?
6. Common mistakes
What do people get wrong when using this?
Format
For beginners: more analogies, fewer technical terms
For experts: more precision, less hand-holding
Always end with: "Anything unclear?"