kotlin-tooling-java-to-kotlin

Converts Java source files to idiomatic Kotlin with framework-aware annotation and API preservation.

1|Updated Jul 6, 2026
One-click install
npx skills add https://github.com/citytexi/team-yg-pesonal-agent --skill kotlin-tooling-java-to-kotlin-citytexi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: kotlin-tooling-java-to-kotlin
Source: https://github.com/citytexi/team-yg-pesonal-agent/tree/main/.claude/skills/kotlin-tooling-java-to-kotlin
Command: npx skills add https://github.com/citytexi/team-yg-pesonal-agent --skill kotlin-tooling-java-to-kotlin-citytexi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve? Migrating Java codebases to Kotlin by hand is error-prone: annotation site targets get lost, nullability semantics change silently, framework proxies break on final classes, and git history is destroyed by naive file replacement. This Skill applies a disciplined 4-step conversion methodology with 5 invariants checked at each step, so converted Kotlin preserves behavior, annotations, imports, and documentation. ## Core Features & Use Cases - 4-Step Conversion Methodology: Faithful 1:1 translation, nullability/mutability audit, collection type conversion, and idiomatic transformations, with 5 invariants verified after each step. - Framework-Aware Conversion: Detects imports and loads targeted guides for Spring, Lombok, Hibernate/JPA, Jackson, Micronaut, Quarkus, Dagger/Hilt, RxJava, JUnit, Guice, Retrofit, and Mockito. - Git History Preservation: Uses a two-phase git mv rename plus content-replace commit strategy so git blame survives the migration. - Use Case: Converting a Spring Boot service layer from Java to Kotlin — the Skill detects Spring imports, keeps @Transactional classes open, removes @Autowired in favor of constructor injection, and verifies the result against a post-conversion checklist. ## Quick Start Ask the agent to convert a specific Java file or package to Kotlin, for example: convert src/main/java/com/acme/service/OrderService.java to idiomatic Kotlin and preserve git history.

Frequently Asked Questions about kotlin-tooling-java-to-kotlin

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

FAQPage Schema
How do I convert Java files to idiomatic Kotlin?▼

Apply a 4-step process: faithful 1:1 translation, nullability and mutability audit, collection type conversion, then idiomatic transformations like properties and string templates. Check five invariants after each step, including annotation site targets and import preservation.

How do I convert Lombok annotations when migrating to Kotlin?▼

Remove all Lombok annotations and replace them with Kotlin equivalents: @Data becomes a data class, @Builder becomes default parameter values, and @Slf4j becomes a companion object logger. Never use data class for JPA entities, since it breaks Hibernate proxies.

Does Java to Kotlin conversion preserve git blame history?▼

Yes, if you use a two-phase approach: first git mv the .java file to .kt and commit the rename, then write the converted Kotlin content and commit separately. Deleting and recreating the file loses rename tracking and blame history.

Why do Spring or Hibernate classes break after Kotlin conversion?▼

Kotlin classes are final by default, but Spring and Hibernate create proxies via subclassing. Mark @Transactional classes, @Bean methods, and JPA entities as open, or apply the allopen compiler plugin with the Spring or JPA preset.

Should I convert Mockito tests to MockK when migrating to Kotlin?▼

Convert to MockK when the project already uses it or is doing a full Kotlin migration, mapping when/thenReturn to every/returns and ArgumentCaptor to slot. If keeping Mockito, use the mockito-kotlin library's whenever() to avoid backtick-escaping the when keyword.

How are RxJava types converted to Kotlin coroutines?▼

Observable and Flowable map to Flow, Single to a suspend function returning T, Maybe to a suspend function returning T?, and Completable to a suspend function returning Unit. subscribeOn becomes flowOn, and CompositeDisposable is replaced by a CoroutineScope with structured concurrency.