/flutter-ai-skills:flutter-best-practicesfrom Flutter AI Skills
Guides Flutter/Dart code structure, architecture layers, state management, and project organization following official Flutter architecture and LeanCode's production experience.
Ships in Flutter AI Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Standards for building maintainable Flutter apps, distilled from the official Flutter architecture guide and LeanCode's experience shipping 40+ Flutter projects (including a 30-developer banking app). Apply these when writing new code; when touching existing code, prefer consistency with the surrounding codebase and raise conflicts with these standards rather than silently rewriting.
Read the reference file that matches the task. Read more than one when tasks overlap (e.g. a new feature touches both structure and coding style).
| Task | Read |
|---|---|
| Design layers, decide where logic lives, MVVM, repositories/services | references/architecture-layers.md |
| Create/organize a feature, folder structure, state management wiring | references/feature-structure.md |
| Write or review Dart/Flutter code, widgets, tests, lints | references/dart-coding-practices.md |
| Multi-team/multi-package apps, monorepo, navigation, localization, API contracts, E2E tests | references/enterprise-scale.md |
| App localization setup, reusable UI package string ownership, language picker visibility | references/localization-package-boundaries.md |
For a quick task (small widget fix, one-line review comment), the core rules below may be enough on their own.
View → ViewModel → Repository → Service. Lower layers never import upper
layers. Repositories never depend on each other.BuildContext.blocs/, widgets/, models/ buckets that scatter a
feature across the tree.Container. Use Padding,
SizedBox, ColoredBox, DecoratedBox, Center — they are const-able
and self-describing. Container is fine only when combining several
properties at once.if (x case final v?)), switch
expressions with exhaustiveness, records and destructuring, collection
if/for/spreads instead of .add() loops, expression bodies for
pass-through async functions (no redundant async/await).Sliver so misuse in the wrong
scroll context is caught at a glance.isEmpty, throwsA,
isA, completion) and minimize dependencies — plain Text/SizedBox
over design-system widgets in test fixtures. Test cubits/view models in
isolation from the widget tree.// ignore: gets a reason on the same or preceding line. Log
errors with dedicated error/stackTrace parameters, never string
interpolation.Pin a minimum SDK that includes published security fixes, and keep projects current.
pubspec.yaml:
environment:
sdk: ">=3.13.7 <4.0.0"
flutter: ">=3.47.8"
Check, in order of importance:
BuildContext in business logic?// ignore:, string-interpolated error logs, deprecated
patterns still spreading?leancode_lint or equivalent + custom rules) —
retrofitting is far more expensive.Defaults that these standards assume (swap for project-local equivalents when the codebase already uses something else):
bloc (Cubit) + freezed for union-type states;
bloc_presentation for one-off UI eventsprovider scoped to widget subtrees (accepting its lack of
compile-time safety as the lesser evil)flutter_hooksmelosflutter_localizations + intl with .arb filesleancode_lintpatrolThe official Flutter guide is state-management-agnostic (MVVM with ChangeNotifier works too); what matters is the layer separation, not the package. See the reference files for rationale and trade-offs.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub evanca/flutter-ai-rules --plugin flutter-ai-skills36 skills in this plugin
/accessibilityUse when working on accessibility, a11y, WCAG, ARIA, screen readers, keyboard nav, focus order, contrast, alt text, captions, reduced motion, or target sizes; not language/culture/device (see inclusive-design)./architecture-feature-firstUse when creating a feature, designing folder structure, adding repositories/services/view models, wiring dependency injection, or deciding which layer owns logic./blocUse when creating a Cubit or Bloc, modeling state with sealed classes or status enums, wiring BlocBuilder/BlocListener/BlocProvider, writing bloc tests, or choosing between Cubit and Bloc./code-reviewUse when asked to review a PR, MR, branch, or diff, audit changed files, or check code quality./dart-3-updatesUse when writing switch statements, refactoring if-else chains, creating data classes, choosing records vs classes, destructuring values, or modernizing pre-Dart-3 code./developing-genkit-dartUse when building AI agents in Dart, implementing Genkit flows or tools, integrating LLMs into Dart or Flutter applications, or using Genkit Dart plugins.Other plugins' skills for the same job