
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.
- Installs
- 1.7K
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/madteacher/mad-agents-skills --skill flutter-architecture- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads flutter-architecture automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
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.
Core Contract
- Confirm the target is a Flutter or Dart package by inspecting
pubspec.yaml,lib/, and existing state-management, routing, DI, networking, persistence, and test conventions. - Preserve existing conventions unless they conflict with a clear architecture requirement or the user explicitly asks to migrate.
- Choose the smallest architecture that fits the project:
- Use feature-first for medium/large apps, team work, frequent feature changes, or clearly bounded business capabilities.
- Use layer-first for small apps, solo work, or simple CRUD flows.
- Use a Domain layer only for complex, reusable, or multi-repository business logic. ViewModels may call Repositories directly for simple flows.
- Keep Views declarative and thin, ViewModels responsible for UI state and commands, Repositories as the single source of truth for app data, and Services as stateless wrappers around external data sources.
- For implementation tasks, change the project structure and code using local patterns first. Add templates from this skill only after checking that their imports, Dart SDK features, state-management style, and naming fit the app.
- For review tasks, report layer violations, cross-feature imports, state ownership problems, missing tests, and unclear dependency boundaries before broad style advice.
- Validate with the repo's normal commands. Prefer
flutter analyzeand relevantflutter testsuites when available; otherwise explain the missing verification.
Clarification Rules
Ask the user only when a high-impact decision cannot be inferred from the project:
- product boundary of a new feature;
- expected scale of team or app when structure choice is ambiguous;
- offline-first, sync, or conflict-resolution requirements;
- whether a migration should be incremental or all-at-once.
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.
Resource Routing
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 |
Architecture Defaults
- Canonical dependency rule: lower layers must not depend on upper layers. ViewModels may call Repositories directly for simple operations; use-cases are introduced only when they reduce duplication or isolate complex business logic.
- Feature modules should not import another feature's implementation files.
Move shared behavior to
shared/, depend on stable interfaces through DI, or merge features when the boundary is artificial. - Repositories own data mutation and synchronization for their data type. Services should stay stateless and should not own business state.
- Do not add folders just to satisfy a diagram. Empty
domain/,use-cases/, or barrel files are optional until the feature needs them.
Validation
Before finishing an implementation or review:
- Check that new imports respect the chosen feature/layer boundary.
- Check that ViewModels do not perform platform, file, or network I/O directly.
- Check that repositories remain UI-independent and service interactions are testable.
- Run the closest available validation:
flutter analyze- focused
flutter testsuites for changed features - template-only validation with
dart format --output=none --set-exit-if-changedfor copied Dart assets
- Report commands run, failures, skipped checks, and residual architecture risks.
FAQ
What does the flutter-architecture skill do?
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.
How do I install flutter-architecture?
Run npx skills add https://github.com/madteacher/mad-agents-skills --skill flutter-architecture in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/flutter-architecture/ (personal) or .claude/skills/flutter-architecture/ (project).
Which AI agents can use flutter-architecture?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is flutter-architecture safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains flutter-architecture?
It is published by madteacher in madteacher/mad-agents-skills. It has 1,717 recorded installs.
More from madteacher/mad-agents-skills
flutter-animations
madteacher/mad-agents-skills
Add, fix, refactor, debug, test, or explain Flutter animations and motion effects. Use when working with implicit animations such as AnimatedContainer, AnimatedOpacity, AnimatedSwitcher, and TweenAnimationBuilder; explicit animations using AnimationController, Tween, CurvedAnimation, AnimatedWidget, AnimatedBuilder, and built-in transitions; Hero/shared-element route transitions; staggered or sequenced animations; physics-based motion, gestures, springs, flings, scroll physics, curves, performance, accessibility, reduced motion, and animation lifecycle bugs.
flutter-adaptive-ui
madteacher/mad-agents-skills
Build, fix, review, and validate adaptive or responsive Flutter UIs for mobile, tablet, desktop, web, large screens, foldables, and mixed input devices. Use when creating breakpoint-driven layouts, responsive navigation, adaptive dialogs/lists/grids, keyboard/mouse/touch behavior, window-size decisions with MediaQuery or LayoutBuilder, or Capability and Policy patterns for platform-specific behavior.
flutter-testing
madteacher/mad-agents-skills
Write, fix, review, debug, and validate Flutter tests for apps, packages, and plugins. Use when adding unit tests, widget tests, integration tests, MethodChannel or plugin mocks, Mockito or mocktail test doubles, golden or accessibility checks, CI test commands, test failures, MissingPluginException, pump or pumpAndSettle problems, finder errors, buildrunner mock generation, device integration testing, web integration testing, or flaky Flutter tests.
flutter-networking
madteacher/mad-agents-skills
Implement, fix, debug, review, or refactor Flutter networking code for HTTP/REST APIs, WebSocket realtime flows, authentication and token refresh, request headers, timeouts, retries, JSON parsing, caching, background isolates, repositories, services, and adaptation to existing http, Dio, Retrofit, Chopper, or custom API clients. Use when asked to add network requests, investigate network errors, harden API clients, handle auth, or validate Flutter network behavior.
flutter-drift
madteacher/mad-agents-skills
Implement, fix, review, migrate, test, or debug Drift persistence in Flutter apps using SQLite, driftflutter, type-safe Dart queries, generated tables, StreamBuilder or Riverpod StreamProvider UI, write operations, transactions, schema migrations, web assets, isolate sharing, and local database testing. Use when a Flutter task mentions drift, local database storage, SQLite, reactive database streams, CRUD, schemaVersion, buildrunner, driftdev make-migrations, migration tests, or Flutter-specific database setup across mobile, web, or desktop.
flutter-navigation
madteacher/mad-agents-skills
Implement, fix, refactor, review, migrate, or validate Flutter navigation and routing. Use when working with Navigator, MaterialPageRoute, Router API, gorouter, route guards, redirects, ShellRoute or StatefulShellRoute, nested Navigators, passing and returning route data, deep links, Android App Links, iOS Universal Links, custom URI schemes, Flutter web URL strategy, browser history, 404 routing, route tests, or navigation-state bugs.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.