kotlin — skill for Claude Code: types, coroutines, Android APIs
A skill for Kotlin and Android API work: it pushes typed state modeling, explicit async boundaries, and keeps blocking calls out of properties. Useful when you touch .kt files or a Nitro Module wrapper.
npx skills add margelo/react-native-skills --skill kotlin -a claude-codeWhat kotlin does
The workflow starts with reading the existing Kotlin code, the generated abstract classes, and the shape of the public API before any edit. Valid states get modeled with types first, behavior second. State variants belong in sealed interfaces or separate classes, not in one data class padded with nullable fields, and related values stay non-null on the variant where they apply.
Async gets its own section. Coroutines fit naturally suspending APIs and Android I/O; quick local work stays synchronous. runBlocking is off limits in library code, getters, and JS-facing entry points. When a value arrives from a specific Android callback, the skill points to a listener, a Flow, or an event API. Repeated dispatcher hops read as an architecture smell, so the fix is owning the lifecycle or scope rather than patching races with delay or Thread.sleep.
Style rules cover final classes by default, data class for plain values, require and check instead of silent failures, careful Java interop, and sparing use of !!. For Nitro Modules the skill suggests pairing with build-nitro-modules, which handles generated specs, Promise mapping, annotations, and HybridObject constraints.
What it helps with
- split state variants into sealed interfaces instead of nullable fields
- move a blocking call out of a getter into an async method
- decide where a coroutine earns its keep and where plain sync code wins
- cut dispatcher hops that bounce work through the main thread
- convert Java platform types before they reach the public API
Example prompts for the agent
- Read
Scanner.ktand reworkScannedDatainto a sealed interface so each variant carries only its own fields - The session status getter uses
runBlocking— turn it into an async method - Check
HybridScanner.ktfor properties that hide Android service calls or I/O
How to install kotlin
1Skills CLI (Vercel)
npx skills add margelo/react-native-skills --skill kotlin -a claude-code2Manually: put the files in place
~/.claude/skills/kotlin/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/kotlin/
1Skills CLI (Vercel)
npx skills add margelo/react-native-skills --skill kotlin -a codex2Manually: put the files in place
.agents/skills/kotlin/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add margelo/react-native-skills --skill kotlin -a cursor2Manually: put the files in place
.cursor/skills/kotlin/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install margelo/react-native-skills kotlin2Manually: put the files in place
.github/skills/kotlin/SKILL.md1Skills CLI (Vercel)
npx skills add margelo/react-native-skills --skill kotlin -a gemini-cli2Platform CLI
gemini skills install https://github.com/margelo/react-native-skills --path skills/kotlinManually: put the files in place
.devin/skills/kotlin/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add margelo/react-native-skills --skill kotlin -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about kotlin
How do I install the kotlin skill in Claude Code?
Run npx skills add margelo/react-native-skills --skill kotlin -a claude-code. The skill file lands at ~/.claude/skills/kotlin/SKILL.md.
What does the kotlin skill do?
It guides design, implementation, and review of Kotlin and Android APIs: typed state, clear sync versus async boundaries, Java interop, and Nitro Module implementations.
Does the kotlin skill work together with anything else on Nitro Modules?
Yes. The skill recommends pairing it with build-nitro-modules, which covers generated specs, Promise mapping, annotations, and HybridObject constraints.