Use when writing, reviewing, refactoring, or planning Flutter/Dart code — screens, features, project structure, state management, folders, widgets, cubits/blocs, repositories, services, or tests.
npx skills add https://github.com/evanca/flutter-ai-rules --skill flutter-best-practices
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.
cubits) and Data (repositories + services). Dependencies point one way:
View → ViewModel → Repository → Service. Lower layers never import upper
layers. Repositories never depend on each other.
conditionals, animation, layout, and simple routing logic — nothing that
transforms or decides about data. All data logic lives in the view model
(or cubit/bloc), which has no access to BuildContext.
management, widgets, models — lives under one feature directory. Don't
create top-level blocs/, widgets/, models/ buckets that scatter a
feature across the tree.
(initial / inProgress / failure / ready) so every case is handled
exhaustively. One-off effects (snackbars, navigation) are events, not
state.
view-model → API client. Introduce a repository when you need caching,
offline, or merging sources. Introduce a use case only when logic merges
multiple repositories, is genuinely complex, or is reused by several view
models.
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?)), switchexpressions 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 wrongscroll 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.
10. Every // ignore: gets a reason on the same or preceding line. Log
errors with dedicated error/stackTrace parameters, never string
interpolation.
and mirror the existing project's conventions for the feature directory.
the widgets. Constructor-inject dependencies; scope them to the feature's
widget subtree.
inside a widget.
Check, in order of importance:
BuildContext in business logic?// ignore:, string-interpolated error logs, deprecatedpatterns still spreading?
for the layer blueprint and
references/feature-structure.md for the
folder skeleton.
references/enterprise-scale.md and
consider a Melos monorepo with one package per domain from day one.
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 events
provider scoped to widget subtrees (accepting its lack ofcompile-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.
Control Cursor AI code editor via CLI. Open files, folders, diffs, and manage extensions.
Comprehensive checklist for conducting thorough code reviews covering functionality, security, performance, and maintainability
Systematically evaluate architecture decisions, document trade-offs, and select appropriate patterns. This skill should be used when the user asks about 'architecture decision', 'ADR', 'design pattern selection', 'technology choice', or needs to evaluate architectural trade-offs. Keywords: architecture, ADR, patterns, trade-offs, technical debt, quality attributes, decision record.
Facilitates deliberate skill development during AI-assisted coding. Offers interactive learning exercises after architectural work (new files, schema changes, refactors). Use when completing features, making design decisions, or when user asks to understand code better. Triggers on "learning exercise", "help me understand", "teach me", "why does this work", or after creating new files/modules. Do NOT use for urgent debugging, quick fixes, or when user says "just ship it".
Organize project files and folders for maintainability and scalability. Use when structuring new projects, refactoring folder structure, or establishing conventions. Handles project structure, naming conventions, and file organization best practices.
Automatically trigger review agents after task completion. Use when strategic-planner finishes planning tasks (calls plan-consultant) or when main agent completes coding tasks in /implement workflow (calls code-reviewer). Triggers on phrases like "plan complete", "implementation done", "coding finished", "ready for review".
Provides a structured workflow for planning and executing code reviews like a senior engineer. Use when asked to review code, PRs, or plan a code review task.
Recall project-first and global-supplement ChatCrystal memories before substantive implementation, refactoring, migration, configuration, investigation, or optimization work. Use when the task is non-trivial, has repository or project context, and prior fixes, decisions, pitfalls, or reusable patterns may change the approach.
Take evanca/flutter-best-practices from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.