Skip to content

feat: check that feature packages belong to their feature #24

Open

Description

@Statyk7

Description

Today the validator only checks that a package's name matches its feature folder. The reference implies stronger rules about how a feature's packages fit together, and all of them can be checked from the pubspec graph the validator already builds, with no new dependencies.

Requirements

  • Error: {f}_data (and {f}_data_{backend}) must depend on {f}_domain. The data layer exists to implement its own domain's interfaces (Dependency rules in project_structure.md).
  • Error: a features/{f}/ folder with a _data package but no _domain package matches no feature archetype (overview.md, headless and presentation-only features).
  • Warning: {f}_presentation does not depend on {f}_domain even though {f}_domain exists. A presentation-only feature has no domain, so this only applies when one exists. Depends on feat: add severity levels and suppressions to the layer validator #21; until then, leave this check out. Moved to feat: add severity levels and suppressions to the layer validator #21: implemented in feat(validator): add severity levels and suppressions #30 as presentation-missing-own-domain.
  • Error: {f}_domain declares the Flutter SDK (flutter: sdk: flutter). The domain layer is pure Dart (domain.md).
  • Each rule has a fixture in scripts/test/fixtures/invalid_workspace/ and a test case, and valid_workspace still passes.
  • The Hooks section of README.md lists the new checks.
  • All CI/CD checks are passing.
  • There is no drop in the test coverage percentage.

Additional Context

Some of these checks are already done by the ffca-layer-auditor agent with an LLM. Moving them into the validator makes them deterministic and lets the hook catch them as soon as a pubspec is edited.

Activity

  1. self-assigned this
    on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

featureA new feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions