Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
fullstack ruleP1universalStack: universal
architectureclean-architecturelayeringseparation-of-concerns
Respect architecture layer boundaries — don't reach across them
Keep data-layer types out of the domain layer and application-level decisions out of pure business use-cases; each layer depends only inward, through its defined interfaces.
PR: profico-mining-2026-06Created: Jul 26, 2026
Bad example
Old codekotlin
| 1 | // domain use-case importing DataStore (a data-layer detail) |
| 2 | class GetX(val store: DataStore) { ... } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codekotlin
| 1 | // domain depends on a repository interface; DataStore stays in the data layer |
| 2 | class GetX(val repo: SessionRepository) { ... } |
Explanation (EN)
Objašnjenje (HR)