flutter-architecture
Installation
SKILL.md
Flutter Architecture
Structure every Flutter app as a layered, feature-first MVVM system, sized to the app. You must always answer "where does this code belong?" in one second. Based on Flutter's official Guide to app architecture, with Riverpod 3.x as the one mechanism for both state and dependency injection.
Two failure modes kill an architecture: under-structure (a widget touching a database) and
over-structure (a *UseCase wrapping one repository call, an interface over code that already runs in
a test). This skill fights both. Start small; add a layer only when it carries a load you can name.
Read the reference for the task at hand:
references/module-and-layers.md— the layer model, folder-vs-package continuum, the DAG, barrels, feature-folder anatomy, and the "when multi-package (workspace)" note.references/right-sizing.md— the reject-over-engineering table, "abstract only what you can't test", and how architecture scales with app size.references/state-di-riverpod.md— provider graph, keepAlive vs autoDispose, placeholder-override composition root, isolate-safe factories,ProviderContainertests.
Run scripts/check_architecture.sh before opening a PR.