Search docs

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

Forbidden cross-module dependency detected

Flags dependencies blocked by dependency rule configuration.

errorviolationNo auto-fix

How to fix

  1. Remove or reroute the forbidden dependency.
  2. Use an allowed public module boundary.
  3. Only update the rule if the architecture decision changed and is documented.

What it means

A module depends on another module that dependency rules explicitly forbid.

Why it matters

Forbidden dependencies encode architectural decisions that should fail fast when bypassed.

Common causes

  • A new import violates dependency policy.
  • The rule config is stricter than the current implementation.
  • A module boundary changed without updating policy.

Example bad pattern

A domain module imports a UI module despite a forbidden dependency rule.

Example good pattern

The domain module exposes behavior through an allowed lower-level boundary.

Related files/config

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

Related CLI commands

  • archpilot validate
  • archpilot validate --ci
AP-DEP-002 - Forbidden cross-module dependency detected | ArchPilot Docs