Search docs
Docs searchValidation rule
Back to Rule CatalogAP-APP-004Application LayeringPackage responsibility mismatch
Flags files whose responsibilities do not match the package or module they live in.
warningviolationNo auto-fix
How to fix
- Move the file to the package that owns the responsibility.
- Split shared helpers into a clearer lower-level package.
- Update imports and module contracts after the move.
What it means
A package appears to contain code for a different architectural responsibility.
Why it matters
Responsibility drift makes ownership unclear and causes modules to become accidental catch-alls.
Common causes
- Shared helpers were placed in the nearest package.
- A feature moved but supporting code stayed behind.
- The package boundary is too broad.
Example bad pattern
A payments package contains user-invitation email workflow code.Example good pattern
Invitation workflow code lives in the platform or identity package that owns it.Related files/config
apps/api/srcapps/webpackages
Related CLI commands
archpilot validatearchpilot validate --ci