Compose Multiplatform Patterns
monta-app/ocpp-emulator
Compose Multiplatform and Jetpack Compose patterns for KMP projects — state management, navigation, theming, performance, and platform-specific UI.
A skill your agent uses when working with Flow, StateFlow, SharedFlow, or Channel in Kotlin — including cold vs hot stream decisions, operator chains, lifecycle-safe collection, UI state management…
$ npx skills add rcosteira79/android-skills --skill kotlin-flows -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install rcosteira79/android-skills kotlin-flows --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/rcosteira79/android-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/android-skills/skills/kotlin-flows .claude/skills/kotlin-flows && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "kotlin-flows" agent skill from https://github.com/rcosteira79/android-skills/tree/main/plugins/android-skills/skills/kotlin-flows into .claude/skills/kotlin-flows/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "kotlin-flows", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/rcosteira79/android-skills/tree/main/plugins/android-skills/skills/kotlin-flowsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add rcosteira79/android-skills --skill kotlin-flows -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install rcosteira79/android-skills kotlin-flows --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/rcosteira79/android-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/plugins/android-skills/skills/kotlin-flows .agents/skills/kotlin-flows && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "kotlin-flows" agent skill from https://github.com/rcosteira79/android-skills/tree/main/plugins/android-skills/skills/kotlin-flows into .agents/skills/kotlin-flows/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "kotlin-flows", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add rcosteira79/android-skills --skill kotlin-flows -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install rcosteira79/android-skills kotlin-flows --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/rcosteira79/android-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/plugins/android-skills/skills/kotlin-flows .cursor/skills/kotlin-flows && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "kotlin-flows" agent skill from https://github.com/rcosteira79/android-skills/tree/main/plugins/android-skills/skills/kotlin-flows into .cursor/skills/kotlin-flows/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "kotlin-flows", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/rcosteira79/android-skills.git --path plugins/android-skills/skills/kotlin-flows--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add rcosteira79/android-skills --skill kotlin-flows -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install rcosteira79/android-skills kotlin-flows --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/rcosteira79/android-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/plugins/android-skills/skills/kotlin-flows .gemini/skills/kotlin-flows && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "kotlin-flows" agent skill from https://github.com/rcosteira79/android-skills/tree/main/plugins/android-skills/skills/kotlin-flows into .gemini/skills/kotlin-flows/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "kotlin-flows", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install rcosteira79/android-skills kotlin-flowsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add rcosteira79/android-skills --skill kotlin-flows -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/rcosteira79/android-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/plugins/android-skills/skills/kotlin-flows .github/skills/kotlin-flows && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "kotlin-flows" agent skill from https://github.com/rcosteira79/android-skills/tree/main/plugins/android-skills/skills/kotlin-flows into .github/skills/kotlin-flows/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "kotlin-flows", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add rcosteira79/android-skills --skill kotlin-flows -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install rcosteira79/android-skills kotlin-flows --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/rcosteira79/android-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/plugins/android-skills/skills/kotlin-flows .opencode/skills/kotlin-flows && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "kotlin-flows" agent skill from https://github.com/rcosteira79/android-skills/tree/main/plugins/android-skills/skills/kotlin-flows into .opencode/skills/kotlin-flows/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "kotlin-flows", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
kotlin-flowsA skill your agent uses when working with Flow, StateFlow, SharedFlow, or Channel in Kotlin — including cold vs hot stream decisions, operator chains, lifecycle-safe collection, UI state management…
Kotlin Flows is an agent skill from rcosteira79/android-skills. Use when working with Flow, StateFlow, SharedFlow, or Channel in Kotlin — including cold vs hot stream decisions, operator chains, lifecycle-safe collection, UI state management, callback bridging, or Channel migration in Android or KMP projects.
Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Mobile, covering Android development and State management. It works with Kotlin and Android. The repository describes itself as: Claude Code skills for Android & KMP development. The licence is MIT.
Read from SKILL.md and the folder at commit 0f9af5a. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are kotlin).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Kotlin Flows loads about 1.8k tokens when it runs. Until then it costs about 65 tokens; SKILL.md has 640 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from rcosteira79/android-skills at commit 0f9af5a, republished under its MIT licence (© rcosteira79). 640 words, ~1,840 tokens.
.claude/skills/kotlin-flows/SKILL.md (or your agent's skills folder).This reference covers the Flow traps and semantic edge cases — Channel vs SharedFlow, callback bridging, retry/error handling, side effects in transforms, and KMP boundaries — not the basics of cold/hot streams, the operator table, or lifecycle-safe collection.
| Found | Action |
|---|---|
BroadcastChannel | Migrate → SharedFlow (deprecated) |
ConflatedBroadcastChannel | Migrate → StateFlow (deprecated) |
Channel for single-consumer fire-once events (nav, snackbars, one-shot effects) | Keep — correct. Channel(BUFFERED).receiveAsFlow() |
Channel broadcast to multiple collectors | Migrate → SharedFlow (see below) |
Channel as producer-consumer queue | Keep — correct |
Channel.receiveAsFlow() is fan-out, NOT broadcast. With multiple collectors, each event reaches one collector (the framework picks which), not all of them. If every collector must see every event, you need SharedFlow. This is the trap that's easy to fall into when reaching for Channel to multicast.
For single-consumer one-shot events, Channel(BUFFERED).receiveAsFlow() is the default because send suspends until consumed (the event is queued, never dropped), whereas SharedFlow(replay = 0) drops the emission if no collector is active at the instant of emission. Expose the Flow, never the Channel, and collect with collect inside LaunchedEffect — not collectAsStateWithLifecycle, which retains the last event as state and re-fires it on every recomposition / config change.
private val _events = Channel<UiEvent>(Channel.BUFFERED)
val events: Flow<UiEvent> = _events.receiveAsFlow()
// in the UI
LaunchedEffect(Unit) {
viewModel.events.collect { event -> /* navigate / snackbar — consumed once */ }
}Exactly-once is really at-most-once-with-very-high-probability. A receiveAsFlow() collector cancelled after receive() succeeds but before its block processes the element loses that element. Rare (most cancellations land between receives), but for payment/persistence-critical signals, store the outcome in durable state (a pendingResult field on UiState, cleared by the UI after consumption) — see compose/references/state-management.md "Durable state + acknowledgement".
launch { emit() } over tryEmitDefault to launch { _events.emit(e) } — it suspends until the collector is ready, so the effect is never silently lost. tryEmit() on a default MutableSharedFlow() (no buffer) silently drops when no subscriber is ready; adding extraBufferCapacity = 1 only moves the cliff (a second rapid emission while the buffer is full returns false and is dropped with no error). Use tryEmit only for miss-tolerable effects (tooltip, sound).
The _x (mutable) / x (read-only) two-property idiom collapses into a single property with explicit backing fields — stable in Kotlin 2.4, experimental in 2.3:
val uiState: StateFlow<UiState>
field = MutableStateFlow(UiState()) // inside the class: uiState.update { … }; callers see StateFlowApplies wherever a StateFlow / SharedFlow is exposed from a mutable backing (MutableStateFlow is a StateFlow, so the default getter type-checks). It does not fit a Channel exposed as a Flow — a Channel isn't a Flow, so keep the explicit _events / receiveAsFlow() pair above. On Kotlin < 2.4 (check the version catalog), keep the classic private val _x + val x = _x.asStateFlow().
// Single value: suspendCancellableCoroutine — always prefer it (propagates cancellation)
suspend fun authenticate(token: String): User = suspendCancellableCoroutine { cont ->
val call = authApi.authenticate(token) { user, error ->
if (user != null) cont.resume(user) else cont.resumeWithException(error ?: Exception())
}
cont.invokeOnCancellation { call.cancel() }
}
// suspendCoroutine only when the API has no cancellation concept at all.
// Stream: callbackFlow — awaitClose is MANDATORY (omitting it leaks the callback and never completes)
fun LocationManager.locationUpdates(provider: String): Flow<Location> = callbackFlow {
val listener = LocationListener { trySend(it) }
requestLocationUpdates(provider, 1000L, 0f, listener)
awaitClose { removeUpdates(listener) }
}For a third-party SDK with no deregistration API, set a flag inside awaitClose to signal shutdown and document the limitation.
repository.getItems()
.retryWhen { cause, attempt ->
if (cause is IOException && attempt < 3) { delay((attempt + 1) * 1_000L); true } else false
}
.collect { ... }attempt is the 0-based retry index. Without the attempt < count check the flow retries forever on a persistent error. (retry(3) { it is IOException } is the simple form.)
.catch scope and the cancellation trap.catch intercepts upstream errors only (not exceptions thrown inside collect {}), and — unlike try/catch — it does not swallow CancellationException. So prefer the operator form, and for collector-side work catch specific types.
// ✓ upstream errors, cancellation-safe
repository.getItems().onEach { process(it) }.catch { logger.error(it) }.collect()
// ✗ catch (e: Exception) inside collect/any suspend fn swallows CancellationException and breaks
// structured concurrency — the single most common coroutine bug.
// If a broad catch is unavoidable: if (e is CancellationException) throw e // before handlingcombine/map transformsTransform lambdas are pure and re-execute on every upstream emission and every resubscription (e.g. rotation with WhileSubscribed). A viewModelScope.launch {} or event emission inside one fires repeatedly. Move it to onEach after the transform:
combine(userFlow, settingsFlow) { user, settings -> UiState(user, settings) }
.onEach { analytics.logView(it.user.id) } // not inside combine
.stateIn(viewModelScope, SharingStarted.WhileSubscribed(5_000), UiState.Empty)combine waits for every input to emit at least once before its first emission. If one input is a cold flow that never emits, the combined flow never emits — the classic "screen stuck on Loading" bug. Make each input a StateFlow, give cold inputs onStart { emit(initial) }, or sentinel-prefix them. (combine(a, b) { (x, y) -> … } destructuring doesn't compile.)
Expose Flow from shared code; collect per-platform (iOS: SKIE or a CoroutineScope wrapper). Avoid reading StateFlow.value from non-coroutine iOS contexts — use a collection wrapper.
Flow testing lives in android-skills:android-testing — read the two-schedulers trap (runTest + MainDispatcherRule must share one scheduler) before asserting on hot flows.
© rcosteira79, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in plugins/android-skills/skills/kotlin-flows of rcosteira79/android-skills.
Open the folder on GitHubat commit 0f9af5a
Kotlin Flows next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Kotlin Flows this skillrcosteira79/android-skills | 153 | — | ~1.8k | Automated safety check: Pass | MIT | |
| Compose Multiplatform Patternsmonta-app/ocpp-emulator | 180 | 5 repos | ~2k | Automated safety check: Pass | Apache-2.0 | |
| Android Hidden API and R8 Checkgkd-kit/gkd | 43k | — | ~1.5k | Automated safety check: Pass | GPL-3.0 | |
| Android Developmentdpconde/claude-android-skill | 336 | — | ~1.7k | Automated safety check: Pass | MIT | |
| Architecture Overclocknekomangaorg/Neko | 2.8k | — | ~1.4k | Automated safety check: Pass | Apache-2.0 | |
| Jetpack Compose Audithamen/compose_skill | 373 | — | ~6k | Automated safety check: Notes | MIT |
monta-app/ocpp-emulator
Compose Multiplatform and Jetpack Compose patterns for KMP projects — state management, navigation, theming, performance, and platform-specific UI.
gkd-kit/gkd
Checks whether Android hidden-API implementations and system callbacks survive R8 minification, and diagnoses Release-only failures such as AbstractMethodError.
dpconde/claude-android-skill
Create production-quality Android applications following Google's official architecture guidance and NowInAndroid best practices.
nekomangaorg/Neko
Resolves deep, structural performance bottlenecks in the Kotlin Android codebase.
hamen/compose_skill
Audit Android Jetpack Compose repositories for performance, animation phase correctness, state management, side effects, composable API quality, and adjacent Android launch UX resource risks such as…
Drjacky/claude-android-ninja
Build and migrate Android apps with Kotlin, Jetpack Compose, MVVM, Hilt, Room 3 (KSP, SQLiteDriver, Flow/suspend DAOs), Navigation3, and multi-module Gradle.
rcosteira79/android-skills
Guides writing correct, performant Compose and Compose Multiplatform UI across Android, desktop, iOS and web, from state and animation to design-to-code and crash fixes.
rcosteira79/android-skills
Helps choose how common Kotlin Multiplatform code reaches platform APIs: expect/actual, a common interface with platform bindings, or separate platform screens.
rcosteira79/android-skills
Sets out the repository pattern's error-propagation model for Android and Kotlin Multiplatform, plus the Room setup for commonMain.
rcosteira79/android-skills
Android and KMP debugging techniques for crashes, ANRs, memory leaks, R8 traces, Gradle failures and Compose recomposition, built on finding the root cause first.
rcosteira79/android-skills
Sets house defaults for Android and Kotlin Multiplatform work and routes to the right specialized skill for Compose, networking, testing or build tooling.
rcosteira79/android-skills
Sets up Android Gradle convention plugins in a build-logic composite build, including the version catalog wiring and shared configuration that are easy to get wrong.
Categories
A skill your agent uses when working with Flow, StateFlow, SharedFlow, or Channel in Kotlin — including cold vs hot stream decisions, operator chains, lifecycle-safe collection, UI state management…. Kotlin Flows is an agent skill from rcosteira79/android-skills. Use when working with Flow, StateFlow, SharedFlow, or Channel in Kotlin — including cold vs hot stream decisions, operator chains, lifecycle-safe collection, UI state management, callback bridging, or Channel migration in Android or KMP projects.
Kotlin Flows fits situations like: working with Flow; channel in Kotlin — including cold vs hot stream decisions; operator chains; lifecycle-safe collection.
Run `npx skills add rcosteira79/android-skills --skill kotlin-flows -a claude-code`. Or copy the skill folder (plugins/android-skills/skills/kotlin-flows in rcosteira79/android-skills) into .claude/skills/kotlin-flows in your project. Claude Code loads it when a task matches its description.
Run `npx skills add rcosteira79/android-skills --skill kotlin-flows -a codex`. Or copy the skill folder (plugins/android-skills/skills/kotlin-flows in rcosteira79/android-skills) into .agents/skills/kotlin-flows in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add rcosteira79/android-skills --skill kotlin-flows -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/kotlin-flows, .gemini/skills/kotlin-flows, .github/skills/kotlin-flows and .opencode/skills/kotlin-flows in your project.
SKILL.md names no scripts, command-line tools or credentials: Kotlin Flows is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Kotlin Flows is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.8k tokens (SKILL.md is roughly 7.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Kotlin Flows: Compose Multiplatform Patterns (monta-app/ocpp-emulator, 180 stars), Android Hidden API and R8 Check (gkd-kit/gkd, 43k stars), Android Development (dpconde/claude-android-skill, 336 stars) and Architecture Overclock (nekomangaorg/Neko, 2.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
rcosteira79 (a GitHub user) maintains it in rcosteira79/android-skills, which has 153 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on September 19, 2026.
Source: rcosteira79/android-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.