← ClaudeAtlas

java-coding-standardslisted

Java coding standards for Spring Boot services: naming, immutability, Optional usage, streams, exceptions, generics, and project layout.
jjackkun/claude-harness-hermes · ★ 1 · AI & Automation · score 77
Install: claude install-skill jjackkun/claude-harness-hermes
# Java Coding Standards Standards for readable, maintainable Java (17+) code in Spring Boot services. ## When to Activate - Writing or reviewing Java code in Spring Boot projects - Enforcing naming, immutability, or exception handling conventions - Working with records, sealed classes, or pattern matching (Java 17+) - Reviewing use of Optional, streams, or generics - Structuring packages and project layout ## Core Principles - Prefer clarity over cleverness - Immutable by default; minimize shared mutable state - Fail fast with meaningful exceptions - Consistent naming and package structure ## Naming ```java // PASS: Classes/Records: PascalCase public class MarketService {} public record Money(BigDecimal amount, Currency currency) {} // PASS: Methods/fields: camelCase private final MarketRepository marketRepository; public Market findBySlug(String slug) {} // PASS: Constants: UPPER_SNAKE_CASE private static final int MAX_PAGE_SIZE = 100; ``` ## Immutability ```java // PASS: Favor records and final fields public record MarketDto(Long id, String name, MarketStatus status) {} public class Market { private final Long id; private final String name; // getters only, no setters } ``` ## Optional Usage ```java // PASS: Return Optional from find* methods Optional<Market> market = marketRepository.findBySlug(slug); // PASS: Map/flatMap instead of get() return market .map(MarketResponse::from) .orElseThrow(() -> new EntityNotFoundException("Market not found")