What problem does it solve?
This skill addresses the complexity of managing side effects and state in Java applications by providing a structured approach to the Functional Core, Imperative Shell (FCIS) pattern. It eliminates scattered validation logic, hidden side effects, and difficult-to-test code by enforcing a clear separation between pure business logic and effectful I/O.
Core Features & Use Cases
- Architectural Guidance: Provides clear patterns for separating pure domain logic from side-effecting shell code using Higher-Kinded-J.
- Domain Modelling: Offers best practices for using Java 25 records, sealed interfaces, and pattern matching to create type-safe, immutable domain models.
- Deterministic Testing: Enables testing of time-sensitive and effectful logic without mocks by using TimeSource and Effect Handlers.
- Use Case: Refactor a legacy Spring Boot service that mixes database calls, validation, and business rules into a clean, testable pipeline where business rules are pure functions and I/O is pushed to the controller boundary.
Quick Start
Use the hkj-arch skill to analyze my current service architecture and suggest a migration plan to the functional core imperative shell pattern.