kotlin-coroutines-flows

kotlin-coroutines-flows is a skill for Claude Code, Codex from Jamkris/everything-gemini-code. It costs 35 tokens per session (1,759 once invoked), scanned A, a copy of kotlin-coroutines-flows, MIT.

A guide to Kotlin coroutines and Flow, a Kotlin feature for running asynchronous work and handling streams of changing data. It covers structured concurrency, cancellation, StateFlow, SharedFlow, errors, and testing.

In plain words
What is it for?
Use it for Android or Kotlin Multiplatform code that loads data concurrently, exposes reactive state, manages coroutine scopes, or tests Flows and coroutines.
Why use it?
It helps keep concurrent work tied to the right lifecycle, so tasks can be cancelled and failures handled predictably. It also provides patterns for combining, delaying, retrying, and testing asynchronous operations.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for Android or Kotlin Multiplatform code that loads data concurrently, exposes reactive state, manages coroutine scopes, or tests Flows and coroutines.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jamkris/everything-gemini-code/kotlin-coroutines-flows
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Jamkris/everything-gemini-code --skill kotlin-coroutines-flows
Clone the repo
git clone --depth 1 https://github.com/Jamkris/everything-gemini-code

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for kotlin-coroutines-flows

README.md
[![agentmods](https://agentmods.dev/badge/skills/jamkris/everything-gemini-code/kotlin-coroutines-flows.svg)](https://agentmods.dev/skills/jamkris/everything-gemini-code/kotlin-coroutines-flows)
Your own site
<a href="https://agentmods.dev/skills/jamkris/everything-gemini-code/kotlin-coroutines-flows"><img src="https://agentmods.dev/badge/skills/jamkris/everything-gemini-code/kotlin-coroutines-flows.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,759 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 94% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00035 $0.01759
Opus 5 $0.00017 $0.00879
Sonnet 5 $0.00007 $0.00352
Haiku 4.5 $0.00003 $0.00176

Measured 4d ago against content hash fa459118a5ea, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

kotlin-coroutines-flows scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

94% identical to kotlin-coroutines-flows — 2 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/kotlin-coroutines-flows/SKILL.md · 285 lines

How it starts

The opening of the file, as written. The whole thing — 285 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Kotlin Coroutines & Flows

Patterns for structured concurrency, Flow-based reactive streams, and coroutine testing in Android and Kotlin Multiplatform projects.

When to Use

  • Writing async code with Kotlin coroutines
  • Using Flow, StateFlow, or SharedFlow for reactive data
  • Handling concurrent operations (parallel loading, debounce, retry)
  • Testing coroutines and Flows
  • Managing coroutine scopes and cancellation

Structured Concurrency

Scope Hierarchy

Application
  └── viewModelScope (ViewModel)
        └── coroutineScope { } (structured child)
              ├── async { } (concurrent task)
              └── async { } (concurrent task)

Always use structured concurrency — never GlobalScope:

// BAD
GlobalScope.launch { fetchData() }

// GOOD — scoped to ViewModel lifecycle
viewModelScope.launch { fetchData() }

// GOOD — scoped to composable lifecycle
LaunchedEffect(key) { fetchData() }

Parallel Decomposition

Use coroutineScope + async for parallel work:

suspend fun loadDashboard(): Dashboard = coroutineScope {
    val items = async { itemRepository.getRecent() }
    val stats = async { statsRepository.getToday() }
    val profile = async { userRepository.getCurrent() }
    Dashboard(
        items = items.await(),
        stats = stats.await(),
        profile = profile.await()
    )
}

SupervisorScope

Use supervisorScope when child failures should not cancel siblings:

suspend fun syncAll() = supervisorScope {
    launch { syncItems() }       // failure here won't cancel syncStats
    launch { syncStats() }
    launch { syncSettings() }
}

Flow Patterns

Cold Flow — One-Shot to Stream Conversion

fun observeItems(): Flow<List<Item>> = flow {
    // Re-emits whenever the database changes
    itemDao.observeAll()
        .map { entities -> entities.map { it.toDomain() } }
        .collect { emit(it) }
}

StateFlow for UI State

class DashboardViewModel(
    observeProgress: ObserveUserProgressUseCase
) : ViewModel() {
    val progress: StateFlow<UserProgress> = observeProgress()
        .stateIn(
            scope = viewModelScope,
            started = SharingStarted.WhileSubscribed(5_000),
            initialValue = UserProgress.EMPTY
        )
}

Read the full file on GitHub · 285 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 285 lines · 35 tokens per session scan A fa459118a5ea

Subscribe to this mod's changes

kotlin-coroutines-flows is a skill published in the GitHub repository Jamkris/everything-gemini-code (88 stars, last pushed 3mo ago), licensed MIT. It adds 35 tokens to every session and 1,759 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 94% identical to kotlin-coroutines-flows, differing in 2 lines, and is treated as a copy.

Related

Other skills, from other repositories

tauri-expert

Expert skill for Tauri (v2) development, Rust backend, IPC, and security / Panduan ahli untuk pengembangan Tauri v2, Rust backend, IPC, dan keamanan.

roedyrustam/vibes-plug · 43 tokens

programming

MUST USE for ANY work on .py .pyi .rs .ts .tsx .mts .cts .go files. One philosophy: strict types, modern stacks (Pydantic v2 / serde+thiserror / Zod / gin+sqlc+pgx+slog), modern toolchains (uv+basedpyright+ruff / cargo+clippy+miri / Bun+Biome+tsc / gofumpt+golangci-lint v2+nilaway+go-race), parse-don't-validate…

daeryundf2-prog/LAZYANTIGRAVITY · 261 tokens

python-programming-expert

Expert-level skill for Python programming (Python 3.13/3.14+). Covers type safety, generic syntax (PEP 695), async/await TaskGroups, FastAPI 0.115+, Pydantic v2, uv package manager, Ruff, and pytest in English and Indonesian.

roedyrustam/vibes-plug · 68 tokens

database-orm-expert

Expert guide for database schema design, ORM tools (Prisma 6, Drizzle ORM, TypeORM), migrations, query optimization, and type-safe SQL patterns in TypeScript / Panduan ahli untuk desain skema database, ORM tools (Prisma 6, Drizzle ORM, TypeORM), migrasi, optimasi query, dan pola SQL type-safe di TypeScript.

roedyrustam/vibes-plug · 82 tokens

js-backend-expert

Expert-level skill for Node.js 24+ (LTS), Bun 1.2+, and Deno 2.x backend development. Covers Express 5, Fastify 5, Hono v4, NestJS, Prisma 6, Drizzle ORM, WebSockets, BullMQ, OpenTelemetry, and microservices in English and Indonesian.

roedyrustam/vibes-plug · 77 tokens

swift-ci-scaffold

Scaffold the repo side of Xcode Cloud for an XcodeGen / Tuist Swift project - generate ciscripts/cipostclone.sh (regen + guarded CIBUILDNUMBER stamping), propose a unit-test-only CI scheme, print the exact App Store Connect workflow checklist, and optionally install an opt-in .githooks/pre-push gate. Shows diffs and…

charlesjones-dev/claude-code-plugins-dev · 82 tokens