Teaches AI agents to write idiomatic Kotlin (data classes, val, scope fns, Kotest) AND to make the right stack choices on JVM: Kotlin 2.3 + JDK 21 + Gradle Kotlin DSL, Ktor for HTTP, kotlinx-coroutines, DJL for ML inference, JavaCV for vision, Koog for AI agent orchestration.
95
95%
Does it follow best practices?
Impact
95%
1.23xAverage score across 10 eval scenarios
Passed
No known issues
Process steps in order. Do not skip ahead.
src/main if the user said "everywhere")java.util.Optional, Optional<T> return types, Optional.of, Optional.empty, Optional.ofNullable, .orElse, .orElseGet, .orElseThrow, .ifPresent, .map, .flatMap (on Optional)A site is a SAFE conversion target if:
If a site is exposed to Java code and you can't verify the consumer is OK with T?, leave it and report it. Don't break Java callers silently.
Changing a public return type (Optional<T> → T?) is a binary- and source-breaking change, and public declarations should carry explicit return types — the public-API exception called out in the nullable-question-mark rule. On a stable public API, route the change through a deprecation cycle (@Deprecated + ReplaceWith) instead of an in-place swap (the kotlin-api-review skill covers the full checklist); on internal code, convert freely.
For each safe conversion target:
Optional<T> return type → T? return typeOptional.of(x) → x (drop the wrapper)Optional.empty() → nullOptional.ofNullable(x) → x (already nullable)opt.orElse(default) → value ?: defaultopt.orElseGet { default() } → value ?: default()opt.orElseThrow { e } → value ?: throw eopt.ifPresent { x -> … } → value?.let { … }opt.map { x -> f(x) } → value?.let { f(it) } or value?.let(::f)opt.flatMap { x -> g(x) } → value?.let(::g) (when g returns nullable)import java.util.Optional and any related imports.orElse(x) on what is now T?, or destructuring expected Optional shapeFinish here. Do not commit — that's the operator's call.