Przejdź do treści
Biblioteka skilli
Programowanie · Nauka i wyjaśnianie

ffca-architecture

/ffca-architecture

Wyjaśnia układ Feature-First Clean Architecture w monorepo Flutter: gdzie umieszczać kod, granice warstw, reguły zależności, nazewnictwo i organizację pakietów.

Licencja
MIT
Ostatnia zmiana repozytorium
22.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
1
Przestarzałość

Brak sygnałów. Repozytorium zmienione 22.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Wyjaśnia układ Feature-First Clean Architecture w monorepo Flutter: gdzie umieszczać kod, granice warstw, reguły zależności, nazewnictwo i organizację pakietów.

Wyzwalacze z opisu

where should this code livewhich package does this belong inis this dependency allowedcan presentation import data
Oryginalny opis (EN)

Feature-First Clean Architecture (FFCA) orientation for Flutter monorepos: where code lives, layer boundaries, dependency rules, naming, and package organization. Use when working in an FFCA monorepo, a features/ folder whose packages are named {feature}_domain, {feature}_data, and {feature}_presentation, or when the user asks about Feature-First Clean Architecture, monorepo structure, layer dependencies, or package organization. Triggers on "where should this code live", "which package does this belong in", "is this dependency allowed", "can presentation import data", "can domain depend on Fl

Jak działa

  1. Confirm you are in an FFCA repo
  2. Workflow: deciding where code lives
  3. Vocabulary: Command and Query, not use case
  4. Before you wire dependencies
  5. Deferred loading constrains the graph
  6. Anti-patterns to reject
  7. Where to go next
Sekcje z nagłówków SKILL.md, w oryginale · 57 linii, 769 słów
Podgląd SKILL.md
---
name: ffca-architecture
description: >
  Feature-First Clean Architecture (FFCA) orientation for Flutter monorepos: where code lives, layer
  boundaries, dependency rules, naming, and package organization. Use when working in an FFCA
  monorepo, a features/ folder whose packages are named {feature}_domain, {feature}_data, and
  {feature}_presentation, or when the user asks about Feature-First Clean Architecture, monorepo
  structure, layer dependencies, or package organization. Triggers on "where should this code live",
  "which package does this belong in", "is this dependency allowed", "can presentation import data",
  "can domain depend on Flutter", "what goes in {feature}_domain", "how should I name this package",
  and "explain the FFCA layers". If the repo instead uses packages/ with _repository and _api_client
  packages, defer to vgv-ai-flutter-plugin's layered-architecture skill.
allowed-tools: Read Glob Grep
effort: high
---

# FFCA Architecture

Orientation skill for Feature-First Clean Architecture (FFCA) monorepos. It tells you how to navigate the structure and which rules apply. It does not restate the conventions: those live in `${CLAUDE_PLUGIN_ROOT}/references/ffca/`. Every step below names the file and section to read.

## Confirm you are in an FFCA repo

The detection signal is a `features/` folder whose packages follow the `{feature}_domain`, `{feature}_data`, or `{feature}_presentation` naming. If the repo uses the standard VGV layered structure (`packages/` with `_repository`/`_api_client`), this is not an FFCA repo: defer to the layered-architecture skill instead.

## Workflow: deciding where code lives

1. Read `references/ffca/overview.md`, section *The structure*, to place the work in one of the three top-level folders: `apps/`, `features/`, `shared/`.
2. To decide between a feature and a shared package, apply the two-question decision rule in `references/ffca/overview.md`, section *Shared libraries* (a business capability an app composes goes to `features/`; something you could publish to pub.dev and a stranger would use unchanged goes to `shared/`). Use its component table to settle edge cases.
3. To decide which layers a feature needs, read `references/ffca/overview.md`, sections *Headless features* and *Presentation-only features*. A feature with no screens stays domain plus data and can grow a presentation package later with no structural change. A feature that only composes other features' domains into a screen has a presentation package and nothing else.
4. Before naming any package, read `references/ffca/project_structure.md`, section *Naming conventions*. The names are mechanically validated by the hook, so they are not optional.
5. To place a file inside a package, read `references/ffca/project_structure.md`, section *Layer subfolders*, for the per-layer folder map (`models/`, `repositories/`, `use_cases/`, `data_sources/`, `dtos/`, `mappers/`, and the per-screen `bloc/`, `views/`, module layout).

## Vocabulary: Command and Query, not use case

The classes in `use_cases/` are named **Command** (mutates, `execute`) and **Query** (reads, `get` or `watch`). Use those words when you talk about them and when you name them. The folder keeps the conventional `use_cases/` name so the layout matches other clean architecture projects, but the term "use case" is not used for the classes. Read `references/ffca/domain.md`, section *Business rules*.

## Before you wire dependencies

Read `references/ffca/project_structure.md`, section *Dependency rules*, before adding a dependency on another workspace package to a pubspec. That section's table is the whole policy, and it is what `scripts/validate_layers.dart` implements. The hook enforces it on every pubspec edit and blocks the edit on a violation, so confirm the direction first:

- apps depend on features and shared
- shared depends only on external packages
- the domain layer imports other domains and shared, nothing else
- the data layer imports its own domain, other domains, and shared
- the presentation layer imports domains and other presentation packages, never a data layer

Two absences carry as much weight as the rows: no presentation package depends on any `_data` package, its own included, and no shared package depends on a feature.

## Deferred loading constrains the graph

An app can load a feature on demand with a `deferred as` import, which is what splits web bundles and backs Android deferred components. This only works if the deferred package is not *also* reachable from the app through a non-deferred path. If `product_presentation` imports `cart_presentation` eagerly, deferring `cart` from the router achieves nothing.

The failure is silent: nothing breaks, no analyzer warning fires, and the bundle just stops splitting. Treat it as a rule, not a review note. Read `references/ffca/project_structure.md`, section *Deferred loading*. On an app shipping only to iOS and Android the AOT snapshot contains the whole program anyway, so this is informational there.

## Anti-patterns to reject

These are the violations the architecture exists to prevent. Read the cited sections for the rationale:

- Presentation importing a data layer. Depend on the domain and go through its repository interface. See `references/ffca/project_structure.md`, section *Dependency rules*.
- A shared package depending on a feature. See `references/ffca/overview.md`, section *Shared libraries*.
- Business logic living in `shared/`. Volatile, app-specific logic belongs in a feature domain. See the component table in the same section.
- A widget in `ui_kit` that needs a repository. It cannot compile there, because shared packages depend on external packages only. Split it: the presentational view goes to `ui_kit`, the stateful part stays in its feature. See `references/ffca/presentation.md`, section *Where the widget should live*.

## Where to go next

- Creating or extending a feature: use the `ffca-feature` skill.
- Routes, navigation, or deep links: use the `ffca-routing` skill.
- One feature needing another's data or widgets: use the `ffca-cross-feature` skill.
- Checking the whole repo's health: use the `ffca-audit` skill.

For a worked example of the whole structure, see the [mealify reference implementation](https://github.com/VGVentures/mealify_feature_first).

Wersje

W bazie nie ma innych skilli o nazwie ffca-architecture.

Migawka bazy z 13.11.2026 · wersja paczki ff4df1d20e79 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 1 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 90ffca-audit
    Audytuje monorepo FFCA pod kątem zgodności architektury: warstwy mechaniczne, nazewnictwo, cykle i ocena jakościowa pakietów.
  • 100ffca-feature
    Tworzy i rozbudowuje funkcje FFCA w trzech pakietach domain, data i presentation: modele, repozytoria, komendy i zapytania, DTO, mappery, Cubity i moduły.
  • 100flutter-feature-scaffold
    Dodaje nowe funkcje do aplikacji Flutter w układzie feature-first Clean Architecture (data, domain, presentation) z Riverpod 3 bez generowania kodu, z układem folderów, regułami warstw i skryptem szkieletu.
  • 95vertical-slices
    Organizuje kod według funkcji i pakietów w monorepo, wskazując, gdzie ma trafić nowy plik.
  • 100flutter-architecture
    Dobiera, przegląda i rozwija granice aplikacji Flutter, kierunek zależności i organizację funkcji, przy nowej strukturze projektu, problemach ze skalowaniem i migracjach architektury.
  • 100flutter-architecture
    Projektuje, refaktoryzuje i recenzuje architekturę aplikacji Flutter: MVVM, warstwy UI, dane i opcjonalna domena, struktura feature-first, repozytoria, wstrzykiwanie zależności, wzorce Result i Command oraz offline-first.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.