2.5 KiB
2.5 KiB
Code Review
Please perform a comprehensive code review of the current changes or specified files.
Review Scope
Scope for review $1 Link to must read PRP file if prp was used for implemnetaiton (skip if this is empty) $2
Review Process
- Understand Changes
- If reviewing staged changes:
git diff --staged - If reviewing specific files: Read the specified files
- If reviewing a PR:
gh pr view --json files,additions,deletions - If reviewing a local directory:
git diff - If reviewing the entire codebase:
git diff origin/main
- If reviewing staged changes:
Review Focus Areas
-
Code Quality
- Type hints on all functions and classes
- Pydantic v2 models for data validation
- No print() statements (use logging)
- Proper error handling
- Following PEP 8
- Docstrings following google style python docstrings
-
Pydantic v2 Patterns
- Using ConfigDict not class Config
- field_validator not @validator
- model_dump() not dict()
- Proper use of Annotated types
-
Security
- Input validation on all endpoints
- No SQL injection vulnerabilities
- Passwords properly hashed
- No hardcoded secrets
-
Structure
- Unit tests are co-located with the code they test in tests/ folders
- Each feature is self-contained with its own models, service, and tools
- Shared components are only things used by multiple features
- Future improvements (like multiple AI providers) would go in src/shared/ai_providers/ when implemented
- Integration tests remain at the root level in tests/integration/
-
Linting
- ruff check --fix
- mypy
-
Testing
- New code has tests
- Edge cases covered
- Mocking external dependencies
-
Performance
- No N+1 queries
- Efficient algorithms
- Proper async usage
-
Documentation
- Clear README with setup instructions
- CLAUDE.md is up to date with any new important utils, dependencies etc for future cluade code instances
Review Output
Create a concise review report with:
# Code Review #[number]
## Summary
[2-3 sentence overview]
## Issues Found
### 🔴 Critical (Must Fix)
- [Issue with file:line and suggested fix]
### 🟡 Important (Should Fix)
- [Issue with file:line and suggested fix]
### 🟢 Minor (Consider)
- [Improvement suggestions]
## Good Practices
- [What was done well]
## Test Coverage
Current: X% | Required: 80%
Missing tests: [list]
Save report to PRPs/code_reviews/review[#].md (check existing files first)