Agent skill

Flutter Best Practices

by evanca in evanca/flutter-ai-rules

A skill your agent uses when writing, reviewing, refactoring, or planning Flutter/Dart code — screens, features, project structure, state management, folders, widgets, cubits/blocs, repositories…

MITAuto-check passedMobile

Install Flutter Best Practices

skills CLI
$ npx skills add evanca/flutter-ai-rules --skill flutter-best-practices -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install evanca/flutter-ai-rules flutter-best-practices --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/evanca/flutter-ai-rules.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/flutter-best-practices .claude/skills/flutter-best-practices && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
flutter-best-practices
GitHub stars
649
Token cost
~1.7k tokens
SKILL.md length
775 words
Files
6 (incl. references)
Skills in repo
37
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when writing, reviewing, refactoring, or planning Flutter/Dart code — screens, features, project structure, state management, folders, widgets, cubits/blocs, repositories…

  • Works in 5 steps: Separate UI from data. Two broad layers:… → Views hold no business logic. Widgets… → Organize by feature, not by layer.… → …
  • Planning Flutter/Dart code — screens
  • SKILL.md covers How to use this skill, Core rules (always apply), Workflow checklists and Package palette
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Flutter Best Practices is an agent skill from evanca/flutter-ai-rules. Use when writing, reviewing, refactoring, or planning Flutter/Dart code — screens, features, project structure, state management, folders, widgets, cubits/blocs, repositories, services, or tests.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including reference files (for example `references/architecture-layers.md`, `references/dart-coding-practices.md` and `references/enterprise-scale.md`).

It sits in Mobile, covering Cross-platform mobile apps. It works with Flutter and Dart. The repository describes itself as: Flutter AI Skills and Rules for Claude, Codex, Cursor, and Other AI-Powered IDEs. The licence is MIT.

When your agent uses it

  • Planning Flutter/Dart code — screens
  • Project structure
  • State management

Example prompts

  • “/flutter-best-practices”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Separate UI from data. Two broad layers: UI (views + view models /
  2. Views hold no business logic. Widgets may contain show/hide
  3. Organize by feature, not by layer. Everything a feature needs — state
  4. State is immutable and explicit. Model UI state as a sealed/union type
  5. Add layers only when they pay for themselves. Start with

What it can do on your machine

Read from SKILL.md and the folder at commit 7b9cce2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Flutter Best Practices loads about 1.7k tokens when it runs, and up to ~8.5k if it reads all its reference files. Until then it costs about 55 tokens; SKILL.md has 775 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~55
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~8.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from evanca/flutter-ai-rules at commit 7b9cce2, republished under its MIT licence (© evanca). 775 words, ~1,660 tokens.

Download SKILL.mdSave it as .claude/skills/flutter-best-practices/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
flutter-best-practices
description
Use when writing, reviewing, refactoring, or planning Flutter/Dart code — screens, features, project structure, state management, folders, widgets, cubits/blocs, repositories, services, or tests.
license
MIT

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.

How to use this skill

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).

TaskRead
Design layers, decide where logic lives, MVVM, repositories/servicesreferences/architecture-layers.md
Create/organize a feature, folder structure, state management wiringreferences/feature-structure.md
Write or review Dart/Flutter code, widgets, tests, lintsreferences/dart-coding-practices.md
Multi-team/multi-package apps, monorepo, navigation, localization, API contracts, E2E testsreferences/enterprise-scale.md
App localization setup, reusable UI package string ownership, language picker visibilityreferences/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.

Core rules (always apply)

Architecture
  1. Separate UI from data. Two broad layers: UI (views + view models / 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.
  2. Views hold no business logic. Widgets may contain show/hide 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.
  3. Organize by feature, not by layer. Everything a feature needs — state management, widgets, models — lives under one feature directory. Don't create top-level blocs/, widgets/, models/ buckets that scatter a feature across the tree.
  4. State is immutable and explicit. Model UI state as a sealed/union type (initial / inProgress / failure / ready) so every case is handled exhaustively. One-off effects (snackbars, navigation) are events, not state.
  5. Add layers only when they pay for themselves. Start with 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.
Coding
  1. Prefer intent-revealing widgets over Container. Use Padding, SizedBox, ColoredBox, DecoratedBox, Center — they are const-able and self-describing. Container is fine only when combining several properties at once.
  2. Use modern Dart. Pattern matching (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).
  3. Prefix sliver-returning widgets with Sliver so misuse in the wrong scroll context is caught at a glance.
  4. Tests tell a story. Use expressive matchers (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.
  5. Every // ignore: gets a reason on the same or preceding line. Log errors with dedicated error/stackTrace parameters, never string interpolation.
Show full SKILL.md (296 more words)Show less

Workflow checklists

Adding a new feature/screen
  1. Read references/feature-structure.md and mirror the existing project's conventions for the feature directory.
  2. Define the state as a union type first; then the cubit/view model; then the widgets. Constructor-inject dependencies; scope them to the feature's widget subtree.
  3. Data comes in through a repository or typed API client — never fetched inside a widget.
  4. Add unit tests for the cubit/view model logic before wiring UI details.
Reviewing Flutter code

Check, in order of importance:

  1. Logic in the right layer (rule 1–2)? Any BuildContext in business logic?
  2. State modeled as immutable union types, all cases handled?
  3. Feature self-contained, or does it reach into another feature's internals?
  4. Widget choices (rule 6), modern Dart (rule 7), sliver naming (rule 8)?
  5. Tests present for logic, readable, minimal dependencies?
  6. Unexplained // ignore:, string-interpolated error logs, deprecated patterns still spreading?
Starting a new project
  1. Read references/architecture-layers.md for the layer blueprint and references/feature-structure.md for the folder skeleton.
  2. If more than ~2 teams or clearly separable domains are involved, read references/enterprise-scale.md and consider a Melos monorepo with one package per domain from day one.
  3. Set up strict lints early (leancode_lint or equivalent + custom rules) — retrofitting is far more expensive.

Package palette

Defaults that these standards assume (swap for project-local equivalents when the codebase already uses something else):

  • State: bloc (Cubit) + freezed for union-type states; bloc_presentation for one-off UI events
  • DI: provider scoped to widget subtrees (accepting its lack of compile-time safety as the lesser evil)
  • Boilerplate reduction: flutter_hooks
  • Monorepo: melos
  • Localization: flutter_localizations + intl with .arb files
  • Lints: leancode_lint
  • E2E/UI tests: patrol

The 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.

© evanca, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (references) in skills/flutter-best-practices of evanca/flutter-ai-rules.

  • SKILL.md
  • references/architecture-layers.md
  • references/dart-coding-practices.md
  • references/enterprise-scale.md
  • references/feature-structure.md
  • references/localization-package-boundaries.md

Open the folder on GitHubat commit 7b9cce2

Compare with similar skills

Flutter Best Practices next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Flutter Best Practices compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Flutter Best Practices this skillevanca/flutter-ai-rules649—~1.7kAutomated safety check: PassMIT
Engine Whats Newflutter/flutter179k—~978Automated safety check: PassBSD-3-Clause
Flutter Cherry Pickflutter/flutter179k—~1.8kAutomated safety check: PassBSD-3-Clause
Upgrade Browserflutter/flutter179k—~1.1kAutomated safety check: PassBSD-3-Clause
Bump Dartflutter/flutter179k—~1.2kAutomated safety check: PassBSD-3-Clause
Run Devicelab With Ledflutter/flutter179k—~786Automated safety check: PassBSD-3-Clause

Similar skills

  • Engine Whats New

    flutter/flutter

    Generates the "what's new" release summary and diff file for changes in the Flutter engine (//engine/src/flutter) between two releases (e.g., 3.47 vs 3.44).

    179k GitHub stars~978 tokensUpdated today
    MobileAuto-check passed
  • Flutter Cherry Pick

    flutter/flutter

    How to land a formal cherry-pick of a merged PR for the flutter/flutter repo stable or beta channel.

    179k GitHub stars~1.8k tokensUpdated today
    MobileAuto-check passed
  • Upgrade Browser

    flutter/flutter

    Upgrade browser versions (Chrome or Firefox) in the Flutter Web Engine and/or Framework tests.

    179k GitHub stars~1.1k tokensUpdated today
    MobileAuto-check passed
  • Bump Dart

    flutter/flutter

    Do not trigger automatically; only run when a user runs /bump-dart.

    179k GitHub stars~1.2k tokensUpdated today
    MobileAuto-check passed
  • Run Devicelab With Led

    flutter/flutter

    Run DeviceLab tests for Flutter PRs using LUCI's led CLI tool.

    179k GitHub stars~786 tokensUpdated today
    MobileAuto-check passed
  • Shepherd PRs

    flutter/flutter

    Automate shepherding, checking status, updating branches, and landing open PRs or approved third-party contributor PRs in the flutter/flutter repository using the gh CLI.

    179k GitHub stars~1.7k tokensUpdated today
    MobileAuto-check passed

More from evanca/flutter-ai-rules

All 37 skills in this repo
  • Code Review

    evanca/flutter-ai-rules

    A skill your agent uses when asked to review a PR, MR, branch, or diff, audit changed files, or check code quality.

    649 GitHub stars~2.4k tokensUpdated 24 days ago
    Auto-check passed
  • Developing Genkit Dart

    evanca/flutter-ai-rules

    A skill your agent uses when building AI agents in Dart, implementing Genkit flows or tools, integrating LLMs into Dart or Flutter applications, or using Genkit Dart plugins.

    649 GitHub stars~961 tokensUpdated 24 days ago
    Auto-check passed
  • Generate Images With Firebase AI

    evanca/flutter-ai-rules

    A skill your agent uses when generating or editing images from Flutter/Dart with Firebase AI Logic and a Gemini image model (Nano Banana), making the first call work, choosing Gemini Developer API…

    649 GitHub stars~2.3k tokensUpdated 24 days ago
    Auto-check passed
  • Flutter Use Column Row First

    evanca/flutter-ai-rules

    A skill your agent uses when building any Flutter screen or component to choose responsive Row, Column, Expanded, Flexible, and Spacer layouts before fixed-size or coordinate-based alternatives.

    649 GitHub stars~1.3k tokensUpdated 24 days ago
    Auto-check passed
  • Architecture Feature First

    evanca/flutter-ai-rules

    A skill your agent uses when creating a feature, designing folder structure, adding repositories/services/view models, wiring dependency injection, or deciding which layer owns logic.

    649 GitHub stars~1.9k tokensUpdated 24 days ago
    Auto-check passed
  • Bloc

    evanca/flutter-ai-rules

    A skill your agent uses 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…

    649 GitHub stars~2.8k tokensUpdated 24 days ago
    Auto-check passed

Works with

Categories

Questions about Flutter Best Practices

What does Flutter Best Practices do?

A skill your agent uses when writing, reviewing, refactoring, or planning Flutter/Dart code — screens, features, project structure, state management, folders, widgets, cubits/blocs, repositories…. Flutter Best Practices is an agent skill from evanca/flutter-ai-rules. Use when writing, reviewing, refactoring, or planning Flutter/Dart code — screens, features, project structure, state management, folders, widgets, cubits/blocs, repositories, services, or tests.

When should I use Flutter Best Practices?

Flutter Best Practices fits situations like: planning Flutter/Dart code — screens; project structure; state management.

How do I install Flutter Best Practices in Claude Code?

Run `npx skills add evanca/flutter-ai-rules --skill flutter-best-practices -a claude-code`. Or copy the skill folder (skills/flutter-best-practices in evanca/flutter-ai-rules) into .claude/skills/flutter-best-practices in your project. Claude Code loads it when a task matches its description.

How do I install Flutter Best Practices in Codex?

Run `npx skills add evanca/flutter-ai-rules --skill flutter-best-practices -a codex`. Or copy the skill folder (skills/flutter-best-practices in evanca/flutter-ai-rules) into .agents/skills/flutter-best-practices in your project. Codex loads it when a task matches its description.

Can I use Flutter Best Practices in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add evanca/flutter-ai-rules --skill flutter-best-practices -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/flutter-best-practices, .gemini/skills/flutter-best-practices, .github/skills/flutter-best-practices and .opencode/skills/flutter-best-practices in your project.

What does Flutter Best Practices need to run?

SKILL.md names no scripts, command-line tools or credentials: Flutter Best Practices is instructions for the agent only.

Does Flutter Best Practices access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Flutter Best Practices safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Flutter Best Practices use?

Flutter Best Practices is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Flutter Best Practices use?

About 1.7k tokens (SKILL.md is roughly 6.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 6.9k tokens, read only when the agent opens those files.

What are the alternatives to Flutter Best Practices?

Skills that share tags, products or a category with Flutter Best Practices: Engine Whats New (flutter/flutter, 179k stars), Flutter Cherry Pick (flutter/flutter, 179k stars), Upgrade Browser (flutter/flutter, 179k stars) and Bump Dart (flutter/flutter, 179k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Flutter Best Practices?

evanca (a GitHub user) maintains it in evanca/flutter-ai-rules, which has 649 GitHub stars. The repository holds 37 skills in this directory. The repository was last updated on September 14, 2026.

Source: evanca/flutter-ai-rules on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.