flutter-architecturelisted
Install: claude install-skill zakariaf/CatchLaw
# 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, `ProviderContainer` tests.
Run `scripts/check_architecture.sh` before opening a PR.
## Non-negotiable rules
1. **Answer "where does this belong?" in one second.** Group by **feature first, layer second**. No
giant app-wide `screens/`, `models/`, or `widgets/` bucket — those smear one feature across the
tree and force a name lookup on every edit.
2. **Two layers m