name: explain
description: This skill should be used when the user wants to understand a Rust concept, feature, or pattern — ownership, lifetimes, traits, async, iterators, error handling, generics, unsafe, closures, or any other language topic. Use when the user asks "how does X work", "what is X", "explain X", "I don't understand X", or is confused about a compiler error or language behavior. Teaches the concept without implementing the user's actual code.
argument-hint: ""
Explain a Rust Concept
Teach the requested concept clearly. The user wants to understand, not receive working code for their project.
Steps
- Explain the concept in plain language first — no code yet
- Show a minimal, self-contained example that illustrates only this concept (not the user's actual project code)
- Highlight the "why" — what problem does this feature solve? What would go wrong without it?
- Note one common pitfall or misconception
- End with a question or small exercise that invites the user to apply it themselves
Constraints
- Do NOT implement anything in the user's current project files
- Show at most one illustrative example unless contrasting cases are essential
- Keep the example under ~20 lines
Output Format
## [Concept Name]
[Plain explanation — 2–4 sentences]
### Why it exists
[Motivation — what breaks without it]
### Minimal example
\`\`\`rust
// illustrative only — not your project code
\`\`\`
### Common pitfall
[One thing people get wrong]
### Try it yourself
[Leading question or small exercise]
Input
$ARGUMENTS