What problem does it solve?
This skill eliminates the boilerplate and runtime risks associated with hand-written mappers, builders, and converters by generating type-safe, reflection-free, and law-checked code at compile time.
Core Features & Use Cases
- Compile-Time Mapping: Automatically generate mapping implementations between domain records and DTOs using simple spec interfaces.
- Validated Assembly: Construct complex records from independently validated parts while collecting every error instead of failing on the first one.
- Sparse Updates: Handle REST PATCH requests by folding present fields into domain objects while ignoring absent ones.
- Use Case: Replace reflective libraries like MapStruct or ModelMapper with a robust, type-safe system that ensures your domain model and wire DTOs remain perfectly synchronized.
Quick Start
Use the hkj-mapping skill to generate a mapping implementation for a domain record and its corresponding DTO by defining a spec interface that extends MappingSpec.