kotlin-idiomatic-refactorer-spring-aware

Refactor Kotlin code to idiomatic patterns while preserving Spring, JPA, and Jackson compatibility.

4|Updated Jun 10, 2026
One-click install
npx skills add https://github.com/mymx2/foreman --skill kotlin-idiomatic-refactorer-spring-aware-mymx2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-idiomatic-refactorer-spring-aware
Source: https://github.com/mymx2/foreman/tree/main/.qoder/skills.collected/skills/kotlin-idiomatic-refactorer-spring-aware
Command: npx skills add https://github.com/mymx2/foreman --skill kotlin-idiomatic-refactorer-spring-aware-mymx2

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the challenge of modernizing Java-flavored Kotlin codebases without inadvertently breaking critical framework-level behaviors like dependency injection, persistence, or serialization.

Core Features & Use Cases

  • Safe Refactoring: Provides a structured approach to applying idiomatic Kotlin patterns (like sealed classes or constructor injection) while respecting Spring proxy and JPA constraints.
  • Framework Awareness: Ensures that refactors do not disrupt Jackson serialization, configuration binding, or transactional boundaries.
  • Use Case: Use this when you need to clean up legacy Kotlin services or DTOs to be more expressive and concise, while ensuring the application remains fully compatible with existing Spring Boot infrastructure and tests.

Quick Start

Use the kotlin-idiomatic-refactorer-spring-aware skill to refactor the selected service class into more idiomatic Kotlin while preserving its Spring bean lifecycle and persistence behavior.

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 bean lifecycle and persistence behavior?

You can modernize Kotlin code without breaking Spring by applying idiomatic patterns like sealed classes or constructor injection while strictly respecting Spring proxy behavior and JPA constraints. This preserves transactional boundaries and Jackson serialization compatibility throughout the refactoring process.

Why does refactoring Kotlin data classes break Jackson serialization in Spring Boot?

Refactoring Kotlin data classes breaks Jackson serialization when changes disrupt proxy behavior or configuration binding. To prevent this, ensure refactors maintain strict compatibility with Jackson serialization boundaries and preserve existing public API contracts during domain model transformations.

Can I use sealed classes and constructor injection when modernizing legacy Kotlin Spring services?

Yes, you can apply sealed classes and constructor injection to legacy Kotlin Spring services. This structured refactoring approach ensures idiomatic modernization while maintaining strict compatibility with Spring Framework, JPA, and Jackson serialization without disrupting existing infrastructure or tests.

What is the best way to clean up legacy Kotlin DTOs for Spring Boot without causing test failures?

The best way to clean up legacy Kotlin DTOs is applying idiomatic transformations while preserving Jackson serialization compatibility and existing public API contracts. This ensures the application remains fully compatible with existing Spring Boot infrastructure and tests without causing regressions.

When should I not use idiomatic Kotlin patterns like sealed classes in Spring JPA domain models?

Avoid using idiomatic Kotlin patterns like sealed classes in Spring JPA domain models when transformations disrupt JPA proxy behavior or persistence boundaries. Refactoring must preserve strict compatibility with JPA constraints and transactional boundaries to prevent breaking framework-level persistence behaviors.

Does refactoring Kotlin configuration classes affect Spring Framework dependency injection?

Refactoring Kotlin configuration classes can affect Spring Framework dependency injection if transformations disrupt bean boundaries. Safe refactoring prevents this by preserving proxy behavior, bean boundaries, and existing public API contracts throughout the configuration class modernization process.