Project Analyzer
Systematically analyze software projects to understand architecture, entry points, layers, and key files. This skill helps quickly onboard to unfamiliar codebases by mapping structure and identifying critical components.
Analysis Workflow
Follow this workflow to analyze projects efficiently:
1. Run Automated Analysis
First, use the provided script to generate a comprehensive project overview:
python3 scripts/analyze_project.py <project_path>
This automatically identifies:
- Project type and primary languages
- File distribution across extensions
- Entry points (main files)
- Configuration files with descriptions
- Dependencies from package managers
- Basic architecture patterns
- Directory structure tree
2. Examine Key Configuration Files
Based on the analysis, read critical config files to understand:
Dependencies and frameworks:
package.json - Node.js dependencies, scripts, project metadata
requirements.txt / pyproject.toml - Python dependencies
Cargo.toml - Rust dependencies
go.mod - Go modules
pom.xml / build.gradle - Java dependencies
Framework configuration:
next.config.js - Next.js settings
vite.config.js - Vite bundler
tsconfig.json - TypeScript compiler
webpack.config.js - Webpack bundler
Environment and deployment:
.env.example - Required environment variables
docker-compose.yml - Service definitions
Dockerfile - Container setup
3. Identify Entry Points
Trace execution flow starting from entry points found in analysis:
Common entry points by project type:
- Web apps:
index.js, app.js, server.js, main.py
- Next.js:
pages/_app.js or app/layout.js
- APIs:
server.js, app.py, main.go
- CLIs:
cli.js, __main__.py, main.rs
Read entry point to understand initialization, middleware setup, and routing.
4. Map Project Layers
Identify and document the purpose of each layer using common patterns. Consult references/architecture_patterns.md for detailed explanations of:
- Frontend layers (components, pages, state, utils)
- Backend layers (routes, services, models, middleware)
- Full-stack structures (monorepo, microservices)
- Common architecture patterns (MVC, Clean Architecture, etc.)
5. Understand Data Flow
For web applications, trace a typical request/response:
- Route definition - Where endpoints are defined
- Middleware - Auth, validation, logging
- Controller/Handler - Request processing
- Service layer - Business logic
- Data layer - Database queries
- Response formatting - Serializers, transformers
6. Analyze Code Patterns
Use references/code_reading.md for strategies on:
- Reading order and priority
- Framework-specific reading paths
- Pattern recognition techniques
- Understanding dependencies
- Identifying code smells and anti-patterns
7. Generate Summary
Create a structured summary including:
Project Overview:
- Project type and tech stack
- Primary languages and frameworks
- Architecture pattern used
Entry Points:
- Main execution files
- How to run/start the project
Layer Breakdown:
- Purpose of each major directory
- What code lives where
- Data flow between layers
Key Configuration:
- Important config files and their purpose
- Environment variables needed
- External services/APIs integrated
Development Workflow:
- How to install dependencies
- How to run locally
- Testing approach
- Build/deployment process
Notable Patterns:
- Architecture decisions
- Code organization principles
- Special conventions or structures
Tips for Effective Analysis
Start high-level, go deeper as needed:
- First pass: Project type, structure, entry points
- Second pass: Layer purposes, data flow
- Deep dive: Specific features or complex areas only when requested
Use search efficiently:
grep -r "TODO\|FIXME" - Known issues
grep -r "class.*Controller" - Find controllers
grep -r "def test_" - Find tests
Prioritize understanding over completeness:
- Focus on answering the user's specific questions
- Don't document every file unless requested
- Highlight important/unusual patterns
Consider the user's goal:
- New contributor: Focus on setup, architecture, conventions
- Bug fixing: Find relevant code areas, testing approach
- Feature addition: Understand existing patterns, extension points
- Code review: Architecture decisions, code quality patterns
Resources
Scripts:
scripts/analyze_project.py - Automated project analysis tool that scans directory structure, identifies project type, finds entry points and config files, extracts dependencies, and generates formatted output
References:
references/architecture_patterns.md - Common software architecture patterns, project layers, structure indicators, and configuration files reference
references/code_reading.md - Strategies for reading and understanding code, framework-specific paths, pattern recognition, and anti-patterns to watch for
Load reference files when deeper context is needed beyond the automated analysis.
1---2name: project-analyzer3description: Quickly understand and analyze software project architecture, structure, and organization. Use this skill when users want to understand a new codebase, analyze project structure, identify entry points, understand project layers and architecture, find configuration files, map dependencies, get onboarded to an unfamiliar project, or when they ask questions like "help me understand this project", "what's the architecture", "where do I start reading this code", "explain this codebase", or "analyze this repository". Also triggers when users upload project directories or ask about project organization.4---56# Project Analyzer78Systematically analyze software projects to understand architecture, entry points, layers, and key files. This skill helps quickly onboard to unfamiliar codebases by mapping structure and identifying critical components.910## Analysis Workflow1112Follow this workflow to analyze projects efficiently:1314### 1. Run Automated Analysis1516First, use the provided script to generate a comprehensive project overview:1718```bash19python3 scripts/analyze_project.py <project_path>20```2122This automatically identifies:23- Project type and primary languages24- File distribution across extensions25- Entry points (main files)26- Configuration files with descriptions27- Dependencies from package managers28- Basic architecture patterns29- Directory structure tree3031### 2. Examine Key Configuration Files3233Based on the analysis, read critical config files to understand:3435**Dependencies and frameworks:**36- `package.json` - Node.js dependencies, scripts, project metadata37- `requirements.txt` / `pyproject.toml` - Python dependencies38- `Cargo.toml` - Rust dependencies39- `go.mod` - Go modules40- `pom.xml` / `build.gradle` - Java dependencies4142**Framework configuration:**43- `next.config.js` - Next.js settings44- `vite.config.js` - Vite bundler45- `tsconfig.json` - TypeScript compiler46- `webpack.config.js` - Webpack bundler4748**Environment and deployment:**49- `.env.example` - Required environment variables50- `docker-compose.yml` - Service definitions51- `Dockerfile` - Container setup5253### 3. Identify Entry Points5455Trace execution flow starting from entry points found in analysis:5657**Common entry points by project type:**58- **Web apps**: `index.js`, `app.js`, `server.js`, `main.py`59- **Next.js**: `pages/_app.js` or `app/layout.js`60- **APIs**: `server.js`, `app.py`, `main.go`61- **CLIs**: `cli.js`, `__main__.py`, `main.rs`6263Read entry point to understand initialization, middleware setup, and routing.6465### 4. Map Project Layers6667Identify and document the purpose of each layer using common patterns. Consult `references/architecture_patterns.md` for detailed explanations of:6869- Frontend layers (components, pages, state, utils)70- Backend layers (routes, services, models, middleware)71- Full-stack structures (monorepo, microservices)72- Common architecture patterns (MVC, Clean Architecture, etc.)7374### 5. Understand Data Flow7576For web applications, trace a typical request/response:77781. **Route definition** - Where endpoints are defined792. **Middleware** - Auth, validation, logging803. **Controller/Handler** - Request processing814. **Service layer** - Business logic825. **Data layer** - Database queries836. **Response formatting** - Serializers, transformers8485### 6. Analyze Code Patterns8687Use `references/code_reading.md` for strategies on:8889- Reading order and priority90- Framework-specific reading paths91- Pattern recognition techniques92- Understanding dependencies93- Identifying code smells and anti-patterns9495### 7. Generate Summary9697Create a structured summary including:9899**Project Overview:**100- Project type and tech stack101- Primary languages and frameworks102- Architecture pattern used103104**Entry Points:**105- Main execution files106- How to run/start the project107108**Layer Breakdown:**109- Purpose of each major directory110- What code lives where111- Data flow between layers112113**Key Configuration:**114- Important config files and their purpose115- Environment variables needed116- External services/APIs integrated117118**Development Workflow:**119- How to install dependencies120- How to run locally121- Testing approach122- Build/deployment process123124**Notable Patterns:**125- Architecture decisions126- Code organization principles127- Special conventions or structures128129## Tips for Effective Analysis130131**Start high-level, go deeper as needed:**132- First pass: Project type, structure, entry points133- Second pass: Layer purposes, data flow134- Deep dive: Specific features or complex areas only when requested135136**Use search efficiently:**137- `grep -r "TODO\|FIXME"` - Known issues138- `grep -r "class.*Controller"` - Find controllers139- `grep -r "def test_"` - Find tests140141**Prioritize understanding over completeness:**142- Focus on answering the user's specific questions143- Don't document every file unless requested144- Highlight important/unusual patterns145146**Consider the user's goal:**147- New contributor: Focus on setup, architecture, conventions148- Bug fixing: Find relevant code areas, testing approach149- Feature addition: Understand existing patterns, extension points150- Code review: Architecture decisions, code quality patterns151152## Resources153154**Scripts:**155- `scripts/analyze_project.py` - Automated project analysis tool that scans directory structure, identifies project type, finds entry points and config files, extracts dependencies, and generates formatted output156157**References:**158- `references/architecture_patterns.md` - Common software architecture patterns, project layers, structure indicators, and configuration files reference159- `references/code_reading.md` - Strategies for reading and understanding code, framework-specific paths, pattern recognition, and anti-patterns to watch for160161Load reference files when deeper context is needed beyond the automated analysis.