Skip to main content
ClaudeWave
Slash Command828 repo starsupdated 13d ago

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.

Install in Claude Code
Copy
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.md
Then start a new Claude Code session; the slash command loads automatically.

analyze.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]
```