/flutter:naming-conventionsfrom Flutter Skills
Enforces Effective-Dart naming: UpperCamelCase types, lowerCamelCase members/constants, lowercase_with_underscores files, plus architectural role suffixes (Screen/Notifier/Repository/Dao/Service/Gateway/Failure) so names reveal layers.
Ships in Flutter 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.
None: SKILL.md is the whole skill.
Consistent, role-carrying names make code searchable and self-explaining, and the suffix on a type declares which layer it lives in — so a reviewer, a grep, and a banned-import gate can all read the layer off the name alone. This skill is the how; the normative what is Effective Dart. Never invent a house style that contradicts the language's own.
UpperCamelCase. Classes, enums, mixins, extensions, typedefs, type parameters: TaskScreen, OrderStatus, Predicate<T>. Consistent shape makes types visually distinct from values.lowerCamelCase. dueDate, loadTasks(), itemCount. It is the language default; deviating costs readers a double-take.lowerCamelCase, never SCREAMING_CAPS. const maxItemsPerPage = 50; — not const MAX_ITEMS = 50. Dart dropped the C convention; the analyzer expects constant_identifier_names.lowercase_with_underscores. task_detail_screen.dart, features/task_detail/, import 'package:app_core/app_core.dart';. Cross-platform filesystems and pub demand it.TaskNotifier lives in task_notifier.dart. No utils.dart/helpers.dart/models.dart grab-bags and no utils//common//helpers//misc/ junk-drawer folders — a reader who greps a symbol must land in the file that owns it. core/ is the sanctioned pure-foundation layer (value objects, Result/Failure, the Clock seam, pure calculators), not a junk-drawer — see project-structure-and-packages, which owns the layout.Json, Http, Url, Api → JsonOrder, HttpClient, fromJson, imageUrl — not JSONOrder, HTTPClient. Two-letter caps-in-English acronyms may stay caps as types (ID, UI). Mixed-case acronyms are unsearchable and inconsistent._ to "namespace" it; that makes it unusable from another file. Public (no _) is a documented contract — see dartdoc-conventions.strName, iCount, lstItems, userMap, nameString, itemsList. The type system already knows the type; write name, usersById, items.maxItemsPerPage, retryDelaySeconds, orderTotalMinorUnits — never bare max, delay, total. Abbreviations (opt, qty, amt) are confined to the inside of one short pure function with a comment mapping them. A name that omits its unit invites a unit bug.isLoading, hasError, canSubmit, shouldRetry — not loading, error, retry. Boolean getters and methods start is/has/can/should so a condition reads like prose.get-prefixed accessors. Expose dueTasks, not getDueTasks(). Dart has real getters. Functions are verb phrases (loadTasks(), scheduleReminder()); non-boolean getters are noun phrases (itemCount, nextDueDate).dart: first, then package:, then relative — each group alphabetized, exports in their own section after imports. Let dart format plus the directives_ordering lint enforce it; never hand-fight the formatter.A role suffix turns a name into a layer contract: a grep or a path-scoped import gate can tell a repository from a view from a platform boundary without opening the file. Use neutral domain nouns (Task, Order, Account, Item) for the entity token.
| Role | Suffix / pattern | Layer | File → symbol |
|---|---|---|---|
| Screen / route target | [Feature]Screen | UI (View) | task_list_screen.dart → TaskListScreen |
| Reusable widget | [Thing] (+ Widget only if ambiguous) | UI | task_card.dart → TaskCard |
| ViewModel (Riverpod, default) | [Feature]Notifier | UI (ViewModel) | task_list_notifier.dart → TaskListNotifier |
| ViewModel (Provider appendix only) | [Feature]ViewModel | UI (ViewModel) | task_list_view_model.dart → TaskListViewModel |
| Repository (interface) | [Entity]Repository | data | task_repository.dart → TaskRepository |
| Repository (impl) | Drift[Entity]Repository / Remote[Entity]Repository | data | drift_task_repository.dart |
| Drift DAO | [Entity]Dao | data | tasks_dao.dart → TasksDao |
| Capability interface you define | [Concern]Service | boundary | share_service.dart → ShareService |
| Service impl (per flavor) | [Provider][Concern]Service | app adapter | firebase_analytics_service.dart → FirebaseAnalyticsService |
| Wrapper over a specific plugin/SDK/native channel | [Concern]Gateway | boundary | notification_gateway.dart → NotificationGateway |
| Gateway impl | [Plugin][Concern]Gateway / Live[Concern]Gateway | app adapter | fln_notification_gateway.dart → FlnNotificationGateway |
| Pure-Dart domain logic | [Domain] + verb suffix (Calculator/Validator/Formatter) | domain | price_calculator.dart → PriceCalculator |
| Immutable model | domain noun, no suffix | any | task.dart → Task |
| Failure type | [Domain]Failure (sealed) | any | order_failure.dart → OrderFailure |
Notifier is the ViewModel role — never ViewModel or ChangeNotifier in the type name. On Riverpod 3.x the ViewModel is a Notifier/AsyncNotifier/StreamNotifier, one per Screen, 1:1, named [Feature]Notifier in [feature]_notifier.dart (file = primary declaration). [Feature]ViewModel in [feature]_view_model.dart is sanctioned ONLY in the Provider/ChangeNotifier appendix — never on the Riverpod path, and never [Feature]Controller. See state-management-riverpod.Service vs Gateway — both name provider-free boundary ports, distinguished by who owns the contract. A [Concern]Service is a capability interface YOU define (ShareService, AnalyticsService); a [Concern]Gateway is the thin wrapper over a SPECIFIC external plugin/SDK or native MethodChannel (NotificationGateway over flutter_local_notifications, SecureStorageGateway over flutter_secure_storage). Domain and UI code names the interface; the concrete impl (FirebaseAnalyticsService, FlnNotificationGateway) lives only in the composition root. A concrete impl name leaking into shared code is a grep-catchable smell. See service-boundary-and-native.Calculator/Validator/Formatter/Parser verb suffix and touch no Flutter. The suffix advertises that the type is framework-free and unit-testable without a widget.Encode a semantic distinction the type system can't in the name. A raw instant (DateTime.now()) used where a stable calendar value is expected is a common correctness bug; naming makes the boundary visible.
// A real wall-clock instant is legal only at the Clock boundary and named as one.
final DateTime capturedAt = clock.now(); // instant, from package:clock's Clock (never DateTime.now())
// A stored quantity carries its canonical unit in the name.
final int priceMinorUnits; // not `price` — unit is explicit
final int distanceMeters; // SI base unit, integer
// Unused callback params are `_` (and `__` for a second).
onChanged: (_) => notifier.refresh(),
See value-objects-money-and-units for canonical storage and service-boundary-and-native for the Clock (from package:clock) injected via clockProvider — never a bespoke ClockService.
// task_list_notifier.dart — file name == primary declaration, snake_cased
import 'dart:async'; // dart: group, alphabetized
import 'package:flutter_riverpod/flutter_riverpod.dart'; // package: group, alphabetized
import 'task.dart'; // relative group, alphabetized
/// Frozen paging bound — unit lives in the name (rule 9).
const int maxItemsPerPage = 50; // lowerCamelCase const, not SCREAMING_CAPS
/// ViewModel for [TaskListScreen]. One Notifier per Screen, 1:1 (role suffix).
class TaskListNotifier extends AsyncNotifier<List<Task>> {
@override
Future<List<Task>> build() => ref.watch(taskRepositoryProvider).loadTasks();
/// Verb-phrase command; routes through the repository's single write path.
Future<void> archive(String taskId) async {
await ref.read(taskRepositoryProvider).archive(taskId);
ref.invalidateSelf();
}
bool get hasTasks => state.valueOrNull?.isNotEmpty ?? false; // boolean assertion
int get taskCount => state.valueOrNull?.length ?? 0; // noun getter, no get- prefix
}
SCREAMING_CAPS constants in new Dart (const MAX_ITEMS = 50) — use lowerCamelCase; the analyzer flags it.TaskScreen living in home.dart), or a grab-bag utils.dart/models.dart holding unrelated things — breaks grep-to-file.…Calculator/…Validator (a pure-Dart suffix), or a Riverpod ViewModel …ViewModel/…VM/…Controller — the suffix then lies about the layer (…Notifier on the Riverpod path; …ViewModel only in the Provider appendix).FlnNotificationGateway, FirebaseAnalyticsService) referenced from shared/domain code — name the Gateway/Service interface; the impl belongs in the composition root.DateTime.now() captured into a field meant to be stable, or an unnamed instant crossing into domain logic — inject a Clock and name the instant (capturedAt).getDueTasks() / get/set prefixes — Dart has real getters.userMap, nameString, itemsList, strName, iCount.is/has/can/should (loading, valid); unit-silent quantities (total, delay)._ to "namespace" a public symbol (it makes it private and unreachable); l/O/I single letters or data/temp/foo in committed code.opt, qty, msg) outside a single short function with a mapping comment.dart format; obey directives_ordering.UpperCamelCase; members/vars/constants lowerCamelCase; files/folders/prefixes lower_snake_case.Screen/Notifier/Repository/Dao/Service/Gateway/Failure).…Notifier (not …Controller/…ViewModel/…VM); pure-Dart types carry a Calculator/Validator/Formatter suffix and no Flutter import; Service/Gateway interfaces are provider-free with impls confined to the composition root.Clock boundary.get prefix.dart:/package:/relative and alphabetized; dart format + dart analyze --fatal-infos clean.dart3-idioms-and-coding-standards — which construct (sealed/record/enum) each declaration earns, and complexity limits.state-management-riverpod — why the ViewModel is a Notifier, and the single write path.service-boundary-and-native — provider-free Service interfaces and their composition-root impls.value-objects-money-and-units — canonical-unit storage behind the unit-in-name rule.naming neighbors: dartdoc-conventions for the /// contract on public symbols, lint-and-style-config for the directives_ordering/constant_identifier_names enforcement, and flutter-architecture for the layer DAG the suffixes map to.constant_identifier_names, camel_case_types, file_names, directives_ordering, non_constant_identifier_names.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub zakariaf/flutter-skills --plugin flutter40 skills in this plugin
/accessibility-as-codeEnforces accessibility as a correctness property authored into each widget — Semantics(button/label) or ExcludeSemantics on every node, a11y state read from MediaQuery not app state, never MediaQuery.withClampedTextScaling / textScaleFactor / FittedBox / TextOverflow.ellipsis to fit a label, non-color redundant channels (icon+label+shape+text) for every state, contrast against composited backgrounds (4.5:1 body / 3:1 large), 44px single-tap targets, OrdinalSortKey traversal, and honoring boldText / reduce-motion. Use when adding a GestureDetector/InkWell or any tap target, adding an Icon or Image, reaching for withClampedTextScaling/FittedBox/ellipsis/textScaleFactor to make text fit, encoding state via color, sizing type, ordering focus traversal, or reviewing any View for screen-reader/switch/low-vision support./adaptive-layoutEnforces adapting layout by available CONSTRAINTS/size, never device or platform checks — LayoutBuilder + MediaQuery.sizeOf/paddingOf/viewInsetsOf (not .of) for narrow rebuilds, Material 3 window size classes (compact <600, medium 600-840, expanded 840-1200, large >1200) as the breakpoint vocabulary, navigation affordance chosen by width (NavigationBar → NavigationRail → NavigationDrawer), list-detail single-pane-vs-two-pane, readable max-width via ConstrainedBox, Flexible/Expanded/FractionallySizedBox over fixed widths, SafeArea + display cutouts + keyboard insets, never lock orientation, foldable/hinge awareness via MediaQuery.displayFeatures, and golden-matrix verification across sizes. Use when building responsive or adaptive UI, tablet/desktop/foldable support, master-detail or two-pane screens, a NavigationRail-vs-BottomNav shell, breakpoints, LayoutBuilder, MediaQuery sizing, SafeArea/cutouts, or fixing overflow at large widths./ads-and-iap-monetizationEnforces opt-in, rewarded-first monetization over the service seam — a rewarded view grants exactly one benefit and only on a genuine reward outcome (a sealed Rewarded/Dismissed/NoFill), earn loops capped per day against an injected Clock, the earn control preloaded and hidden unless an ad is loaded so a fresh account never dead-ends on "no ads available" (a Guideline 2.1 risk), interstitials only at a natural break under a count-and-elapsed cap owned by the service so callers stay dumb, no banner on the primary work surface, one non-consumable unlock plus Restore re-checked each launch and committed through the single write path before the UI reacts, one derived isEntitled provider as the only gate, and the entitlement restored BEFORE the ad SDK initializes so a paying user never starts it, resolves consent, or sees a tracking prompt. Use when adding ads, wiring a rewarded earn loop, placing an interstitial, building a paywall, gating an entitlement, or setting up ad units./app-startup-and-bootstrapEnforces a fixed main() cold-launch order — crash-log sink + FlutterError.onError + PlatformDispatcher.onError installed BEFORE any code that can throw, settings/theme read before runApp so the first frame paints correct, real infra constructed in a composition-root bootstrap() and injected via ProviderScope overrideWithValue over throwing placeholder providers, non-blocking warm-up deferred to addPostFrameCallback, exactly two error handlers with NO runZonedGuarded, ProviderException unwrapped before logging, and a WidgetsBindingObserver that flushes durable state on background/resume. Use when editing lib/main.dart, main_<flavor>.dart, bootstrap.dart or app.dart, reordering anything in main(), adding a splash/onboarding/permission gate, restoring theme before first paint, wiring a DB or service into ProviderScope, handling app-lifecycle background/resume flushes, or chasing cold-start latency, ANRs, or first-frame jank./async-safetyEnforces no-silent-failure async discipline in Flutter/Dart — the arrow-callback Future-drop hole no lint catches (`onTap: () => vm.save(x)`), void-returning event handlers, a mounted/ref.mounted guard after EVERY await before touching BuildContext, capturing Navigator/ScaffoldMessenger before the gap, honest `unawaited()` that always ends in catchError, no empty/bare catches, `rethrow` over `throw e`, and disposing every StreamSubscription/StreamController/Timer/sink. Use when writing or reviewing async/await, wiring onTap/onPressed/onSubmitted or any VoidCallback, touching BuildContext after an await, writing initState/dispose/addPostFrameCallback, adding a Timer or Future.delayed, writing a try/catch, or seeing use_build_context_synchronously, cancel_subscriptions, close_sinks, unawaited_futures, or discarded_futures./ci-pipeline-and-gatesEnforces a lean GitHub Actions Flutter CI where every gate maps to one named release-blocking contract — pinned runner + subosito/flutter-action@v2 toolchain, dart format --set-exit-if-changed, flutter analyze --fatal-infos, build_runner and drift schema freshness (git diff --exit-code), flutter test --test-randomize-ordering-seed random, static import/banned-string greps that catch what runtime can't, coverage-as-report-never-a-gate with the upward-lie fixed, verify-never-bless goldens (no --update-goldens in CI), and an honest statement of what CI cannot prove (audio, real fonts, on-device behaviour). Use when editing .github/workflows/*.yml, adding or removing a job or step, wiring a codegen/schema/format/analyze/coverage gate, writing a grep-based policy test or gate script under test/policy or tool/, pinning action versions, or claiming CI proves something it can't.Other plugins' skills for the same job