Code Explanation Skill
Explain code that the user is asking about. If no specific code is mentioned, explain the most recently discussed code or file.
Workflow
-
Start with the big picture
- What is the overall purpose of this code?
- Where does it fit in the larger system?
-
Break down the structure
- Key components, classes, or functions
- How they relate to each other
- Data flow through the code
-
Explain non-obvious parts
- Complex algorithms or logic
- Why certain design decisions were made (if apparent)
- Edge cases being handled
-
Highlight important details
- Side effects
- Dependencies on external systems
- Performance considerations
- Security implications