Search docs

Docs search
Back to Rule Catalog
AP-DOM-003Domain Model Quality

Oversized aggregate/service boundary

Flags domain or service boundaries that appear too broad for one aggregate responsibility.

warningviolationNo auto-fix

How to fix

  1. Identify cohesive responsibility groups.
  2. Extract separate aggregates or services for unrelated behavior.
  3. Keep coordination in application services, not oversized domain objects.

What it means

One boundary owns many unrelated concepts or workflows.

Why it matters

Oversized boundaries hide model shape and make changes risky across unrelated behavior.

Common causes

  • A central service became the default place for new workflows.
  • Multiple aggregates are managed as one object.
  • Ownership boundaries were not revisited as the product grew.

Example bad pattern

WorkspaceService owns billing, invitations, repository upload, and policy exceptions.

Example good pattern

Separate services or aggregates own each bounded responsibility with a coordinator where needed.

Related files/config

  • apps/api/src/modules
  • packages

Related CLI commands

  • archpilot validate
  • archpilot validate --ci
AP-DOM-003 - Oversized aggregate/service boundary | ArchPilot Docs