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:

  1. Search for Flow, StateFlow, SharedFlow, Channel, MutableStateFlow, MutableSharedFlow, LiveData, collect, collectAsState
  2. Identify which flow types are used and how they are collected
  3. If approach is sound: match it
  4. 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
  5. Beyond violations: also look for places where the operators and patterns in this skill could simplify existing code — manual Job? patterns that flatMapLatest could replace, flows collected inside transforms that combine could clean up, etc.

Step 2: Channel Audit

During the context check, also identify Channel usage:

Installs
19
GitHub Stars
76
First Seen
Apr 22, 2026
kotlin-flows — rcosteira79/android-skills