Search docs

Docs search

Dependency Rules & Module Contracts

ArchPilot validates cross-module dependencies, public entrypoints, module contracts, and architecture boundaries so dependency drift becomes visible early.

Why it matters

Use dependency rules and module contracts when you want architecture policy enforcement that is specific enough to catch boundary drift, but still practical enough for everyday engineering work.

What ArchPilot checks

  • Forbidden cross-module dependencies
  • Direct imports that bypass a module’s public entrypoint
  • Missing or unused declared dependencies
  • Circular dependencies that create architecture risk
  • Layer-direction violations where teams model layered architecture

Why module contracts matter

Module contracts make boundaries explicit. Instead of treating architecture as a convention that developers must memorize, ArchPilot gives teams a local source of truth for which modules can depend on which other modules.

That is especially useful for architecture as code, dependency validation, and architecture policy enforcement in larger repositories.

How teams usually adopt this

  1. Start with the repository’s natural module structure.
  2. Generate or refine module contracts so the intended boundaries are explicit.
  3. Run validation to see boundary violations and public entrypoint issues.
  4. Tighten rules gradually as the architecture model becomes more accurate.
Dependency Rules & Module Contracts | ArchPilot Docs