Kotlin Flow

Expert guidance on Kotlin Flow — cold vs hot flows, StateFlow / SharedFlow, common operators, combining, back-pressure, and testing with Turbine. Use this for any reactive data stream work.

9 stars 1 forksMobile Development

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add PanPanFR/oh-my-openkilo --skill kotlin-flow
Manual install
git clone --depth 1 https://github.com/PanPanFR/oh-my-openkilo.git /tmp/oh-my-openkilo
mkdir -p ~/.claude/skills
cp -r /tmp/oh-my-openkilo/archive/skills/android/kotlin-flow ~/.claude/skills/kotlin-flow

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Kotlin Flow — Cold, Hot, and Everything In Between

## Instructions

### 1. Cold vs Hot

- **Cold** (`Flow<T>`): each collector restarts the upstream. Built with `flow { emit(...) }`, `flowOf`, `asFlow()`, Retrofit's `Flow<T>` responses.
- **Hot** (`StateFlow<T>`, `SharedFlow<T>`): one producer, many collectors, emissions exist independently of collection.

Rule of thumb: use **cold flows** for queries (Room, network) and **hot flows** for shared mutable state (UI state, app events).

### 2. `StateFlow` — Single-Value State

```kotlin
private val _state = MutableStateFlow(UiState.Empty)
val state: StateFlow<UiState> = _state.asStateFlow()

fun onRefresh() {
    _state.update { it.copy(isLoading = true) }
}
```

Properties:
- Conflated: only the latest value is kept.
- Always has a value (`initialValue` required).
- `.value` is safe to read synchronously.
- Equal values are not re-emitted (`equals` check).

### 3. `SharedFlow` — Multi-Value Events

```kotlin
private val _events = MutableSharedFlow<AppEvent>(
    replay = 0,
    extraBufferCapacity = 16,
    onBufferOverflow = BufferOverflow.DROP_OLDEST,
)
val events: SharedFlow<AppEvent> = _events.asSharedFlow()

fun notify(e: AppEvent) { _events.tryEmit(e) }
```

Choose `SharedFlow` for events that should be delivered to all current subscribers. Prefer `Channel` + `receiveAsFlow()` when events should be delivered **exactly once** to **exactly one** collector (the UI).

### 4. `stateIn` and `shareIn` — Promoting Cold to Hot
Read the full skill on GitHub

Details

Skill name
kotlin-flow
Path
archive/skills/android/kotlin-flow/SKILL.md
License
MIT
Repo updated
2 November 2026

FAQ

What does the Kotlin Flow skill do?

Expert guidance on Kotlin Flow — cold vs hot flows, StateFlow / SharedFlow, common operators, combining, back-pressure, and testing with Turbine. Use this for any reactive data stream work.

How do I install the Kotlin Flow skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add PanPanFR/oh-my-openkilo --skill kotlin-flow. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Kotlin Flow popular?

It lives in PanPanFR/oh-my-openkilo, which has 9 GitHub stars and 1 forks.

Related skills

Adaptive

9

PanPanFR/oh-my-openkilo

Instructions to make or update an app's UI so that it adapts to different Android devices including phones, tablets, foldables, laptops, desktop, TV, Auto, and XR. It includes how to handle different window sizes, pointing devices (such as mouse) and text entry devices (such as keyboard) using the Compose MediaQuery API, and how to preserve UI, navigation, scroll, and media playback state across configuration changes (such as folding/unfolding a foldable, rotating a device, or resizing a window). It also covers multi-pane layouts using Navigation3 Scenes, adaptive UI components (such as button

Mobile Development

Agentmemory

9

PanPanFR/oh-my-openkilo

Index for agentmemory internals: how it is wired into a host agent, its architecture and ports, configuration flags, capture hooks, MCP tool surface, and REST fallback. Use when installing or debugging agentmemory itself, when a memory tool name or parameter is unclear, or when capture is not recording. For normal recall and save work, use agentmemory-ops instead.

AI, LLMs & Agents

Agentmemory History

9

PanPanFR/oh-my-openkilo

Read past work: resume the last session, recap recent sessions, list agent-linked commits, trace a line back to the session that wrote it, or compact the current conversation for handoff. Use when the user says "where were we", "resume", "recap", "session history", "what did we do", "why is this code here", "who wrote this", or "handoff".

AI, LLMs & Agents

Kotlin Testing

9

PanPanFR/oh-my-openkilo

Expert guidance on Kotlin unit testing with JUnit 5, MockK, kotlinx-coroutines-test, Turbine, and fluent assertion libraries. Use this when writing or reviewing unit tests.

Mobile Development

Kotlin Data Layer

9

PanPanFR/oh-my-openkilo

Build the Android data layer with Room, DataStore, Retrofit/OkHttp, serialization, offline-first sync, and coroutines/Flow.

Mobile Development

Leanback to Compose Tv Migration

9

PanPanFR/oh-my-openkilo

Provides instructions and architectural patterns for migrating Android TV applications from legacy Leanback UI Toolkit, Android Views, or Support Fragments to Jetpack Compose for TV (androidx.tv). Use this skill for Leanback to Compose migrations, including browse screen, settings screen, authentication screen, login screen, or video playback screen migrations, or when replacing BrowseSupportFragment, LeanbackSettingsFragment, PreferenceFragment, BaseLeanbackPreferenceFragmentCompat, VideoSupportFragment, GuidedStepSupportFragment, SearchSupportFragment, VerticalGridSupportFragment, Presenter,

Mobile Development

Browse the most popular Claude skills, all mobile development skills, or write your own with the skills generator.