Search docs

Docs search
Back to Rule Catalog
AP-DEP-010Dependency

Dependency violates architecture layer direction

Flags dependencies that point against the configured architecture layer direction.

errorviolationNo auto-fix

How to fix

  1. Move shared code to an allowed lower-level module.
  2. Reverse the dependency through an interface or event.
  3. Update layer configuration only if the architecture decision changed.

What it means

A module imports or declares a dependency from a layer it is not allowed to depend on.

Why it matters

Layer direction rules prevent lower-level code from becoming coupled to higher-level workflows.

Common causes

  • A utility was placed in an application layer.
  • Domain or platform code imports a feature module.
  • Layer configuration does not match the intended module graph.

Example bad pattern

platform imports repositories because a helper lives there.

Example good pattern

repositories imports platform, or the helper is moved into platform.

Related files/config

  • .archpilot/dependency-rules.json
  • .archpilot/architecture.json
  • .archpilot/contracts/*.json

Related CLI commands

  • archpilot validate
  • archpilot validate --ci
AP-DEP-010 - Dependency violates architecture layer direction | ArchPilot Docs