clean-architecture-flutter

Define and enforce MVVM-like Flutter feature architecture with presentation, domain, and data layers.

1|Updated Apr 24, 2026
One-click install
npx skills add https://github.com/dimitriRemoiville/cc-mobile --skill clean-architecture-flutter
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-architecture-flutter
Source: https://github.com/dimitriRemoiville/cc-mobile/tree/main/plugins/cc-mobile-flutter/skills/clean-architecture-flutter
Command: npx skills add https://github.com/dimitriRemoiville/cc-mobile --skill clean-architecture-flutter

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Flutter apps often struggle with inconsistent architecture as projects scale; this Skill defines a three-layer structure (presentation, domain, data) and strict rules to keep concerns separated, improving maintainability and testability.

Core Features & Use Cases

  • Three-layer architecture: presentation → domain → data with clear directional dependencies.
  • Layer rules: presentation imports domain; data imports domain; domain remains pure Dart/logic.
  • Guided feature layout: per-feature folders with di, data, domain, and presentation modules; ensures consistent code organization across features.
  • Use case guidance: when to introduce a use case, and how to structure repository interfaces and implementations.
  • Mapper and repository contracts: demonstrates mapping DTOs to domain models and API/DAO integration.

Quick Start

Create a new feature folder with di/module, data/domain/presentation layers, and a sample use case to bootstrap development.

Frequently Asked Questions about clean-architecture-flutter

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a Flutter app with clean architecture and MVVM?

Structure a Flutter app with clean architecture by dividing features into presentation, domain, and data layers. This enforces strict directional dependencies, keeping domain logic pure Dart while presentation and data layers handle UI and repository contracts.

When should I introduce use cases and repositories in Flutter?

Introduce use cases and repositories in Flutter when you need to separate business logic from data fetching. Define repository interfaces in the domain layer and implement them in the data layer to maintain clear boundaries and improve testability.

How do I map DTOs to domain models in Flutter clean architecture?

Map DTOs to domain models in Flutter clean architecture using dedicated mappers within the data layer. This ensures API or DAO integration data is converted into pure domain models before crossing the boundary into the domain layer.

Does Flutter clean architecture require domain layers to remain pure Dart?

Flutter clean architecture requires the domain layer to remain pure Dart. By keeping the domain layer free from presentation and data dependencies, you ensure that business logic stays testable and independent of Flutter UI or external data sources.

What is the best way to organize Flutter feature folders for scalable architecture?

Organize Flutter feature folders by creating subdirectories for di, data, domain, and presentation modules. This guided feature layout ensures consistent code organization across your project, separating dependency injection, data sources, business logic, and UI.

Why does my Flutter app architecture break down as the project scales?

Flutter app architecture breaks down as projects scale due to inconsistent layer separation. Applying a strict three-layer structure with clear rules for where code belongs prevents tangled dependencies and improves long-term maintainability.