← ClaudeAtlas

java-clean-codelisted

Complete Clean Code reference for Java 21+ in one skill — naming, methods, comments, general quality, and tests, with modern idioms (records, sealed types, pattern matching, Optional, streams). Use when writing, reviewing, or refactoring any Java code and you want the whole catalog at once rather than one focused area.
CasLubbers/code-design-skills · ★ 1 · Code & Development · score 62
Install: claude install-skill CasLubbers/code-design-skills
# Clean Java: complete reference The full catalog. For depth on one area use the focused skills: `java-clean-names`, `java-clean-functions`, `java-clean-comments`, `java-clean-general`, `java-clean-tests`, `java-boy-scout`. ## Names - **N1** Names reveal intent. If it needs a comment, rename it. - **N2** Name at the caller's level of abstraction — `ordersByCustomer()`, not `getOrderHashMap()`. - **N3** Use standard nomenclature: domain terms, pattern names, `find`/`create`/`delete` consistently. - **N4** Unambiguous. `rename(source, target)` beats `rename(a, b)`. - **N5** Length matches scope. `var` shifts the weight onto the name. - **N6** No encodings: no `strName`, no `m_count`, no `IUserRepository`, no `UserServiceImpl`. - **N7** The name describes every side effect. A getter that loads is `getOrLoad`. - **N8** No noise words: `Manager`, `Helper`, `Data`, `Info`, `Util` distinguish nothing. - **N9** Conventions: `PascalCase` noun types, `camelCase` verb methods, `UPPER_SNAKE` constants, predicate booleans (`isActive`, `hasExpired`). Record-style accessors (`order.total()`) over `getTotal()` in new domain types. ## Methods - **F1** One thing, one level of abstraction. - **F2** Small. If you cannot name it precisely, it does more than one thing. - **F3** Three parameters maximum. Group the rest into a record. - **F4** No boolean flag arguments — split the method, or pass an enum. - **F5** Guard clauses over nesting. Return early. - **F6** Never return null. `Optional<T