> flutter-feature-based-clean-architecture

Organize Flutter apps with modular feature-based clean architecture. Use when creating or modifying any file under lib/features/ including domain entities, repositories, data sources, or screens. (triggers: lib/features/**, feature, domain, infrastructure, application, presentation)

fetch
$curl "https://skillshub.wtf/HoangNguyen0403/agent-skills-standard/flutter-feature-based-clean-architecture?format=md"
SKILL.mdflutter-feature-based-clean-architecture

Feature-Based Clean Architecture

Priority: P0 (CRITICAL)

Modular Clean Architecture organized by business features in lib/features/.

Structure

Every feature lives in lib/features/ with 3-layer separation (domain/data/presentation):

  • domain/ — Entities, failures, and Repository interfaces.
  • data/ — DTOs, DataSource, and Repository implementations.
  • presentation/ — BLoC/Cubit, pages, and widgets.

See references/folder-structure.md for the complete directory blueprint.

Implementation Workflow

  1. Create feature directory — Add a new folder under lib/features/ (e.g., lib/features/promotions/).
  2. Define domain layer — Add entities, failures, and repository interfaces with zero external dependencies.
  3. Implement data layer — Add DTOs, data sources, and repository implementations that depend only on Domain.
  4. Build presentation layer — Add BLoC/Cubit, pages, and widgets that depend only on Domain.
  5. Enforce dependency rulePresentation -> Domain <- Data. Domain must have zero external dependencies.
  6. Share cross-cutting logic — Move reusable utilities to lib/shared/ or lib/core/.

Feature Directory Example

lib/features/orders/
├── domain/
│   ├── entities/order.dart
│   ├── failures/order_failure.dart
│   └── repositories/i_order_repository.dart
├── data/
│   ├── models/order_dto.dart
│   ├── data_sources/order_remote_data_source.dart
│   └── repositories/order_repository_impl.dart
└── presentation/
    ├── bloc/order_bloc.dart
    └── pages/order_list_page.dart

Cross-Feature Import Rule

See implementation examples for correct vs incorrect cross-feature import patterns.

Reference & Examples

For feature folder blueprints and cross-layer dependency templates: See references/REFERENCE.md.

Anti-Patterns

  • import '…/features/orders/data/models/order_dto.dart' from another feature — only import Domain types across features
  • lib/features/orders/domain/widgets/ — never put UI or Data classes inside Domain
  • lib/features/orders/sub_orders/ — keep lib/features/ flat; no nested feature directories
  • ❌ Calling another feature's repository directly from Presentation — route through that feature's BLoC or use-case

Related Topics

layer-based-clean-architecture | retrofit-networking | go-router-navigation | bloc-state-management | dependency-injection

> related_skills --same-repo

> common-store-changelog

Generate user-facing release notes for the Apple App Store and Google Play Store by collecting git history, triaging user-impacting changes, and drafting store-compliant changelogs. Enforces character limits (App Store ≤4000, Google Play ≤500), tone, and bullet format. Use when generating release notes, app store changelog, play store release, what's new, or version release notes for any mobile app. (triggers: generate changelog, app store notes, play store release, what's new, release notes, ve

> golang-tooling

Go developer toolchain — gopls LSP diagnostics, linting, formatting, and vet. Use when setting up Go tooling, running linters, or integrating gopls with Claude Code. (triggers: gopls, golangci-lint, golangci.yml, go vet, goimports, staticcheck, go tooling, go lint)

> common-ui-design

Design distinctive, production-grade frontend UI with bold aesthetic choices. Use when building web components, pages, interfaces, dashboards, or applications in any framework (React, Next.js, Angular, Vue, HTML/CSS). (triggers: build a page, create a component, design a dashboard, landing page, UI for, build a layout, make it look good, improve the design, build UI, create interface, design screen)

> common-owasp

OWASP Top 10 audit checklist for Web Applications (2021) and APIs (2023). Load during any security review, PR review, or codebase audit touching web, mobile backend, or API code. (triggers: security review, OWASP, broken access control, IDOR, BOLA, injection, broken auth, API review, authorization, access control)

┌ stats

installs/wk0
░░░░░░░░░░
github stars452
██████████
first seenMar 17, 2026
└────────────

┌ repo

HoangNguyen0403/agent-skills-standard
by HoangNguyen0403
└────────────

┌ tags

└────────────