flutter-project-structure

Organizes Flutter projects with feature-first layout and MVVM layer boundaries.

Updated Jun 13, 2026
One-click install
npx skills add https://github.com/22Teikk/22Teikk-Agent-Skills-Hub --skill flutter-project-structure-22teikk
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: flutter-project-structure
Source: https://github.com/22Teikk/22Teikk-Agent-Skills-Hub/tree/main/packs/flutter/skills/flutter-project-structure
Command: npx skills add https://github.com/22Teikk/22Teikk-Agent-Skills-Hub --skill flutter-project-structure-22teikk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Flutter projects often drift into scattered global folders like lib/screens, lib/models, and lib/services, making features hard to locate, layer boundaries unenforced, and testing difficult. This Skill provides the 2026-standard feature-first layout with the official MVVM UI/Data layer split so every feature is self-contained and boundaries are mechanically enforced. ## Core Features & Use Cases - Canonical project scaffolding: Defines the five-zone layout (main.dart, lib/app, lib/core, lib/shared, lib/features) with presentation/domain/data sub-layers inside every feature. - Boundary enforcement: Specifies import rules (presentation → domain → data) enforced via lints so violations fail flutter analyze, plus red flags and rationalization rebuttals for common structural mistakes. - Use Case: When creating a new Flutter app or reorganizing an existing one, apply this layout to decide where each file belongs, keep domain logic pure Dart and testable, and determine whether a melos monorepo is actually justified. ## Quick Start Ask the agent to scaffold a new Flutter project using the feature-first MVVM structure with auth and tasks features.

Frequently Asked Questions about flutter-project-structure

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

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

Organize code into lib/app (composition root), lib/core (infrastructure), lib/shared (generic widgets), and lib/features where each feature contains data, domain, and presentation subfolders. Name features by capability like auth or tasks, not by screen.

What is the difference between feature-first and layer-first Flutter architecture?▼

Layer-first uses global folders like lib/screens and lib/models, scattering one feature across many directories. Feature-first places the MVVM layers inside each feature folder, so all code for one capability lives in a single place and scales past five features.

When should a Flutter widget go in lib/shared instead of a feature folder?▼

Promote a widget to lib/shared only when two or more unrelated features use it and it is stateless or parameter-driven. Widgets that read feature providers or hold business logic must stay inside their owning feature.

Does this Flutter structure work with both BLoC and Riverpod?▼

Yes, the layout is state-agnostic. The folder tree, layer boundaries, and dependency rules are identical for both; only the state holder files inside presentation change shape between Bloc/Cubit classes and Riverpod providers.

When should I use melos or a monorepo for a Flutter app?▼

Use melos or Dart pub workspaces only when two or more apps share code, internal packages evolve alongside consumers, or five or more developers need independent package boundaries. A single app should stay single-package.

How do I enforce layer boundaries in a Flutter project?▼

Enforce boundaries with lints such as custom_lint or very_good_analysis so cross-layer imports fail flutter analyze. Domain must never import Flutter or data implementations, and features must never import each other directly.