# Li Lance Android Seraphim Framework Flutter Feature Based Clean Architecture

> Feature-Based Clean Architecture

- Skill: `tomevault-io/li-lance-android-seraphim-framework-flutter-feature-based-cl` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/li-lance-android-seraphim-framework-flutter-feature-based-cl`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/li-lance-android-seraphim-framework-flutter-feature-based-cl/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/li-lance-android-seraphim-framework-flutter-feature-based-cl

---


# 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](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 rule** — `Presentation -> 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

See [implementation examples](references/implementation.md) for the full directory tree and
cross-feature import patterns.

## Reference & Examples

For feature folder blueprints and cross-layer dependency templates:
See [references/REFERENCE.md](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

---
> Source: [li-lance/android-seraphim-framework](https://github.com/li-lance/android-seraphim-framework) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-06-16 -->

