Install
openclaw skills install kotlinBuild robust Android and multiplatform apps with Kotlin idioms, coroutines, and null safety.
openclaw skills install kotlin| Topic | File |
|---|---|
| Null safety operators and patterns | nullsafety.md |
| Coroutines, flows, structured concurrency | coroutines.md |
| Collections, sequences, data classes | collections.md |
| Scope functions, extensions, sealed classes | idioms.md |
| Java interop and common Kotlin mistakes | interop.md |
| Android lifecycle, Compose state | android.md |
| Delegation, inline, reified, multiplatform | advanced.md |
!! asserts non-null — crashes on null, use only when you've already checked@Nullable/@NonNull annotationsreturn/throw for early exit — val name = user?.name ?: returnviewModelScope auto-cancels on ViewModel clear — don't use GlobalScope in AndroidsupervisorScope to isolateStateFlow needs initial value and never completes — SharedFlow for one-shot eventsDispatchers.IOfirst() throws on empty — use firstOrNull() for safe accessequals/hashCode — body properties ignoredmutableStateListOf for Compose — wrapping mutableListOf in state won't track changesrepeatOnLifecycle(STARTED) for flow collection — launchWhenStarted is deprecatedremember survives recomposition only — use rememberSaveable for config changescollectAsStateWithLifecycle is the gold standard — lifecycle-aware + Compose state== is structural equality in Kotlin — === for reference, opposite of Javafun interface@JvmStatic, @JvmOverloads, @JvmField for Java-friendly APIs