/flutter-code-quality:architecturefrom flutter-code-quality
Places or refactors Flutter feature code following the project's existing architecture and dependency boundaries. Enforces domain/presentation separation, inward dependency direction, and repository interface patterns.
Ships in flutter-code-quality. 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.
Profile first. Read
.agents/flutter-profile.yamlin the project root before placing any file. This skill is governed bystructure,state, anddi. With no profile, discover the architecture and stack from source before using the example below. The example is not a migration target. Understructure: layer_firstthe layers are top-level directories and features are subdirectories inside them; the rules about which direction dependencies point are unchanged. If the.agentsprofile is absent, check legacy.claude/flutter-profile.yaml. Field list:references/flutter-profile.md.
The following feature-first example fits layered projects. Preserve simpler or custom architectures when that is what the project uses. The rules exist to keep business logic testable without a Flutter binding and swappable without touching the UI.
lib/
├── core/ # shared across features
│ ├── theme/ # tokens, ThemeExtension
│ ├── network/ # Dio setup, interceptors
│ ├── errors/ # Failure types
│ └── widgets/ # genuinely shared widgets
└── features/
└── wallet/
├── domain/ # pure Dart — no flutter/ imports at all
│ ├── entities/
│ ├── repositories/ # abstract interfaces only
│ └── usecases/
├── data/
│ ├── models/ # DTOs with fromJson/toJson
│ ├── datasources/ # remote and local
│ └── repositories/ # concrete implementations
└── presentation/
├── cubit/
├── pages/
└── widgets/
Domain imports nothing from Flutter. Not material.dart, not widgets.dart, not
even for Color or IconData. Keeping domain independent of Flutter lets its tests run as ordinary Dart tests and
avoids unnecessary widget/runtime coupling. If domain needs to express a
visual concept, it returns an enum and presentation maps it.
Dependencies point inward. Presentation knows domain. Data knows domain. Domain
knows nothing about either. A domain file importing from data/ is the inversion this
structure exists to prevent.
Repositories are interfaces in domain, implementations in data. The Cubit depends on the interface, which is what makes it testable with a mock instead of a live API.
No BuildContext below presentation. A use case taking a context has bound business
logic to the widget tree.
Separate entities and DTOs when their shapes or responsibilities differ. Preserve existing simple models when a second type would only duplicate fields. Keep transport conversion at the data boundary.
| Thing | Layer |
|---|---|
| "Transfer requires balance ≥ amount" | domain/usecases |
| "Balance shows two decimals" | presentation |
| "The API returns cents as an int" | data/models |
| "Failed transfers retry twice" | data/repositories |
| "The button is disabled while loading" | presentation/cubit |
A use case that only forwards a call to a repository adds a file and no behaviour. For a straight read with no rules, let the Cubit call the repository directly. Add the use case when there is actual logic to hold — validation, orchestration across repositories, business rules. Ceremony for its own sake makes a codebase harder to read, not more correct.
utils/ or helpers/ folder at the root. It becomes a dumping ground within a
month. Put the function next to what uses it.core/widgets/ on first reuse. Wait for the third usage —
two usages that diverge later are cheaper to split than to un-merge.What SKILL.md sets; muted values are Claude Code's defaults
8 skills in this plugin
/a11y-and-rtlImplement or review Flutter semantics, keyboard access, text scaling, localization, and RTL behavior for affected user-facing controls./codebase-conventionsFind and reuse existing Flutter components, styles, assets, and naming conventions before adding or changing UI code./flutter-adaptInspect a Flutter project and create or regenerate its agent profile and conventions when explicitly requested. Preserve existing user decisions.npx claudepluginhub draz26648/flutter_craft_skills --plugin flutter-code-qualityOther plugins' skills for the same job