code-quality
Code Quality Review
Review code quality in the directory provided by the user.
Instructions
-
Identify files to review:
- Find all
.pyfiles in the directory - Exclude migrations,
__pycache__, and generated files
- Find all
-
Run automated checks:
uv run ruff check <directory> uv run ruff format --check <directory> uv run pyright <directory> uv run pytest <directory> -v -
Manual review checklist:
- No
Anytypes without justification - Proper error handling (no silent exceptions)
- N+1 queries avoided (select_related/prefetch_related)
- Forms have proper validation
- Views return correct HTTP status codes
- HTMX partials handle HX-Request header
- Celery tasks are idempotent
- Tests use factories, not raw object creation
- No
-
Report findings organized by severity:
- Critical (must fix)
- Warning (should fix)
- Suggestion (could improve)
More from kjnez/claude-code-django
htmx-patterns
HTMX patterns for Django including partial templates, hx-* attributes, and dynamic UI without JavaScript. Use when building interactive UI, handling AJAX requests, or creating dynamic components.
31django-templates
Django template patterns including inheritance, partials, tags, and filters. Use when working with templates, creating reusable components, or organizing template structure.
30pytest-django-patterns
pytest-django testing patterns, Factory Boy, fixtures, and TDD workflow. Use when writing tests, creating test factories, or following TDD red-green-refactor cycle.
24django-forms
Django form handling patterns including ModelForm, validation, clean methods, and HTMX form submission. Use when building forms, implementing validation, or handling form submission.
16celery-patterns
Celery task patterns including task definition, retry strategies, periodic tasks, and best practices. Use when implementing background tasks, scheduled jobs, or async processing.
15django-models
Django model design patterns emphasizing fat models/thin views, QuerySet optimization, and domain logic encapsulation. Use when designing models, optimizing queries, implementing business logic, or working with the ORM.
14