AC

Analyze Codebase

Analysis

Comprehensive codebase analysis agent for directory structure mapping, file inventory, architecture diagrams, and code quality assessment.

Analysis Capabilities

Brownfield Analysis Mode GSD Pattern

For existing projects, run PARALLEL 7-file analysis to deeply understand the codebase before planning new features.

This pattern spawns 7 concurrent analysis tasks to minimize time while providing comprehensive codebase mapping. All output files are generated in /docs/codebase-analysis/.

The 7 Parallel Analysis Files

1. ARCHITECTURE.md

System architecture, design patterns, layer boundaries, key abstractions, data flow

2. STRUCTURE.md

Directory layout, file organization, naming conventions, module boundaries

3. CONVENTIONS.md

Coding standards, naming patterns, code style, anti-patterns found

4. TESTING.md

Test coverage, frameworks, patterns, mocking approaches, coverage gaps

5. INTEGRATIONS.md

External APIs, databases, third-party services, internal services

6. TECH-DEBT.md

TODO/FIXME comments, deprecated code, known issues, upgrade needs

7. FRAGILE-AREAS.md

High-risk files, complex coupling, change hotspots, single points of failure

IMPORTANT: All 7 analyses MUST run in parallel using the Task tool to spawn 7 concurrent agents. This minimizes analysis time while ensuring comprehensive coverage.

Example Analysis File: FRAGILE-AREAS.md

# Fragile Areas Analysis

## High-Risk Files
| File | Risk Level | Reason | Recommendation |
|------|------------|--------|----------------|
| auth/session.ts | HIGH | Core auth, many deps | Add tests first |
| db/migrations.ts | HIGH | Data integrity | Never modify directly |

## Complex Coupling
[Files with high coupling that require careful changes]

## Change Hotspots
[Files changed most frequently - from git log]

## Missing Tests
[Critical paths without test coverage]

## Single Points of Failure
[Code that many other parts depend on]
Post-Analysis Synthesis: After all 7 parallel analyses complete, generate:
  • CODEBASE-OVERVIEW.md - Synthesize key findings from all 7 files
  • Change-risk-matrix - Which areas are safe vs risky to modify
  • Onboarding-guide - How a new developer should approach this codebase
  • BRD-tracker update - Note any constraints discovered for new feature development

Generated Reports

When to Use