b75266f67c
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2.7 KiB
2.7 KiB
Skill: Code Review (Flutter)
Perform an interactive code review of Flutter/Dart changes.
Process
- READ CLAUDE.md to understand the project's conventions and architecture
- Identify the scope: review staged changes, a specific file, a PR branch, or all changes since
dev- Staged:
git diff --cached - Branch:
git diff dev...HEAD - Specific file: read the file directly
- Staged:
- Review each changed file against the checklist below
- Output findings grouped by severity
Review Checklist
Flutter/Dart Quality
constconstructors used where possible- No
varwherefinalis clearer - No unused imports
snake_case.dartfile names,PascalCaseclasses- No
print()statements left in (use logging package or remove) mountedcheck before usingcontextafter anawait
Riverpod Patterns
ref.watchonly insidebuild()— not inside callbacks or event handlersref.readinside callbacks — not insidebuild()autoDisposeused for screen-scoped providers- Providers in
features/<name>/providers/— not inline in widgets - Provider names follow
camelCaseProvider/camelCaseNotifierconvention
Drift Usage
- Schema changes have a migration entry in
data/db/ .watch()used for reactive streams (not.get()for live UI)- No N+1 queries — related data fetched with joins where possible
- Generated
.g.dartfiles are up to date (or code gen was run)
Architecture
- Feature-first: no cross-feature direct widget imports
domain/entities/files have zero Flutter or Drift imports- Business logic is in use cases or providers — not in widgets/screens
- Repository interfaces abstract Drift and HTTP — screens never call Drift directly
Accessibility & UX
- All interactive elements have touch target >= 44x44px
- Icons and images have
SemanticsorsemanticLabel - List items have
key:parameter HapticFeedbackon task completion and important interactions
Performance
- Large lists use
ListView.builderorSliverList - No unnecessary rebuilds from over-broad
ref.watch - Static widget subtrees wrapped in
const
Output Format
[CRITICAL] Category: description
File: lib/path/file.dart (line N)
Issue: what is wrong
Fix: how to fix it
[WARNING] Category: description
...
[INFO] Category: description
...
If no issues found: output LGTM
Severity Guide
| Severity | Examples |
|---|---|
| CRITICAL | Null crash, missing await, broken migration, data loss risk, context after async without mounted check |
| WARNING | Architecture violation, missing autoDispose, no key on list items, touch target < 44px, .get() where .watch() needed |
| INFO | Naming issue, missing const, unused import, no doc comment on public API |