What problem does it solve?
This Skill reduces Kotlin code quality issues by guiding you toward idiomatic patterns that improve null safety, immutability, and maintainability while encouraging correct coroutine and DSL usage.
Core Features & Use Cases
- Null safety and correct failure handling: Use Kotlin’s type system, safe calls, Elvis operator, and guardrails like require/check to prevent NPEs and unclear validation logic.
- Maintainable modeling with data/value/sealed types: Prefer data classes, @JvmInline value classes for type-safe identifiers, and sealed classes/interfaces for exhaustive results and API error modeling.
- Concurrency and code organization: Apply structured concurrency with coroutines/Flow (including cancellation and cleanup patterns) and use extension functions and type-safe DSL builders for cleaner APIs.
- Gradle Kotlin DSL quality: Adopt idiomatic Gradle Kotlin DSL configuration patterns and integrate tooling conventions for consistent builds.
Use Case: You’re building a Kotlin service layer where user IDs, emails, and domain results must be safe and predictable; adopt sealed result types, value-class identifiers, and structured coroutines to keep the code readable and robust during asynchronous operations.
Quick Start
Use the kotlin-patterns skill to review or refactor your Kotlin codebase for idiomatic null safety, immutability, sealed modeling, structured coroutines, and type-safe DSL builders.