kotlin

Installation
SKILL.md

Kotlin

Use this skill for Kotlin code that needs strong type modeling, explicit async boundaries, and idiomatic Android integration. When the code is part of a Nitro Module, pair this with build-nitro-modules for generated specs, Promise mapping, annotations, and HybridObject constraints.

Workflow

  1. Read the local Kotlin code, generated abstract classes, and public API shape before editing.
  2. Model valid states with Kotlin types before implementing behavior.
  3. Choose whether work is synchronous, coroutine-based, or explicitly dispatched.
  4. Keep properties cheap and nonblocking.
  5. Make thread hops, Android service access, I/O, and fallible work visible in the API.

Type-Safe API Design

  • Represent state variants with sealed interfaces/classes, normal interfaces, or concrete classes. Do not encode variants as one data class with many nullable fields.
  • Keep related values non-null on the variant where they are valid. If barcode and barcodeType must exist together, put them on ScannedBarcode.
  • Use nullable types for real absence inside one state, not for "maybe this object is a different kind of thing".
  • Prefer compile-time narrowing over caller-side null probing. Repeated null checks for related fields usually mean the model is too loose.
Installs
121
GitHub Stars
133
First Seen
Jun 3, 2026
kotlin — margelo/react-native-skills