codeexplainer
Analyze and explain Python code in detail. Provides comprehensive explanations of functions, classes, logic, and best practices. Use when user needs detailed explanations of Python code, documentation of existing codebases, or understanding of complex programming concepts and implementations.
📖 中文导读:Analyze and explain Python code in detail. Provides comprehensive explanations of functions, classes, logic, and best practices. Use when user needs detailed explanations of Python code, documentation of existing codebases, or understanding of complex programming concepts and implementations. 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: codeexplainer description: >- Analyze and explain Python code in detail. Provides comprehensive explanations of functions, classes, logic, and best practices. Use when user needs detailed explanations of Python code, documentation of existing codebases, or understanding of complex programming concepts and implementations.
CodeExplainer Skill
Overview
This skill analyzes Python code and provides detailed, professional explanations of what the code does, how it works, and suggestions for improvement.
When to Use This Skill
- Explaining legacy code to team members
- Creating documentation for existing codebases
- Learning new codebases quickly
- Onboarding new developers
- Understanding complex algorithms or implementations
- Providing code reviews with detailed explanations
How to Use
- User provides Python code (file or snippet)
- Analyze the code structure, functions, classes, and logic
- Explain what each part does in clear, professional language
- Identify patterns, algorithms, and design principles used
- Suggest improvements or best practices if applicable
- Document any potential issues or areas for optimization
Analysis Framework
Code Structure Analysis
- Identify main functions and their purposes
- Document class hierarchies and relationships
- Explain module imports and dependencies
- Outline the overall architecture
Logic Explanation
- Detail the algorithm or process implemented
- Explain control flow (loops, conditionals, recursion)
- Describe data transformations
- Clarify any complex mathematical or logical operations
Best Practices Assessment
- Identify adherence to Python standards (PEP 8)
- Suggest performance improvements
- Highlight potential security concerns
- Recommend design pattern applications
Output Format
Provide explanations in this structure:
- Overview: Brief summary of what the code does
- Detailed Breakdown: Line-by-line or function-by-function explanation
- Patterns & Techniques: Design patterns, algorithms, or techniques used
- Improvement Suggestions: Best practices or optimizations
- Potential Issues: Any bugs, security concerns, or maintenance issues