analyze
The analyze command performs comprehensive evaluation of code against multiple quality dimensions including code quality, architecture, security, performance, and maintainability. Use this command when conducting thorough code reviews, assessing new modules before integration, or evaluating whether code adheres to established project standards documented in the repository.
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/huangjia2019/claude-code-engineering/HEAD/05-Commands/projects/02-advanced-commands/.claude/commands/analyze.md -o ~/.claude/commands/analyze.mdanalyze.md
Perform deep analysis on: $ARGUMENTS ## Analysis Context Use our project's coding standards as reference: @.claude/rules/coding-standards.md ## Analysis Dimensions ### 1. Code Quality - Complexity (cyclomatic, cognitive) - Duplication - Dead code - Naming conventions ### 2. Architecture - Separation of concerns - Dependency direction - Module boundaries ### 3. Security - Input validation - Authentication/authorization - Sensitive data handling ### 4. Performance - Obvious inefficiencies - Resource management - Caching opportunities ### 5. Maintainability - Documentation coverage - Test coverage indicators - Code readability ## Steps 1. Read the target file(s) 2. If a directory, identify key files 3. Analyze against each dimension 4. Compare with project standards (if available) 5. Generate report ## Output Format ```markdown ## Analysis Report: [target] ### Overview [One paragraph summary] ### Scores | Dimension | Score | Notes | |-----------|-------|-------| | Quality | ⭐⭐⭐⭐☆ | [brief] | | Architecture | ⭐⭐⭐☆☆ | [brief] | | Security | ⭐⭐⭐⭐⭐ | [brief] | | Performance | ⭐⭐⭐☆☆ | [brief] | | Maintainability | ⭐⭐⭐⭐☆ | [brief] | ### Key Findings #### Strengths - [positive points] #### Areas for Improvement - [issues with suggested fixes] ### Recommendations 1. [Prioritized action items] ```
API design patterns and conventions for this project. Covers RESTful URL naming, response format standards, error handling, and authentication requirements. Use when writing or reviewing API endpoints, designing new APIs, or making decisions about request/response formats.
Generate comprehensive API documentation by scanning Express route files.
Generate API documentation from code. Use when the user wants to document APIs, create API reference, generate endpoint documentation, or needs help with OpenAPI/Swagger specs.
Explore and analyze API-related code. Use when investigating endpoints, routing, or HTTP handling.
Generate API endpoint documentation from Express route files. Use when the user asks to generate, update, or review API docs for Express.js routes.
Explore and analyze authentication-related code. Use when investigating auth flows, session management, or security.
Analyze root cause of bugs after location is identified. Second step in bug investigation.
Implement bug fixes after analysis is complete. Third step in bug fix pipeline.