architecture-feature-first

Structures Flutter apps using layered architecture with feature-first folder organization.

1|Updated Aug 14, 2026
One-click install
npx skills add https://github.com/sohampawar1866/zeromile-go --skill architecture-feature-first-sohampawar1866
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: architecture-feature-first
Source: https://github.com/sohampawar1866/zeromile-go/tree/main/.agents/skills/architecture-feature-first
Command: npx skills add https://github.com/sohampawar1866/zeromile-go --skill architecture-feature-first-sohampawar1866

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Flutter projects often grow into tangled codebases where UI, business logic, and data access are mixed together, making features hard to find, test, and refactor. This Skill provides clear rules for organizing Flutter code into layers and features so responsibilities stay separated. ## Core Features & Use Cases - Layered Architecture Rules: Defines UI, Logic (Domain), and Data layers with strict communication rules, unidirectional data flow, and Repository as the single source of truth. - Feature-First Folder Structure: Groups all files of a feature (data, domain, ui) into one directory instead of organizing by type, with a complete sample layout. - State Management Agnostic: Applies equally to ViewModel, Cubit, Bloc, Controller, Provider, or Notifier patterns, including dependency injection wiring via constructors and a service locator. - Use Case: When adding a new profile feature to a Flutter app, follow the 7-step workflow to create the service, repository, view model, view, and DI registration in the correct layers. ## Quick Start Ask the AI to design the folder structure and layer responsibilities for a new Flutter feature such as authentication using feature-first architecture.

Frequently Asked Questions about architecture-feature-first

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

FAQPage Schema
How do I structure a Flutter app with feature-first architecture?

Create a features/ directory where each feature contains data/, ui/, and optionally domain/ subdirectories. Place repositories and services in data/, views and view models in ui/, and use cases in domain/ only when logic is complex.

What is the difference between a repository and a service in Flutter architecture?

A service wraps API endpoints and holds no state, while a repository is the single source of truth for a data type. Only the repository may mutate data, and it handles caching, error handling, and transforming raw service responses into domain models.

Does feature-first architecture work with BLoC or Riverpod?

Yes, the architecture is state management agnostic. The business logic holder can be a ViewModel, Cubit, Bloc, Controller, Provider, or Notifier, and the same layering and folder rules apply to all of them.

When should I add a domain layer in Flutter?

Add a domain layer with use cases only when business logic is too complex for the view model or is reused across multiple screens or repositories. Simple CRUD apps should skip the domain layer entirely.

Why should the UI layer never access a service directly?

Direct service access breaks unidirectional data flow and scatters data mutation across layers. Only adjacent layers may communicate, so the UI layer must go through the repository, which remains the single source of truth for data.