java-readable-code
Installation
SKILL.md
Java Readable Code
Default Style
- Prefer small focused classes, explicit responsibilities, intention-revealing names, readable control flow, and minimal incidental complexity.
- Prefer GoF design patterns where they fit naturally.
- Avoid broad utility classes that mix unrelated concerns such as creation, mapping, conversion, logging, and key formatting; extract cohesive collaborators with narrow names instead.
- Avoid passing non-trivial method calls directly as arguments when an intermediate variable would clarify intent. Name semantically important intermediate results.
- Prefer simple, common words that non-native speakers can read without looking them up.
Guard Clauses
- Do not use
org.springframework.util.Assertin application, domain, or service code. - Prefer explicit guard clauses with normal
ifstatements and meaningful exceptions. - At API boundaries, prefer Bean Validation annotations where appropriate.
- Inside business logic, prefer explicit checks over assertion utilities.