Skip to main content
ClaudeWave
Slash Command1.4k estrellas del repoactualizado 3d ago

parallel-analyze

The parallel-analyze command spawns four independent subagents that simultaneously examine code or directories from distinct perspectives: architecture, security, performance, and testing. Use this command when you need comprehensive multi-faceted code review that identifies structural issues, vulnerabilities, efficiency problems, and test gaps in a single parallel execution rather than sequential analysis.

Instalar en Claude Code
Copiar
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/CloudAI-X/claude-workflow-v2/HEAD/commands/parallel-analyze.md -o ~/.claude/commands/parallel-analyze.md
Después abre una sesión nueva de Claude Code; el slash command carga automáticamente.

parallel-analyze.md

# Parallel Multi-Perspective Analysis

Analyze `$ARGUMENTS` from multiple perspectives simultaneously using parallel subagents.

## Process

1. **Identify Target**: Parse the file or directory to analyze
2. **Spawn Perspective Agents**: Launch 4 parallel subagents (one per perspective)
3. **Collect Results**: Each subagent returns its analysis automatically on completion
4. **Synthesize**: Merge findings into unified recommendations

## Execution Pattern

**CRITICAL**: Launch ALL Task calls in a SINGLE message for true parallelism.

For the target, spawn 4 perspective-based subagents with `run_in_background: true`:

```
I'm launching 4 parallel analysis agents:

[Task 1]
description: "Architecture analysis"
prompt: "You are a software architect analyzing [target]. Evaluate:
- Component structure and boundaries
- Dependency patterns and coupling
- Design pattern usage
- Layering and separation of concerns
- Scalability considerations
- SOLID principle adherence

Provide findings with file:line references and improvement suggestions."
run_in_background: true

[Task 2]
description: "Security analysis"
prompt: "You are a security auditor analyzing [target]. Check for:
- OWASP Top 10 vulnerabilities
- Input validation gaps
- Authentication/authorization issues
- Hardcoded secrets or credentials
- Injection vulnerabilities (SQL, XSS, command)
- Insecure dependencies

Provide findings with severity levels (Critical/High/Medium/Low)."
run_in_background: true

[Task 3]
description: "Performance analysis"
prompt: "You are a performance engineer analyzing [target]. Look for:
- Algorithmic complexity issues (O(n²), O(n!))
- N+1 query patterns
- Memory leaks or inefficient allocations
- Blocking operations in async contexts
- Missing caching opportunities
- Unnecessary computations

Provide findings with estimated impact levels."
run_in_background: true

[Task 4]
description: "Testing analysis"
prompt: "You are a test architect analyzing [target]. Evaluate:
- Test coverage gaps
- Missing edge case tests
- Untested error paths
- Integration test opportunities
- Test code quality
- Mocking strategy effectiveness

Provide recommendations for improving test coverage."
run_in_background: true
```

Each subagent returns its result automatically when it completes — there is no
separate retrieval step. Read each analysis as it returns.

## Output Format

```markdown
## Multi-Perspective Analysis: [Target]

### Summary

- **Perspectives analyzed**: 4
- **Total findings**: X
- **Critical issues**: Y
- **Execution time**: ~Zs (parallel)

---

### Architecture Perspective

#### Strengths

- [Pattern/decision] - [Why it's good]

#### Concerns

- [Issue] at file:line - [Description]
- [Issue] at file:line - [Description]

#### Recommendations

- [Improvement] - [Rationale]

---

### Security Perspective

#### Critical

- [Vulnerability] at file:line - [Impact]

#### High

- [Issue] at file:line - [Description]

#### Medium/Low

- [Issue] at file:line - [Description]

---

### Performance Perspective

#### High Impact

- [Bottleneck] at file:line - [Complexity/Impact]

#### Medium Impact

- [Issue] at file:line - [Description]

#### Optimization Opportunities

- [Opportunity] at file:line - [Expected improvement]

---

### Testing Perspective

#### Coverage Gaps

- [Untested area] - [Priority]

#### Missing Test Cases

- [Function/path] - [Suggested tests]

#### Quality Improvements

- [Issue in tests] - [Recommendation]

---

### Cross-Perspective Synthesis

#### Priority Actions (Ordered)

1. **[Highest priority]** - [From perspective] - [Why]
2. **[Second priority]** - [From perspective] - [Why]
3. **[Third priority]** - [From perspective] - [Why]

#### Interconnected Issues

- [Issue A] affects [Issue B]: [Explanation]

#### Recommended Approach

1. [First action to take]
2. [Second action to take]
3. [Third action to take]
```

## Example Usage

```
/project-starter:parallel-analyze src/api
```

This spawns 4 parallel analysts (architecture, security, performance, testing), completing in ~1/4 the time of sequential analysis.

## When to Use

- Before major refactoring efforts
- During architecture reviews
- Pre-release quality gates
- Technical debt assessment
- Code audit preparation
- New developer onboarding (understand quality state)

## Perspective Details

| Perspective  | Focus Areas                   | Severity Levels             |
| ------------ | ----------------------------- | --------------------------- |
| Architecture | Structure, patterns, coupling | Concern, Suggestion         |
| Security     | Vulnerabilities, OWASP        | Critical, High, Medium, Low |
| Performance  | Complexity, bottlenecks       | High, Medium, Optimization  |
| Testing      | Coverage, quality             | Gap, Missing, Improvement   |
code-reviewerSubagent

Expert code review specialist. Use PROACTIVELY after writing or modifying code, before commits, when asked to review changes, PR review, code quality check, lint, or standards audit. Focuses on quality, security, performance, and maintainability.

debuggerSubagent

Expert debugging specialist for errors, test failures, crashes, segmentation faults, memory leaks, timeouts, race conditions, deadlocks, and unexpected behavior. Use PROACTIVELY when encountering any error, exception, or failing test. Performs systematic root cause analysis.

docs-writerSubagent

Technical documentation specialist. Use for creating README files, API documentation, architecture docs, inline comments, user guides, changelogs, migration guides, release notes, FAQs, and troubleshooting docs. MUST BE USED when documentation is needed or when code changes require doc updates.

orchestratorSubagent

Master coordinator for complex multi-step tasks. Use PROACTIVELY when a task involves 2+ modules, requires delegation to specialists, needs architectural planning, or involves GitHub PR workflows. MUST BE USED for open-ended requests like "improve", "enhance", "build", "scale", "refactor", "add feature", "system design", "architecture", "complex task", or when implementing features from GitHub issues.

refactorerSubagent

Code refactoring specialist for improving code quality, reducing technical debt, eliminating code smells, reducing complexity, and applying design patterns. Use PROACTIVELY when code needs restructuring, simplification, tech debt reduction, or when applying DRY/SOLID principles.

security-auditorSubagent

Security specialist for vulnerability detection, secure coding review, and security hardening. Use PROACTIVELY when handling authentication, authorization, encryption, secrets, credentials, OAuth, JWT, CORS, headers, user input, API keys, or sensitive data. Checks for OWASP Top 10 and common vulnerabilities.

test-architectSubagent

Testing strategy specialist for designing test suites, writing tests, and ensuring comprehensive coverage. Use PROACTIVELY when adding new features, fixing bugs, improving test coverage, creating test plans, mocking strategies, handling flaky tests, or writing integration/E2E tests.

add-testsSlash Command

Add tests for recently changed files or specified code