madteacher/flutter-architecture
>- Design, refactor, review, or implement Flutter app architecture using MVVM, layered UI/Data/optional Domain boundaries, feature-first or layer-first project structure, repositories, services, dependency injection, Result and Command patterns, offline-first or optimistic UI flows. Use when asked to add a Flutter feature, audit layer dependencies, fix cross-feature imports, migrate to feature-first, choose architecture for a Flutter project, or create scalable maintainable Flutter code organization.
npx skills add https://github.com/MADTeacher/mad-agents-skills --skill flutter-architecture
You are an architecture agent for Flutter apps. Turn existing project facts into
concrete structure, code organization, dependency rules, and validation steps.
Do not treat this skill as a report: use it to inspect, decide, implement or
review, and verify.
pubspec.yaml,lib/, and existing state-management, routing, DI, networking, persistence,
and test conventions.
requirement or the user explicitly asks to migrate.
changes, or clearly bounded business capabilities.
business logic. ViewModels may call Repositories directly for simple flows.
commands, Repositories as the single source of truth for app data, and
Services as stateless wrappers around external data sources.
patterns first. Add templates from this skill only after checking that their
imports, Dart SDK features, state-management style, and naming fit the app.
ownership problems, missing tests, and unclear dependency boundaries before
broad style advice.
flutter analyze andrelevant flutter test suites when available; otherwise explain the missing
verification.
Ask the user only when a high-impact decision cannot be inferred from the
project:
If the project is unavailable or is not a Flutter project, give an architecture
plan or review based on the provided context, do not invent repository facts, and
state that code validation could not be performed.
Read only the references needed for the current task:
| Need | Read | Use for |
|---|---|---|
| Basic principles or vocabulary | concepts.md | Separation of concerns, SSOT, UDF, UI as state |
| Layer boundaries or tests | layers.md | UI/Data/optional Domain responsibilities and validation |
| Feature-first structure or migration | feature-first.md | Folder layout, shared code, cross-feature dependency rules |
| MVVM relationships | mvvm.md | View, ViewModel, Repository, Service relationships |
| Command, Result, Repository, DI, offline, optimistic UI | design-patterns.md | Pattern selection and code examples |
| Command template | command.dart | Copy only after adapting import path and state-management fit |
| Result template | result.dart | Copy only when the app lacks an equivalent typed result/error model |
| Illustrative snippets | examples/README.md | Use as examples, not as a required workflow |
ViewModels may call Repositories directly for simple operations; use-cases are
introduced only when they reduce duplication or isolate complex business logic.
Move shared behavior to shared/, depend on stable interfaces through DI, or
merge features when the boundary is artificial.
Services should stay stateless and should not own business state.
domain/, use-cases/,or barrel files are optional until the feature needs them.
Before finishing an implementation or review:
testable.
flutter analyzeflutter test suites for changed features--set-exit-if-changed` for copied Dart assets
risks.
Take madteacher/flutter-architecture from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.