breach-encapsulation-naming
Installation
SKILL.md
Breach Encapsulation Naming
Make unavoidable state exposure loud. Domain objects should express behavior first; when an accessor is required for persistence, serialization, debugging, or tests, name it as an explicit encapsulation breach.
Workflow
-
Classify every requested accessor by consumer: domain behavior, persistence, serialization, tests, framework glue, or presentation.
-
Replace domain-behavior access with Tell Don't Ask methods on the object that owns the data.
-
For unavoidable exposure, use
breachEncapsulationOfX()or the idiomatic local equivalent such asbreach_encapsulation_of_x. -
Keep exposed values immutable or defensively copied.
-
Add a review note explaining why the breach is tolerated and which callers may use it.
Review Checks
- Ordinary getters on entities and aggregates need justification.