Initialize a comprehensive CLAUDE.md using ultrathink methodology: /init-ultrathink [optional-context]
Generates a comprehensive CLAUDE.md file by orchestrating multiple specialized agents to analyze the entire repository.
/plugin marketplace add nicknisi/claude-plugins/plugin install essentials@nicknisi/init-ultrathink [optional context about the project]
You are the Coordinator Agent orchestrating specialized sub-agents to create a comprehensive CLAUDE.md file that will guide Claude in understanding and working with this codebase.
Project Structure Analysis
Tech Stack Detection
Architecture Patterns
Coding Conventions
Development Workflows
Key Abstractions
Existing Documentation
Implicit Knowledge
Testing Patterns
Quality Gates
Repository Evolution
Commit Patterns
Architectural Evolution
Issue and Bug Patterns
Synthesize all gathered information to create a comprehensive CLAUDE.md that includes ALL sections from the template. Each agent should contribute:
Repository Analyst Agent:
Context Gatherer Agent:
Documentation Agent:
Testing Agent:
Git History Analyst Agent:
Additional Considerations:
Generate a CLAUDE.md file adapted to the project type. Use these guidelines:
Based on what the agents discover, include these sections if they apply:
For Web Applications:
For Libraries/Packages:
For CLI Tools:
For Microservices:
For Data-Intensive Projects:
Universal Optional Sections:
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Repository Overview
[Comprehensive description of what this project is, does, and its core value proposition]
### Project Statistics
- Primary language: [language]
- Lines of code: [approximate]
- Active since: [date/year]
- Key maintainers: [if relevant]
## Quick Start
### Prerequisites
[List all requirements - OS, runtime versions, tools, accounts needed]
### Initial Setup
\`\`\`bash
# Clone and setup
[commands]
# Install dependencies
[commands]
# Verify installation
[commands]
\`\`\`
## Essential Commands
### Development
\`\`\`bash
# Start development environment
[command]
# Run tests
[command]
# Build the project
[command]
# Watch mode / hot reload
[command]
\`\`\`
### Common Tasks
\`\`\`bash
# [Task description]
[command]
# [Another task]
[command]
\`\`\`
### Debugging
\`\`\`bash
# Debug mode
[command]
# Verbose logging
[command]
# Performance profiling
[command]
\`\`\`
## Architecture and Key Concepts
### System Architecture
[High-level architecture overview with key components]
### 1. **[Core Concept]**
[Detailed explanation of the concept and why it matters]
- Location: [where to find this in code]
- Key files: [specific files]
- Usage example: [code snippet if helpful]
### 2. **[Another Concept]**
[Explanation with similar detail]
### Data Flow
[How data moves through the system]
### State Management
[How state is managed, if applicable]
## Project Structure
\`\`\`
[Project tree with annotations explaining key directories]
project/
├── src/ # Main source code
│ ├── core/ # Core business logic
│ └── utils/ # Shared utilities
├── tests/ # Test files
└── docs/ # Documentation
\`\`\`
## Important Patterns
### [Pattern Category]
[Detailed description of the pattern with examples]
- Example: [specific file or usage]
- When to use: [guidance]
- When NOT to use: [anti-patterns]
### Adding New Features
1. [Step-by-step guidance]
2. [Include file creation patterns]
3. [Registration/configuration steps]
4. [Testing requirements]
### Testing Approach
- Unit tests: [approach and location]
- Integration tests: [approach and location]
- E2E tests: [if applicable]
- Test data: [how it's managed]
- Mocking: [strategies used]
### Error Handling Philosophy
[Project's approach to errors, logging, user feedback]
## Dependencies and External Services
### Core Dependencies
- [Dependency]: [version] - [why it's used]
- [Another dep]: [version] - [purpose]
### External Services
- [Service name]: [purpose, configuration location]
- [API/Database]: [connection patterns]
### Environment Variables
\`\`\`bash
# Required
[VAR_NAME]=[description]
# Optional
[VAR_NAME]=[description, default value]
\`\`\`
## Development Workflows
### Git Workflow
- Branch naming: [pattern]
- Commit style: [conventions]
- PR process: [requirements]
### Release Process
[How releases are managed, versioning strategy]
### CI/CD Pipeline
[What runs, when, and what it checks]
## Hidden Context
### [Non-obvious aspect]
[Detailed explanation of something that might trip up newcomers]
### Historical Decisions
[Key architectural decisions and their rationale - from git history]
- [Decision]: [Context, alternatives considered, outcome]
- [Migration]: [What changed, why, and lessons learned]
### Code Evolution Patterns
[How the codebase has evolved - from git history analysis]
- Major refactorings: [what, when, why]
- Technology migrations: [from → to, reasons]
- Deprecated patterns: [what to avoid and why]
### Performance Considerations
- [Bottleneck area]: [mitigation strategy]
- [Resource constraint]: [how it's handled]
### Security Notes
- Authentication: [approach]
- Authorization: [patterns]
- Sensitive data: [handling]
- Security tools: [what's in use]
### Known Technical Debt
- [Area]: [explanation and impact]
- [Workaround]: [current solution]
## Code Style
### Language-Specific Conventions
[Detailed style guide or reference to external guide]
### Naming Conventions
- Files: [pattern with examples]
- Classes/Types: [pattern]
- Functions: [pattern]
- Variables: [pattern]
- Constants: [pattern]
### File Organization
- [Pattern]: [Detailed explanation]
- Maximum file size: [if there's a guideline]
- Code grouping: [how code is organized within files]
### Import/Export Patterns
[How modules are organized and exposed]
### Documentation Standards
- Inline comments: [when and how]
- Function documentation: [format]
- API documentation: [approach]
## Debugging Guide
### Common Issues
1. **[Issue description]**
- Symptoms: [what you'll see]
- Cause: [root cause]
- Solution: [how to fix]
- History: [how often this occurs - from git history]
2. **[Another issue]**
- Symptoms: [description]
- Cause: [explanation]
- Solution: [fix]
- Prevention: [how to avoid - learned from history]
### Debugging Tools
- [Tool name]: [usage]
- [Browser extensions]: [if applicable]
- [CLI tools]: [debugging commands]
### Logging
- Log levels: [available levels]
- Log locations: [where to find logs]
- Log configuration: [how to adjust]
## Performance Profiling
### Profiling Tools
[Available tools and how to use them]
### Performance Benchmarks
[Key metrics and acceptable ranges]
### Optimization Guidelines
[When and how to optimize]
## Integration Points
### API Endpoints
[If applicable, key endpoints and their purposes]
### Webhooks
[Incoming/outgoing webhooks]
### Event System
[If applicable, key events and listeners]
## Deployment
### Deployment Environments
- Development: [details]
- Staging: [details]
- Production: [details]
### Deployment Process
[Step-by-step deployment guide]
### Rollback Procedures
[How to safely rollback changes]
## Monitoring and Observability
### Metrics
[What's tracked and where to find it]
### Alerts
[What triggers alerts and who gets notified]
### Health Checks
[Endpoint and what it verifies]
## Gotchas and Tips
### Common Pitfalls
- **[Mistake]**: [Why it happens and how to avoid]
- **[Another mistake]**: [Prevention strategy]
### Pro Tips
- **[Productivity tip]**: [Explanation]
- **[Debugging tip]**: [How it helps]
- **[Performance tip]**: [When to apply]
### Platform-Specific Notes
[Any OS or environment-specific considerations]
## Resources
### Internal Documentation
- [Doc type]: [location/link]
- [Design docs]: [where to find them]
### External Resources
- [Official docs]: [link]
- [Community resources]: [links]
- [Video tutorials]: [if available]
### Team Contacts
[If applicable, who to contact for different areas]
### Code Ownership
[From git history - who maintains what]
- [Component/Area]: [Primary maintainer(s)]
- [Another area]: [Expert(s) based on commit history]
## Maintenance Tasks
### Regular Maintenance
- [Task]: [frequency and procedure]
- [Dependency updates]: [process]
### Health Checks
[What to regularly check and how]
## Contributing Guidelines
### Code Submission Process
[PR requirements, review process]
### Code Review Checklist
- [ ] [Item to check]
- [ ] [Another item]
### Definition of Done
[What constitutes a complete feature/fix]
For a Simple CLI Tool:
# CLAUDE.md
## Repository Overview
## Quick Start
## Essential Commands
## Command Reference (detailed)
## Configuration
## Project Structure
## Code Style
## Hidden Context
For a Complex Web Application:
# CLAUDE.md
## Repository Overview
## Quick Start
## Essential Commands
## Architecture and Key Concepts
### Frontend Architecture
### Backend Architecture
### Database Design
## API Reference
## Project Structure
## Development Workflows
## Testing Approach
## Deployment
## Monitoring
## Hidden Context
For a Library:
# CLAUDE.md
## Repository Overview
## Quick Start
## API Reference
## Integration Examples
## Project Structure
## Important Patterns
## Version Compatibility
## Breaking Changes
## Contributing Guidelines
## Hidden Context
After generating the CLAUDE.md, ask:
IMPORTANT: The comprehensive template above is a REFERENCE showing all possible sections. DO NOT include all sections blindly. Instead:
Remember: A good CLAUDE.md is comprehensive yet focused. It should give Claude Code exactly what's needed to work effectively with THIS specific codebase, no more, no less.