Teaches AI agents to write idiomatic Kotlin instead of Java-in-a-.kt-file.
98
98%
Does it follow best practices?
Impact
99%
1.20xAverage score across 8 eval scenarios
Passed
No known issues
.let / .also / .apply / .run / .withvalue?.let { … } runs the block only when present, scoped to the value as itbuilder.apply { setX(…); setY(…) } configures and returns the builder; no intermediate variableresult.also { log.info("got $it") } runs a side effect without breaking the chainwith(receiver) { … } and run { … } are situational; reach for let / apply / also firstif (x != null) x.foo() else null becomes x?.let { it.foo() } — but at that point just write x?.foo()?.let { … } pattern shines when the block is more than one call: x?.let { transform(it); return persist(it) }chain.also { sideEffect(it) }.next().let { it.let { … } }) are a smell — extract the inner block to a named functionit is the default name for the scope receiver; when nesting or when the scope is non-trivial, rename to a descriptive parameter