Kotlin
Writes, debugs, and reviews Kotlin: coroutines and flows, null safety, collections, Java interop, and Compose state. Use when an NPE hits a non-null type…
от clawic★ 23 звезды на GitHub
Установить Kotlin в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
User preferences and memory live in ~/Clawic/data/kotlin/ (see setup.md on first use, memory-template.md for the file format). If you have data at an old location (~/kotlin/ or ~/clawic/kotlin/), move it to ~/Clawic/data/kotlin/, and say in one line that you moved it and from where.
Configuration
User-dependent variables. Defaults apply until the user states a preference; store them in ~/Clawic/data/kotlin/config.yaml.
| Variable | Type | Default | Effect |
|---|---|---|---|
| target_platform | auto | android | server | multiplatform | library | auto | Picks the default deep-dive file and the idiom set; auto infers from build files (AGP plugin → android, Ktor/Spring dependency → server, kotlin("multiplatform") → multiplatform) |
| kotlin_floor | text (e.g. "2.0", "1.9") | 2.0 | Gates every version-dependent recommendation in build.md; below 2.0 the K2-only and Compose-compiler-plugin advice is suppressed |
| ui_toolkit | compose | views | none | compose | Switches Android examples between compose.md state handling and View/ViewBinding lifecycle patterns in android.md |
| serialization_lib | kotlinx | moshi | gson | jackson | kotlinx | Selects the annotation set, config defaults, and null-safety warnings in serialization.md |
| annotation_processor | ksp | kapt | none | ksp | Drives library setup snippets and the build-speed advice in build.md |
| explicit_api | bool | false | When true, emitted library code carries explicit visibility and public return types, matching explicitApi() strictness |
Preference areas to record as the user reveals them:
- tooling — DI (Hilt, Koin, manual), networking client (Retrofit, Ktor client), persistence (Room, SQLDelight, Exposed, JPA), test stack (JUnit4/5, MockK, flow-testing library, Kotest) — affects which examples and setup snippets are offered
- conventions — package layout (feature vs layer), formatter/linter (ktlint, ktfmt, detekt), trailing commas, explicit types on public API, naming of sealed state hierarchies — affects generated code and review verdicts
- platform — JVM toolchain version, Android min SDK, KMP target list, whether Java sources coexist in the module — affects which floors and interop rules apply
- safety posture — tolerance for
!!, experimental/opt-in APIs, warning suppression,allWarningsAsErrors— affects how hard to push back in review - legacy bridges — RxJava, LiveData, callback APIs still in the codebase — affects whether answers stay pure-coroutine or include adapters
- output format — KDoc density, tests emitted alongside code, snippet vs full file — affects the shape of every deliverable
When To Use
- Writing or reviewing Kotlin for correctness: nullability, coroutines, collections, sealed hierarchies, equality
- Debugging Kotlin runtime surprises: NPE on a non-null type, coroutine that never finishes or never cancels, flow that stops emitting, recomposition storm, test that hangs
- Java interop and Java→Kotlin migration, including making Kotlin APIs pleasant to call from Java
- Build and compiler problems that are Kotlin's, not Gradle's: kapt/KSP, JVM-target mismatch, opt-in, K2 migration
- Sharing code across Android, iOS, JVM, or web with Kotlin Multiplatform, or writing server-side Kotlin
- Not for Java-only codebases (→
java), Android release configuration, signing and distribution (→android), or IDE workflow (→android-studio)
Quick Reference
| Situation | Go to |
|---|---|
NPE on a non-null type, platform type from Java, lateinit not initialized, smart cast refused |
null-safety.md |
Coroutine leaks, never cancels, blocks the main thread, wrong dispatcher, runBlocking in production |
coroutines.md |
StateFlow stops emitting, SharedFlow drops events, stateIn/shareIn choice, backpressure, cold vs hot |
flows.md |
Exception vanishes, async failure surfaces late, runCatching breaks cancellation, error type design |
errors.md |
| Wrong list/map/sequence choice, O(n²) lookup, mutation leaking through a read-only type | collections.md |
Scope functions, sealed hierarchies, delegation, destructuring, use, DSL builders |
idioms.md |
Variance/out/in compile error, type erasure, reified, inline/crossinline, contracts |
generics.md |
Calling Kotlin from Java, @Jvm* annotations, SAM, checked exceptions, converting a Java file |
interop.md |
| Lifecycle, ViewModel, SavedStateHandle, process death, leaked Context, flow collection on Android | android.md |
Recomposition storms, remember vs rememberSaveable, stability, side effects, lazy lists |
compose.md |
| Coroutine test hangs, passes alone but fails in a suite, virtual time, flow assertions, mocking final classes | testing.md |
| Allocation in a hot path, boxing, sequences vs lists, inlining cost, value classes, benchmarking | performance.md |
| kapt vs KSP, JVM-target mismatch, opt-in/experimental, K2, slow incremental builds, librar |
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- _meta.json
- android.md
- build.md
- collections.md
- compose.md
- coroutines.md
- errors.md
- flows.md
- generics.md
- idioms.md
- interop.md
- memory-template.md
- multiplatform.md
- null-safety.md
- performance.md
- serialization.md
- server.md
- setup.md
- testing.md
FAQ
Что делает скилл Kotlin?
Writes, debugs, and reviews Kotlin: coroutines and flows, null safety, collections, Java interop, and Compose state. Use when an NPE hits a non-null type, `!!` or a Java platform type blows up, a coroutine leaks, never cancels, or swallows exceptions, a StateFlow stops emitting or a SharedFlow drops events, a Compose screen recomposes too much or loses state on rotation, `equals`/`copy`/`==` behave unexpectedly, a `when` stops being exhaustive, kapt/KSP or JVM-target errors break the Gradle build, JSON puts null into a non-null property, a coroutine test hangs or passes only in isolation; also when porting Java to Kotlin, sharing code across Android/iOS/JVM, tuning allocation and inlining, or writing server-side Kotlin with Spring or Ktor. Not for Java-only codebases or Android release/build-system configuration.
Как установить скилл Kotlin?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Kotlin запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
internal-comms
AnthropicA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
skill-development
AnthropicThis skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…