Generate a comprehensive, beginner-friendly overview of the entire codebase
Generates a comprehensive, beginner-friendly codebase overview and saves it to reports directory.
/plugin marketplace add dgriffith/bad-daves-robot-army/plugin install dgriffith-bad-daves-robot-army@dgriffith/bad-daves-robot-armyUsing @agent-mentor create a comprehensive overview of the codebase tailored to the user's experience level, saving the output to the reports directory.
The user invoked: /codebase-overview {optional_focus}
Examples:
/codebase-overview - Complete overview/codebase-overview frontend - Focus on frontend architecture/codebase-overview for beginners - Simplified overview/codebase-overview data flow - Focus on how data moves/codebase-overview for new contributors - Contribution-focused overviewDetermine or ask:
Systematically explore:
Build an overview that:
Create a markdown file at /reports/codebase-overview-{focus}-{timestamp}.md with the comprehensive overview.
# Codebase Overview: [Project Name]
## Quick Start
**What this project does**: [One sentence description]
**Tech stack**: [Main technologies]
**Architecture style**: [e.g., microservices, monolith, etc.]
## Project Structure
### Directory Layout
project-root/ ├── src/ # Main source code │ ├── api/ # API endpoints │ ├── services/ # Business logic │ ├── models/ # Data models │ └── utils/ # Shared utilities ├── tests/ # Test suites ├── docs/ # Documentation └── config/ # Configuration files
### Key Directories Explained
#### `/src/api`
**Purpose**: Handles all incoming HTTP requests
**Key files**:
- `routes.ts` - Route definitions
- `middleware/` - Request processing
**Start here if**: You're adding new endpoints
#### `/src/services`
**Purpose**: Core business logic
**Key concepts**: Service layer pattern
**Important classes**:
- `UserService` - User management
- `DataProcessor` - ETL operations
**Start here if**: You're implementing features
[Continue for each major directory...]
## Architecture Overview
### High-Level Design
[ASCII or mermaid diagram showing system architecture]
Client → API Gateway → Services → Database ↓ ↓ Cache Message Queue
### Design Principles
1. **Separation of Concerns**: Each module has one responsibility
2. **Dependency Injection**: Services are injected, not instantiated
3. **Event-Driven**: Components communicate through events
### Data Flow
1. Request arrives at API endpoint
2. Middleware validates and authenticates
3. Service layer processes business logic
4. Data layer handles persistence
5. Response formatted and returned
**Example Flow**: User Registration
POST /api/register → ValidationMiddleware (check email format) → AuthController.register() → UserService.createUser() → UserRepository.save() → EmailService.sendWelcome() → Return success response
## Core Components
### Authentication System
**Location**: `/src/auth`
**How it works**: JWT-based with refresh tokens
**Key files**:
- `auth.service.ts` - Token generation/validation
- `auth.middleware.ts` - Route protection
### Data Layer
**Location**: `/src/database`
**Technology**: [e.g., PostgreSQL with TypeORM]
**Patterns**: Repository pattern, migrations
### API Layer
**Location**: `/src/api`
**Framework**: [e.g., Express.js]
**Documentation**: [Link to API docs]
## Key Patterns & Conventions
### Coding Standards
- **Naming**: camelCase for variables, PascalCase for classes
- **File structure**: One class/component per file
- **Imports**: Absolute paths from /src
### Common Patterns
#### Service Pattern
```typescript
// All business logic in services
class UserService {
constructor(private repo: UserRepository) {}
async createUser(data: CreateUserDto) {
// Business logic here
}
}
// Consistent error handling
try {
await riskyOperation();
} catch (error) {
throw new AppError('User-friendly message', 400);
}
npm install.env.example to .envnpm run migratenpm run devnpm run lintnpm testnpm run test:integrationnpm run test:e2e.env - Environment variablesconfig/database.ts - Database settingstsconfig.json - TypeScript configurationsrc/index.ts - Application startsrc/app.ts - Express app setupsrc/routes.ts - All route definitionssrc/utils/logger.ts - Loggingsrc/utils/validation.ts - Input validationsrc/utils/errors.ts - Error classes/src/api/routes/src/services/src/models/tests/logs directory/docs/troubleshooting.md/tools/profile/src/cacheWhy we use it: [Reasoning] Key concepts to understand:
Type: [SQL/NoSQL] Why this choice: [Reasoning] Important to know:
/docs/CONTRIBUTING.md/docs/tutorial/src/services/example/docs/adr/docs/api/docs/development.md/docs/FAQ.md/explain [topic] for detailed explanationsCommon Terms in This Codebase:
Based on your goals:
/learn path
## Customization Levels
### For Beginners
Focus on:
- Simple, clear explanations
- Avoid technical jargon
- More analogies and examples
- Step-by-step instructions
- Visual aids and diagrams
### For Experienced Developers
Include:
- Technical details and trade-offs
- Performance considerations
- Advanced patterns
- Architecture decisions
- Optimization opportunities
### For Architects/Reviewers
Emphasize:
- System design decisions
- Scalability considerations
- Technical debt areas
- Future roadmap
- Integration points
## Interactive Elements
When focus is unclear:
Mentor: I'll create a codebase overview for you. To make it most helpful:
## Important Guidelines
1. **Start with the forest, then trees** - Big picture first
2. **Use actual paths and files** - Not generic examples
3. **Provide clear navigation** - Where to find things
4. **Include practical examples** - Show, don't just tell
5. **Suggest concrete next steps** - What to do after reading
Remember: A good overview is a map that helps developers navigate confidently, not a exhaustive catalog of every detail.