| name | flutter-code-review |
| description | Use when reviewing Flutter code for correctness, architecture compliance, design system usage, linting, or testing coverage. Also use before merging a PR or when the user asks for a code review of Dart or Flutter files. |
| metadata | {"author":"Desquared"} |
Code Review Skill
7 Criteria
1. Functionality (๐ด Blocker)
- Logic errors, missing error handling, null safety violations
2. Readability (๐ Major)
- Clear naming, proper comments, no dead code
3. Optimization (๐ Major)
- Unnecessary rebuilds, N+1 queries, missing const
4. Architecture (๐ Major)
- data/domain/view pattern, repository pattern, @injectable DI
5. Design System (๐ Major)
- ColorPalette, Spacing, Project Design System Widgets (no hardcoded)
6. Linting (๐ด Blocker)
flutter analyze must pass (zero errors)
7. Testing (Optional)
- 90%+ unit, 50%+ widget coverage (suggest, don't block)
Quick Checks
// โ Hardcoded color
Text('Hi', style: TextStyle(color: Colors.red))
// โ
Use ColorPalette
Text('Hi', style: TextStyle(
color: ColorPalette.coloursBasicText.platformBrightnessColor(context),
))
// โ Business logic in widget
final total = items.fold(0, (s, i) => s + i.price);
// โ
Logic in Bloc/Cubit
@injectable class MyBloc { ... }
// โ No error handling
Future<Data> fetch() async {
return await api.call();
}
// โ
Try-catch
Future<Data> fetch() async {
try {
return await api.call();
} catch (e) {
throw NetworkException(e.toString());
}
}
Severity
- ๐ด Blocker: Must fix (functionality, security, linting)
- ๐ Major: Should fix (performance, architecture, design system)
- ๐ข Minor: Nice to fix (naming, comments)
Process
flutter analyze (must pass)
- Check file structure (data/domain/view)
- Verify design system usage
- Check state management (@injectable)
- Verify error handling
- Check tests (suggest improvements)
Source: Desquared/agents-rules-skills โ distributed by TomeVault.