Agent skill
analyze-code
Comprehensive code explanation and analysis. Use when user says "explain this file to me", "what does this code do", "analyze the security of this module", "review the performance of this function", or "help me understand this architecture".
Install this agent skill to your Project
npx add-skill https://github.com/Uniswap/ai-toolkit/tree/next/packages/plugins/development-codebase-tools/skills/analyze-code
SKILL.md
Code Analyzer
Provide comprehensive code explanation through multi-agent analysis for architecture, patterns, security, and performance insights.
When to Activate
- User asks "what does this code do?"
- User wants code explained
- User asks about security or performance
- User wants to understand patterns in code
- Before making changes to unfamiliar code
Quick Process
- Structure Analysis: Understand architecture and patterns
- Dependency Mapping: Trace imports and dependencies
- Risk Assessment: Identify vulnerabilities and issues
- Performance Analysis: Evaluate complexity
- Pattern Recognition: Identify design patterns
Analysis Depth
| Depth | Description | Agents Used |
|---|---|---|
overview |
Quick summary | code-explainer |
deep |
Comprehensive analysis | code-explainer, security-analyzer, performance-analyzer |
architectural |
System-level context | All agents + context-loader |
Focus Areas
- patterns: Design patterns, SOLID, anti-patterns
- security: Vulnerabilities, input validation, auth
- performance: Algorithm complexity, memory, queries
- all: Complete analysis (default)
Output Includes
- Summary: Purpose, complexity, maintainability score
- Architecture: Patterns, layers, coupling analysis
- Functionality: Main purpose, data flow, side effects
- Dependencies: Imports, exports, circular dependencies
- Risks: Security, performance, maintainability issues
- Improvements: Quick wins and refactoring suggestions
Delegation
For simple explanations, use code-explainer-agent directly.
For deep analysis, coordinate:
- code-explainer-agent: Architecture and patterns
- security-analyzer-agent: Vulnerability assessment
- performance-analyzer-agent: Complexity analysis
- context-loader-agent: System-level context
Examples
"Explain src/auth/login.ts to me"
"What does this API endpoint do?"
"Analyze the security of the payment module"
"Is there anything wrong with this code?"
Detailed Reference
For output schemas and advanced options, see explain-file-guide.md.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
review-plan
Review implementation plans for completeness and feasibility. Use when user says "review this plan before I start", "is this implementation plan complete", "check if this plan aligns with our patterns", "give me feedback on my implementation strategy", or "validate this plan before we execute it".
plan-implementation
Create implementation plans for features and changes. Use when user says "plan how to implement user authentication", "how should I add dark mode to the app", "what's the best way to refactor the database layer", "create a plan for migrating to the new API", or "I need to implement [feature] - help me plan it out".
execute-plan
Execute implementation plans step-by-step. Use when user says "execute the plan", "implement the plan we created", "start building based on the plan", "go ahead and implement it", "proceed with the implementation", "execute as a stack", "create a PR stack while implementing", "implement with one PR per step", or references a plan file and wants to begin coding.
generate-commit-message
Generate well-structured git commit messages. Use when user says "generate commit message", "write a commit", "what should my commit message be", "create commit message for these changes", or needs help crafting conventional commit messages.
plan-swarm
Refine plans through multi-agent expert discussion. Use when user says "get multiple expert opinions on this plan", "I want different perspectives on this approach", "have the agents discuss this strategy", "refine the plan through collaborative review", or "what would different specialists think about this design".
create-pr
Create or update pull requests with conventional commits. Use when user says "create a PR for these changes", "submit this for review", "open a pull request", "push these changes and create a PR", "I'm ready to submit this work", or "create PR and link to issue
Didn't find tool you were looking for?