madteacher/mad-agents-skills
Overview
This skill provides a practical, opinionated guide for architecting Flutter applications using the MVVM pattern, layered architecture, and a feature-first project organization. It focuses on scalability, team workflows, and maintainable code structure so you can build apps that are easy to extend and test. Use it to establish consistent boundaries between UI, Domain, and Data layers and to adopt recommended design patterns for robust apps.
How this skill works
The skill inspects your app-level needs (team size, feature count, complexity) and recommends either a feature-first or layer-first layout. It defines responsibilities for Views, ViewModels, Repositories, Services, and optional Domain use-cases, and shows how to expose state, handle errors, and implement unidirectional data flow. It also codifies practical patterns like Command, Result types, Repository abstraction, and offline-first strategies.
When to use it
- Designing or refactoring a Flutter app architecture
- Choosing between feature-first and layer-first project organization
- Implementing MVVM with clear UI→logic separation
- Scaling an app for multiple developers or teams
- Adding new features while minimizing merge conflicts
- Applying tested design patterns for error handling and offline support
Best practices
- Prefer feature-first organization for medium/large apps and teams to keep features self-contained
- Keep Views thin: move logic into ViewModels and expose state via streams or change notifiers
- Make Repositories the single source of truth and aggregate Services for caching and retries
- Use a Result type and Command pattern to encapsulate actions and errors consistently
- Adopt unidirectional data flow: data → logic → UI for predictable state management
- Introduce a Domain layer with use-cases when business logic grows complex
Example use cases
- New team project with 10+ features: start feature-first to enable parallel work
- Refactor a monolithic app: migrate modules into feature folders with clear data/domain/presentation boundaries
- Implement offline-first behavior: repository handles cache, sync, and optimistic UI updates
- Replace widget-heavy controllers: move UI logic into ViewModels and expose testable state
- Add third-party APIs: wrap each API in a Service and expose through repositories
FAQ
Choose layer-first for small apps or solo projects with fewer than ~10 features where simpler navigation by type improves developer speed.
How do I test ViewModels and Repositories?
Unit-test ViewModels by mocking repositories and asserting exposed state changes. Test repositories by mocking Services and verifying caching, error handling, and retry logic.
10 skills
This skill guides structuring Flutter apps with MVVM, feature-first organization, and clean layers to improve scalability, maintainability, and team
This skill helps Flutter developers implement localization with gen-l10n and intl, enabling multilingual UI, locale-aware formatting, and custom language
This skill helps you build adaptive Flutter UIs that gracefully respond to screen size and platform, enhancing usability across mobile, tablet, and desktop.
This skill helps you implement Flutter animations effectively by choosing implicit, explicit, hero, staggered, and physics-based approaches for smooth UX.
This skill helps you integrate Duit into Flutter apps by wiring drivers, transports, and backend-driven UI with reusable components.
This skill guides Dart Drift usage for local SQLite and PostgreSQL with type-safe queries, migrations, and reactive streams.
This skill helps you implement Flutter navigation and routing with Navigator and go_router, enabling deep linking, data passing, and web history.
This skill guides you to implement a resilient local SQLite store in Flutter with drift, enabling type-safe queries, reactive streams, and smooth migrations.
This skill provides comprehensive Flutter networking guidance for HTTP CRUD, WebSocket, authenticated requests, error handling, and performance optimization.
This skill provides comprehensive Flutter testing guidance across unit, widget, and integration tests to improve reliability and coverage.