implement-domain

Implement immutable Flutter domain entities and repository interfaces with Future<Result<T>>.

Updated Apr 1, 2026
One-click install
npx skills add https://github.com/andrelucassvt/CleanMacForDevsWeb --skill implement-domain
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: implement-domain
Source: https://github.com/andrelucassvt/CleanMacForDevsWeb/tree/main/.agents/skills/implement-domain
Command: npx skills add https://github.com/andrelucassvt/CleanMacForDevsWeb --skill implement-domain

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The Flutter domain layer (Entities and Repository Interfaces) provides a structured approach to model business concepts, enforce immutability, and define contracts between layers, enabling scalable, testable Flutter apps.

Core Features & Use Cases

  • Immutable Entities with copyWith, equality, and hashCode.
  • Repository Interfaces using Future<Result<T>> with Entities (not Models) and no infra dependencies.
  • Clear domain structure under lib/domain/entities and lib/domain/interfaces for team consistency.
  • Use Case: define a new domain concept, model domain objects, and specify repository contracts.

Quick Start

Create the basic Flutter domain layer by adding immutable Entities under lib/domain/entities and Repository Interfaces under lib/domain/interfaces.

Frequently Asked Questions about implement-domain

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

FAQPage Schema
How do I structure a Flutter domain layer using Clean Architecture?▼

To structure a Flutter domain layer using Clean Architecture, define immutable Entities under lib/domain/entities and Repository Interfaces under lib/domain/interfaces to establish clear contracts between layers.

What is the best way to implement immutable entities in Flutter?▼

The best way to implement immutable entities in Flutter is by using the @immutable annotation alongside the copyWith method, while also overriding equality and hashCode for reliable state management.

How should I define repository interfaces in Flutter Clean Architecture?▼

Define repository interfaces in Flutter Clean Architecture by returning Future<Result<T>> with Entities rather than Models, ensuring the domain layer has no infrastructure dependencies.

When do I need a separate domain layer in my Flutter app?▼

You need a separate domain layer in your Flutter app when modeling a new business concept or defining a contract between layers, which provides a structured approach for scalable and testable applications.

What anti-patterns should I avoid when modeling Flutter domain objects?▼

When modeling Flutter domain objects, avoid anti-patterns like introducing infrastructure dependencies in repository interfaces or failing to use immutable Entities with copyWith, equality, and hashCode.

Does the Flutter domain layer require infrastructure dependencies for repository interfaces?▼

No, the Flutter domain layer requires zero infrastructure dependencies for repository interfaces, strictly utilizing Future<Result<T>> with Entities to maintain clean separation of concerns.