This is an example project-level CLAUDE.md file. Place this in your project root.
[Brief description of your project - what it does, tech stack]
- Many small files over few large files
- High cohesion, low coupling
- 200-400 lines typical, 800 max per file
- Organize by feature/domain, not by type
- No emojis in code, comments, or documentation
- Immutability always - never mutate objects or arrays
- No console.log in production code
- Proper error handling with try/catch
- Input validation with Zod or similar
- TDD: Write tests first
- 80% minimum coverage
- Unit tests for utilities
- Integration tests for APIs
- E2E tests for critical flows
- No hardcoded secrets
- Environment variables for sensitive data
- Validate all user inputs
- Parameterized queries only
- CSRF protection enabled
src/
|-- app/ # Next.js app router
|-- components/ # Reusable UI components
|-- hooks/ # Custom React hooks
|-- lib/ # Utility libraries
|-- types/ # TypeScript definitions
interface ApiResponse<T> {
success: boolean
data?: T
error?: string
}try {
const result = await operation()
return { success: true, data: result }
} catch (error) {
console.error('Operation failed:', error)
return { success: false, error: 'User-friendly message' }
}# Required
DATABASE_URL=
API_KEY=
# Optional
DEBUG=false/tdd- Test-driven development workflow/plan- Create implementation plan/code-review- Review code quality/build-fix- Fix build errors
- Conventional commits:
feat:,fix:,refactor:,docs:,test: - Never commit to main directly
- PRs require review
- All tests must pass before merge