kotlin-idiomatic-refactorer-spring-aware

Refactor Kotlin code to idiomatic patterns while preserving Spring proxy and Jackson behavior.

302|22|Updated Feb 12, 2026
One-click install
npx skills add https://github.com/JetBrains/skills --skill kotlin-idiomatic-refactorer-spring-aware-jetbrains
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-idiomatic-refactorer-spring-aware
Source: https://github.com/JetBrains/skills/tree/main/kotlin-idiomatic-refactorer-spring-aware
Command: npx skills add https://github.com/JetBrains/skills --skill kotlin-idiomatic-refactorer-spring-aware-jetbrains

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

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.

Core Features & Use Cases

  • Prefer constructor injection and immutable dependencies.
  • Replace imperative branching with when for exhaustive reasoning and better readability.
  • Use sealed classes or sealed interfaces for closed result domains; prefer data classes for transport or value models, not for JPA entities.
  • Ensure null-safety by avoiding !! where possible; consider value classes and explicit validation.
  • Safely preserve Spring proxies, Jackson serialization, and configuration binding during refactors.

Quick Start

Apply a minimal, Spring-safe Kotlin refactor to convert mutable dependencies to constructor-injected, immutable ones and verify compatibility with proxies, Jackson, and JPA.

Frequently Asked Questions about kotlin-idiomatic-refactorer-spring-aware

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor Kotlin code to be more idiomatic without breaking Spring proxies?

Refactor Kotlin toward immutable constructor injection and exhaustive when expressions while preserving Spring proxy compatibility. This Skill guides safe incremental patches that maintain proxy behavior during Java-flavored Kotlin cleanup.

Can I use data classes for JPA entities when refactoring to idiomatic Kotlin?

No, prefer data classes for transport or value models rather than JPA entities. Use sealed classes or sealed interfaces for closed result domains to keep domain modeling expressive while maintaining persistence compatibility.

What is the best way to eliminate !! in Kotlin Spring applications?

Ensure null-safety by avoiding !! where possible and considering value classes with explicit validation. This Skill replaces forced null assertions with safer idiomatic patterns while maintaining configuration binding and Jackson serialization.

Does refactoring Kotlin branching to when expressions affect Jackson serialization?

Replacing imperative branching with when expressions does not break Jackson serialization. This Skill ensures compatibility with Jackson serialization and configuration binding while applying exhaustive reasoning for better readability.

When should I not use idiomatic Kotlin refactoring in a Spring codebase?

Avoid idiomatic refactoring when it compromises Spring proxy behavior, JPA persistence, or public contracts. Use this Skill to apply a verification strategy that identifies limitations and ensures refactors remain safe for existing tests.