К основному содержанию
скилл CX Codex

flutter-best-practices — скилл для Claude Code: установка и правила

Скилл flutter-best-practices для Claude Code задаёт правила Flutter и Dart: слои, структура фич, виджеты и тесты. Агент читает нужный файл-справочник под задачу.

MIT ★ 674 обновлён 2026-10-29

Установить в Claude Code · Через маркетплейс плагинов Все способы и платформы ↓
/plugin marketplace add evanca/flutter-ai-rules
/plugin install flutter-ai-skills@flutter-ai-rules
Открыть на GitHub

Что делает flutter-best-practices

Скилл задаёт стандарты для Flutter-приложения: два слоя, UI и данные, зависимости идут в одну сторону View → ViewModel → Repository → Service. Виджеты не держат бизнес-логику, а фича живёт в одной папке вместо общих blocs/ и widgets/. Состояние описывается неизменяемым union-типом, чтобы разбор случаев был исчерпывающим.

Внутри пять файлов-справочников: architecture-layers.md, feature-structure.md, dart-coding-practices.md, enterprise-scale.md и localization-package-boundaries.md. Агент открывает тот, что совпадает с задачей, и может взять два сразу, если задача затрагивает и структуру, и стиль кода. Отдельно лежат чек-листы: новая фича, ревью, старт проекта. Для мелочи вроде правки одного виджета хватает десяти основных правил в самом SKILL.md.

Пакеты, на которые рассчитан набор, — bloc с freezed, provider, melos, leancode_lint, patrol. Это отправная точка: если в кодовой базе уже другой стек, скилл велит взять местные аналоги. На чужом коде он держится окружающих конвенций и предлагает обсудить расхождения со стандартом, а не переписывать молча. Если ждёте массового авторефакторинга, получите замечания по слоям и состоянию.

Какие задачи решает

  • Разложить фичу по папкам, чтобы состояние, виджеты и модели лежали рядом
  • Решить, где живёт логика: во вью-модели, репозитории или сервисе
  • Проверить Flutter-код на BuildContext в бизнес-логике и необъяснённые // ignore:
  • Выбрать Padding или SizedBox вместо всеядного Container
  • Спланировать monorepo на Melos, когда над проектом работает несколько команд

Примеры запросов агенту

  • Добавь экран корзины: сначала состояние, потом кубит, потом виджеты
  • Отревьюй lib/features/cart/cart_cubit.dart — проверь слои и обработку всех состояний
  • Спланируй структуру папок для нового Flutter-проекта под две команды

Как установить flutter-best-practices

1Через маркетплейс плагинов

/plugin marketplace add evanca/flutter-ai-rules
/plugin install flutter-ai-skills@flutter-ai-rules

Команда ставит плагин flutter-ai-skills целиком, со всеми его скиллами

2Через Skills CLI (Vercel)

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

3Вручную: положить файлы

~/.claude/skills/flutter-best-practices/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/flutter-best-practices/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о flutter-best-practices

Как установить flutter-best-practices в Claude Code?

Добавьте маркетплейс командой /plugin marketplace add evanca/flutter-ai-rules, затем поставьте плагин: /plugin install flutter-ai-skills@flutter-ai-rules.

Что делает flutter-best-practices?

Даёт агенту правила Flutter и Dart: разделение слоёв, структура фичи, выбор виджетов, современный синтаксис Dart, тесты. Под каждую задачу он подтягивает нужный файл-справочник.

Нужен ли bloc, если в проекте уже другой стейт-менеджмент?

Пакеты из набора — умолчание, а не требование. Скилл велит брать местные аналоги, когда кодовая база уже использует что-то другое: важен слой, а не конкретная библиотека.

Исходный текст

SKILL.md · MIT
---
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).

| Task | Read |
|---|---|
| Design layers, decide where logic lives, MVVM, repositories/services | [references/architecture-layers.md](references/architecture-layers.md) |
| Create/organize a feature, folder structure, state management wiring | [references/feature-structure.md](references/feature-structure.md) |
| Write or review Dart/Flutter code, widgets, tests, lints | [references/dart-coding-practices.md](references/dart-coding-practices.md) |
| Multi-team/multi-package apps, monorepo, navigation, localization, API contracts, E2E tests | [references/enterprise-scale.md](references/enterprise-scale.md) |
| App localization setup, reusable UI package string ownership, language picker visibility | [references/localization-package-boundaries.md](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.

## 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

6. **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.
7. **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`).
8. **Prefix sliver-returning widgets with `Sliver`** so misuse in the wrong
   scroll context is caught at a glance.
9. **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.
10. **Every `// ignore:` gets a reason** on the same or preceding line. Log
    errors with dedicated `error`/`stackTrace` parameters, never string
    interpolation.

## Workflow checklists

### Adding a new feature/screen

1. Read [references/feature-structure.md](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](references/architecture-layers.md)
   for the layer blueprint and
   [references/feature-structure.md](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](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.

© Ivanna Kaceviča · MIT · evanca/flutter-ai-rules

Похожие скиллы

Все скиллы по теме «Мобильная разработка» →
Flutter App taste f Промпт Flutter App taste для ChatGPT задаёт стандарты разработки кроссплатформенных мобильных приложений на Flutter. Задействуется при проектировании архитектуры и написании кода. GP ChatGPT ★ 178 201звёзд репо very-good-ai-flutter-plugin VeryGoodOpenSource Плагин very-good-ai-flutter-plugin для Claude Code задаёт стандарты разработки Flutter и Dart: BLoC, GoRouter, тесты и автоматическое форматирование кода. ★ 180звёзд репо flutter-expert https://github.com/Jeffallan Скилл flutter-expert для разработки кросс-платформных приложений на Flutter 3+ и Dart. Помогает с виджетами, управлением состоянием через Riverpod или Bloc, маршрутизацией GoRouter и оптимизацией производительности. CX Codex +1 14 900установок dart-flutter-patterns affaan-m Скилл dart-flutter-patterns для Claude Code и Codex: готовые паттерны Dart и Flutter — null safety, состояние, навигация, сеть. Ускоряет написание и ревью кода на Flutter. CX Codex +1 6 400установок flutter-dev MiniMax-AI Скилл flutter-dev для Claude Code помогает создавать Flutter-приложения и настраивать управление состоянием, навигацию и тесты. Он подключается к задачам с виджетами, адаптивной вёрсткой и производительностью. CX Codex +1 2 000установок flutter Mindrally Задаёт правила разработки на Flutter и Dart: чистую архитектуру по фичам, управление состоянием через Riverpod или BLoC и ограничения на вложенность виджетов. CX Codex +1 975установок

Из того же набора39

Весь набор →
firebase-analytics Скилл firebase-analytics для Claude Code помогает настраивать Firebase Analytics в приложениях Flutter. Подключается при добавлении событий, свойств пользователей, воронок и отслеживания экранов. CX Codex +1 ★ 674звёзд репо patrol-e2e-testing Скилл patrol-e2e-testing пишет и запускает E2E-тесты на Patrol 4.x для Flutter: пользовательские сценарии, системные диалоги разрешений, деплинки. CX Codex +1 ★ 674звёзд репо revenuecat-testing Скилл revenuecat-testing помогает составить план тестирования встроенных покупок и подписок в RevenueCat, проверить события в песочнице и разобрать сбои. CX Codex +1 ★ 674звёзд репо firebase-app-check Скилл помогает внедрить Firebase App Check во Flutter: выбрать провайдеров, настроить debug-токены и включить проверку запросов. CX Codex +1 ★ 674звёзд репо flutter-app-architecture Скилл flutter-app-architecture задаёт правила многослойной архитектуры Flutter-проекта: MVVM, репозитории, сервисы и однонаправленный поток данных. CX Codex +1 ★ 674звёзд репо riverpod Скилл помогает писать Flutter- и Dart-код с Riverpod: настраивать провайдеры, управлять их жизненным циклом и проверять их тестами. Пригодится при работе с состоянием приложения. CX Codex +1 ★ 674звёзд репо architecture-feature-first Скилл architecture-feature-first задаёт слоистую feature-first архитектуру для Flutter: где лежит UI, где данные и когда нужен доменный слой. CX Codex +1 ★ 674звёзд репо inclusive-design Скилл inclusive-design помогает проектировать интерфейсы с учётом медленного интернета, дешёвых смартфонов, нестандартных имён и низкого цифрового опыта. Не заменяет WCAG. CX Codex +1 ★ 674звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой