Refactor Kotlin code toward clearer, more idiomatic design without breaking Spring behavior, serialization, persistence, or public contracts. Use when Java-flavored Kotlin needs cleanup, domain modeling should become more expressive, or boilerplate should be reduced, but the refactoring must remain safe for proxies, Jackson, JPA, configuration binding, and existing tests.
74
92%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No known issues
Source mapping: Tier 2 high-value skill derived from Kotlin_Spring_Developer_Pipeline.md (SK-20).
Improve the codebase's Kotlin quality without trading away framework correctness. Prefer refactorings that increase clarity and reduce accidental complexity while preserving behavior.
when when it improves exhaustive reasoning.sealed class or sealed interface for closed result or error domains.data class for pure transport or value models, not for JPA entities.!!.Sequence and lazy pipelines are not automatically faster, especially around JPA or repeated iteration.null, absent, and default were distinct before.copy() on data classes is convenient but can weaken domain invariants when state transitions should stay explicit.when over sealed hierarchies improves safety, but only if the hierarchy is truly closed in the relevant module boundary.Return these sections:
Refactoring intent: what quality problem is being solved.Safe transformations: the concrete Kotlin improvements that are appropriate here.Framework constraints: the Spring, Jackson, JPA, or config rules that limit the refactor.Minimal patch plan: incremental changes in a safe order.Verification: which tests or runtime checks protect behavior.A good run of this skill leaves the code more Kotlin-native and still boringly reliable in Spring. A bad run produces elegant Kotlin that is harder to debug, harder to evolve, or incompatible with framework behavior.
e0f258b
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.