Files
TaskManagerMobile/.claude/skills/code-review/SKILL.md
T
TrochtaOndrej b75266f67c feat: add Flutter pipeline agents and skills
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 05:13:47 +01:00

2.7 KiB

Skill: Code Review (Flutter)

Perform an interactive code review of Flutter/Dart changes.

Process

  1. READ CLAUDE.md to understand the project's conventions and architecture
  2. 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
  3. Review each changed file against the checklist below
  4. Output findings grouped by severity

Review Checklist

Flutter/Dart Quality

  • const constructors used where possible
  • No var where final is clearer
  • No unused imports
  • snake_case.dart file names, PascalCase classes
  • No print() statements left in (use logging package or remove)
  • mounted check before using context after an await

Riverpod Patterns

  • ref.watch only inside build() — not inside callbacks or event handlers
  • ref.read inside callbacks — not inside build()
  • autoDispose used for screen-scoped providers
  • Providers in features/<name>/providers/ — not inline in widgets
  • Provider names follow camelCaseProvider / camelCaseNotifier convention

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.dart files 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 Semantics or semanticLabel
  • List items have key: parameter
  • HapticFeedback on task completion and important interactions

Performance

  • Large lists use ListView.builder or SliverList
  • 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