What problem does it solve?
Kotlin codebases often hide unstructured launches, stored CoroutineScopes, runBlocking calls, and misused SharedFlow or Channel primitives, making it impossible to tell who owns cancellation, replay, and failure behavior. This Skill provides a structured review procedure for assigning every piece of asynchronous work an explicit owner and lifetime.
Core Features & Use Cases
- Structured concurrency review: Detects stored or injected CoroutineScopes, raw Thread/Executor work, init-block launches, broad catches that swallow CancellationException, and misplaced runBlocking boundaries, then guides conversion to suspending APIs.
- Flow state and event modeling: Guides selection between StateFlow, SharedFlow, Channel, and cold Flow based on replay, fan-out, buffering, and synchronous .value requirements, including stateIn and SharingStarted configuration.
- Use Case: While reviewing a ViewModel that exposes navigation via a replay-zero SharedFlow, the Skill identifies event loss during collector gaps and recommends a buffered Channel exposed with receiveAsFlow() instead.
Quick Start
Review this Kotlin repository class for hidden coroutine scope ownership and check whether its SharedFlow events should be a Channel or StateFlow.