kotlin-flows
Installation
SKILL.md
Kotlin Flows
Overview
Kotlin Flow is a cold, sequential stream built on coroutines. StateFlow and SharedFlow are hot variants for state and events. Choosing the right type, collecting safely, and never exposing mutable types are the core concerns here.
Step 1: Project Context Check
Before writing or modifying any flow code:
- Search for
Flow,StateFlow,SharedFlow,Channel,MutableStateFlow,MutableSharedFlow,LiveData,collect,collectAsState - Identify which flow types are used and how they are collected
- If approach is sound: match it
- If approach violates rules below: explain why to the user, recommend the correct approach, and let them decide — do NOT produce code that follows the bad pattern
- Beyond violations: also look for places where the operators and patterns in this skill could simplify existing code — manual
Job?patterns thatflatMapLatestcould replace, flows collected inside transforms thatcombinecould clean up, etc.
Step 2: Channel Audit
During the context check, also identify Channel usage: