kotlin-coroutines-flows

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

A guide to Kotlin coroutines, which run asynchronous work, and Flow, which represents values produced over time. It covers structured concurrency, reactive streams, cancellation, error handling, and testing for Android and Kotlin Multiplatform projects.

In plain words
What is it for?
Use it to load data concurrently, build StateFlow or SharedFlow state, debounce and retry work, handle cancellation, and test coroutines and flows.
Why use it?
It helps keep concurrent work tied to the right application lifecycle and makes asynchronous behavior easier to test and control.

Skill for Claude CodeCodex

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

Good fit Use it to load data concurrently, build StateFlow or SharedFlow state, debounce and retry work, handle cancellation, and test coroutines and flows.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/majiang213/openclaw-mas/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 majiang213/OpenClaw-MAS --skill kotlin-coroutines-flows
Clone the repo
git clone --depth 1 https://github.com/majiang213/OpenClaw-MAS

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/majiang213/openclaw-mas/kotlin-coroutines-flows/github.svg)](https://agentmods.dev/skills/majiang213/openclaw-mas/kotlin-coroutines-flows)
Your own site
<a href="https://agentmods.dev/skills/majiang213/openclaw-mas/kotlin-coroutines-flows"><img src="https://agentmods.dev/badge/skills/majiang213/openclaw-mas/kotlin-coroutines-flows/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for kotlin-coroutines-flows

Your own site · 80×15
<a href="https://agentmods.dev/skills/majiang213/openclaw-mas/kotlin-coroutines-flows"><img src="https://agentmods.dev/badge/skills/majiang213/openclaw-mas/kotlin-coroutines-flows.svg" alt="Reviewed on agentmods" width="80" 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 100% 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 8d ago against content hash aaac6a9031e4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, 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 8d 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

100% identical to kotlin-coroutines-flows — 0 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.

ecc-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 Activate

  • 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. 8d ago First seen · 285 lines · 35 tokens per session scan A aaac6a9031e4

Subscribe to this mod's changes

kotlin-coroutines-flows is a skill published in the GitHub repository majiang213/OpenClaw-MAS (5 stars, last pushed 5mo 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 100% identical to kotlin-coroutines-flows, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories