OverviewHistoryStatsSecurity
npx skills add ...
Documentation
SKILL.md
npx skills add chrisbanes/skills --skill kotlin-concurrency-and-flow
Use when writing or reviewing Kotlin coroutine scope ownership, raw Thread or Executor work, init launches, non-suspending launch APIs, runBlocking, cancellation, StateFlow, SharedFlow, Channel, stateIn, SharingStarted, state updates, or one-shot events.
npx skills add chrisbanes/skills --skill kotlin-concurrency-and-flow
Give asynchronous work an explicit owner and lifetime, then model durable state and transient events with primitives whose delivery and replay semantics match the product contract.
launch, callback, or deferred wrapper merely for convenience.Channel hands each event to one consumer; a configured
SharedFlow broadcasts to active consumers. If that consumer contract is
unknown, state both options and the decision needed before choosing one.
For a one-consumer navigation handoff that must survive a collector gap,
choose a buffered Channel exposed as receiveAsFlow(); do not preserve a
replay-zero SharedFlow after identifying event loss as the defect.| Signal | Read |
|---|---|
Stored CoroutineScope, raw Thread or Executor work, init { launch }, fire-and-forget API, runBlocking, broad catch, or cancellation boundary | Structured concurrency |
StateFlow, SharedFlow, Channel, stateIn, SharingStarted, .value, state updates, sentinel values, or one-shot events | Flow state and events |
| Compose collection or UI effect handling | Compose state and effects |