Skip to content

Dependency Rules

These rules are the architectural contract for the workspace.

graph LR
App["rim-app"] --> Application["rim-application"]
App --> Infra["rim-infra-*"]
App --> Ports["rim-ports"]
App --> Domain["rim-domain"]
Application --> Domain
Application --> Ports
Infra --> Application
Infra --> Domain
Infra --> Ports
  • rim-domain -> rim-application
  • rim-domain -> rim-infra-*
  • rim-domain -> rim-app
  • rim-ports -> rim-domain or any other workspace crate

If a crate closer to the center needs something from an outer layer, introduce or refine a port instead of adding a direct dependency.

When reviewing a dependency change, ask:

  1. Does this point inward toward more stable policy?
  2. Does this move workbench state into the domain?

If the answer to the second question is yes, the change is wrong.