← ClaudeAtlas

flutter-architecturelisted

Enforces a right-sized feature-first layered MVVM Flutter architecture — features are folders and cross-cutting foundations become packages only when a compile wall earns it, a strict downward-only dependency DAG, dumb Views over one Notifier/AsyncNotifier ViewModel per feature, repositories as the single source of truth and single write path returning immutable domain values, abstractions only where something genuinely can't run in a test, and Riverpod 3.x as the one context-free DI+state mechanism (no get_it/injectable/package:provider container). Use when creating a Flutter feature or file, deciding folder-vs-package or where a class belongs, naming a Screen/Notifier/Repository/Service, wiring providers or a composition-root/bootstrap.dart, adding a use-case/domain layer, resisting over-engineering on a small app, or reviewing whether a change respects the layer boundaries.
zakariaf/CatchLaw · ★ 0 · AI & Automation · score 58
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