/major-ai-skills:kotlinfrom major-ai-skills
Write Kotlin with null-safe types, coroutines, flows, and data classes; integrate with Java and Android APIs.
Ships in major-ai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Kotlin targets JVM/Android (and multiplatform) with null-safety in the type system, concise data modeling (data class), and structured concurrency via coroutines. Agents prefer immutable data by default, use suspend functions instead of callback pyramids, cancel coroutines with scopes, and treat Java interop platform types as nullable until proven otherwise.
Caller scope (viewModelScope / runBlocking tests)
|
suspend functions
|
Dispatchers (Main/IO/Default)
|
Flow / Channel streams
val and immutable collections unless mutation is required.GlobalScope in apps.withContext(Dispatchers.IO) for blocking I/O; keep CPU work on Default.sealed class / sealed interface.!! except as a last resort with a clear invariant comment.data class Item(val id: String, val sku: String, val qty: Int)
sealed interface ItemsState {
data object Loading : ItemsState
data class Ready(val items: List<Item>) : ItemsState
data class Error(val message: String) : ItemsState
}
suspend fun loadItems(repo: ItemRepository): ItemsState =
try {
ItemsState.Ready(repo.fetchItems())
} catch (e: Exception) {
ItemsState.Error(e.message ?: "unknown error")
}
./gradlew test
kotlinc hello.kt -include-runtime -d hello.jar
# Android:
./gradlew :app:assembleDebug
| Pitfall | Why it hurts | Fix |
|---|---|---|
GlobalScope.launch | Leaks / lost cancel | Scoped coroutines |
| Blocking Main thread | ANRs / jank | IO dispatcher |
| Ignoring Java platform types | NPEs | Explicit null checks |
Huge data class copies | Hidden cost | Smaller models |
Result or sealed errors for expected failures; reserve exceptions for exceptional cases.Flow for cold streams; collect with lifecycle awareness on Android.-Xcontext-receivers only if team adopts them).explicit API mode).runTest and virtual time awareness.@android-studio - IDE and Gradle Android workflows@spring-boot - Kotlin on the server@swift - peer mobile language on iOSWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub alivirgo/major-ai-skills --plugin major-ai-skills412 skills in this plugin
/3d-slicerAutomate 3D Slicer research workflows with MRML, VTK/ITK, DICOM data, and Segment Editor. Use for software workflows, not clinical interpretation./abbreviated-git-statusInspect Git branch, staging, and working-tree changes with short or porcelain status output when a compact repository check is needed./ableton-liveAutomate Ableton Live sessions with Python MIDI Remote Scripts, Max for Live, AbletonOSC, and Link synchronization./act-as-a-personal-tutorExplain a subject step by step, assess prior knowledge, and use short exercises to check understanding before advancing.Other plugins' skills for the same job