java-best-practices
Installation
SKILL.md
Java Best Practices
Type-First Development
Types define the contract before implementation. Follow this workflow:
- Define data models - records, sealed classes, and interfaces first
- Define method signatures - parameter types, return types, and exceptions
- Implement to satisfy types - let the compiler guide completeness
- Validate at boundaries - runtime checks where data enters the system
Make Illegal States Unrepresentable
Use Java's type system to prevent invalid states at compile time.
Records for immutable data: