en un clic
analyzing-projects
// Guides systematic project analysis, codebase exploration, and architecture pattern recognition. Use when understanding new codebases, onboarding to projects, or investigating system structure.
// Guides systematic project analysis, codebase exploration, and architecture pattern recognition. Use when understanding new codebases, onboarding to projects, or investigating system structure.
| name | analyzing-projects |
| description | Guides systematic project analysis, codebase exploration, and architecture pattern recognition. Use when understanding new codebases, onboarding to projects, or investigating system structure. |
| license | MIT |
| compatibility | opencode |
| metadata | {"category":"exploration","audience":"developers"} |
Systematic approaches to understanding codebases, identifying patterns, and mapping system architecture.
Layer 1: Surface Scan
└─ Entry points, config files, directory structure
Layer 2: Dependency Mapping
└─ Package managers, imports, module relationships
Layer 3: Architecture Recognition
└─ Patterns (MVC, hexagonal, microservices)
Layer 4: Flow Tracing
└─ Request paths, data flow, state management
Layer 5: Quality Assessment
└─ Test coverage, code health, technical debt
Start by identifying how the application launches:
Look for standard entry files:
main.*, index.*, app.*, server.*cmd/ directory (Go)src/main/ (Java)bin/ scriptsCheck configuration files:
package.json (scripts.start, main)Makefile, Taskfile.github/workflows/)Map directory structure:
Quick heuristics:
├── src/ → Source code
├── lib/ → Internal libraries
├── pkg/ → Public packages (Go)
├── internal/ → Private packages (Go)
├── tests/ → Test files
├── docs/ → Documentation
├── scripts/ → Build/deploy scripts
└── config/ → Configuration
| File | Ecosystem | Key Sections |
|---|---|---|
package.json | Node.js | dependencies, devDependencies |
requirements.txt / pyproject.toml | Python | direct dependencies |
go.mod | Go | require blocks |
Cargo.toml | Rust | dependencies |
pom.xml / build.gradle | Java | dependencies |
Trace imports from entry points
Build a mental model of layers:
Presentation Layer (routes, controllers, views)
↓
Application Layer (services, use cases)
↓
Domain Layer (entities, business logic)
↓
Infrastructure Layer (database, external APIs)
Identify shared utilities imported across modules
| Pattern | Indicators | Typical Structure |
|---|---|---|
| MVC | controllers/, models/, views/ | Clear separation of concerns |
| Hexagonal | ports/, adapters/, domain/ | Dependency inversion |
| Microservices | services/, docker-compose | Independent deployable units |
| Monolith | Single large app, shared DB | Everything in one deployment |
| Serverless | functions/, handlers/ | Event-driven, stateless |
For web applications, trace a request end-to-end:
HTTP Request
↓
Router/Routes (maps URL → handler)
↓
Middleware (auth, logging, validation)
↓
Controller/Handler (orchestrates)
↓
Service/Use Case (business logic)
↓
Repository/DAO (data access)
↓
Database/External API
For frontend applications:
| Indicator | Good Sign | Warning Sign |
|---|---|---|
| Test coverage | >70% coverage | No tests, or tests ignored |
| Dependencies | Recent versions | Major versions behind |
| Documentation | README updated | Stale or missing docs |
| Build time | Under 2 minutes | Over 10 minutes |
| Error handling | Consistent patterns | Swallowed exceptions |
When exploring a large codebase, parallelize by module:
Spawn subagents for each major area:
├─ Subagent 1: Analyze src/auth (authentication module)
├─ Subagent 2: Analyze src/api (API layer)
├─ Subagent 3: Analyze src/db (data layer)
├─ Subagent 4: Analyze src/ui (frontend)
└─ Subagent 5: Analyze tests/ (test patterns)
Synthesize findings into unified architecture view.
## Project Overview
- **Language**: [Primary language]
- **Framework**: [Main framework]
- **Architecture**: [Pattern identified]
- **Entry Point**: [Main file]
## Key Modules
| Module | Responsibility | Key Files |
|--------|----------------|-----------|
| [Name] | [What it does] | [Files] |
## Data Flow
[Request lifecycle diagram]
## Notable Patterns
- [Pattern 1]: [Where/how used]
- [Pattern 2]: [Where/how used]
## Getting Started
- [ ] Clone and install dependencies
- [ ] Run the app locally
- [ ] Run the test suite
- [ ] Trace one request end-to-end
- [ ] Find where [core feature] is implemented
SURFACE SCAN:
entry points → config files → directory structure
DEPENDENCY MAP:
package manager → import tracing → layer identification
ARCHITECTURE:
pattern recognition → separation of concerns → abstractions
FLOW TRACING:
request path → data flow → state management
QUALITY CHECK:
test coverage → code health → technical debt
Guides REST and GraphQL API design, endpoint patterns, request/response schemas, versioning, and API best practices. Use when building APIs, designing endpoints, or reviewing API contracts.
Guides software architecture decisions, design patterns, and system design principles. Use when designing systems, choosing patterns, or making architectural decisions.
Guides test strategy, TDD/BDD approaches, test coverage planning, and testing best practices. Use when designing test suites, improving coverage, or choosing testing approaches.
Guides git workflows, branching strategies, commit conventions, and version control best practices. Use when managing repositories, creating branches, or handling merges.
Guides performance optimization, profiling techniques, and bottleneck identification. Use when improving application speed, reducing resource usage, or diagnosing performance issues.
CRITICAL skill for executing multiple Task tool calls in a SINGLE message for true parallelism. Essential for efficient multi-task workflows, subagent coordination, and maximizing throughput.