Search docs

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

Circular module dependency detected

Flags direct circular dependencies between modules.

errorviolationNo auto-fix

How to fix

  1. Move shared behavior into a lower-level module.
  2. Introduce a public interface or event boundary.
  3. Remove one dependency edge and rerun validation.

What it means

Two or more modules depend on each other in a direct cycle.

Why it matters

Cycles make ownership unclear and increase the cost of changing either module.

Common causes

  • Shared behavior lives in one of the feature modules.
  • Two modules call each other directly.
  • A quick import was added to avoid defining a public boundary.

Example bad pattern

billing imports invoices while invoices imports billing.

Example good pattern

billing and invoices depend on a shared platform abstraction without importing each other.

Related files/config

  • .archpilot/architecture.json
  • .archpilot/contracts/*.json

Related CLI commands

  • archpilot validate
  • archpilot validate --ci
AP-DEP-001 - Circular module dependency detected | ArchPilot Docs