kotlin-coroutines-flows

Implement structured concurrency and Flow patterns for Kotlin projects.

8|Updated Apr 9, 2026
One-click install
npx skills add https://github.com/D0NMEGA/donnyclaude --skill kotlin-coroutines-flows-d0nmega
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-coroutines-flows
Source: https://github.com/D0NMEGA/donnyclaude/tree/main/packages/skills/kotlin-coroutines-flows
Command: npx skills add https://github.com/D0NMEGA/donnyclaude --skill kotlin-coroutines-flows-d0nmega

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Kotlin-based projects often struggle with asynchronous code, lifecycle-aware concurrency, and reactive data flows. This skill provides patterns and guidance to implement structured concurrency, Flow operators, and testing strategies across Android and Kotlin Multiplatform targets.

Core Features & Use Cases

  • Structured concurrency patterns for reliable cancellation and lifecycle alignment.
  • Flow-based patterns including StateFlow, SharedFlow, error handling, and stream composition.
  • Testing guidance for coroutines and Flows, with examples for unit and UI tests across platforms.
  • Real-world use cases: building responsive UIs, robust data pipelines, and resilient background tasks.

Quick Start

Integrate Kotlin coroutines and Flow patterns into your Android or Kotlin Multiplatform project to improve responsiveness and testability.

Frequently Asked Questions about kotlin-coroutines-flows

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement structured concurrency in Kotlin Multiplatform projects?

Structured concurrency in Kotlin Multiplatform is implemented by aligning coroutine cancellation with object lifecycles. This ensures reliable cancellation and lifecycle alignment across UI, data, and network layers for responsive background tasks.

What's the best way to test Kotlin coroutines and Flow operators in Android?

Testing Kotlin coroutines and Flow operators requires robust strategies for unit and UI tests. You structure tests to handle stream composition, StateFlow usage, and error handling across Android and Multiplatform targets.

How do I handle errors when composing multiple Flow streams in Kotlin?

Error handling for composed Flow streams in Kotlin involves applying specific Flow operators and patterns. This ensures resilient data pipelines and robust background tasks by managing exceptions across UI and network layers.

When should I use StateFlow versus SharedFlow for reactive data streams?

StateFlow is used for holding and emitting state to UI layers, while SharedFlow is for broadcasting events without state retention. Choosing between them structures concurrency and stream composition across Android and Kotlin Multiplatform projects.

Does Kotlin Multiplatform support parallel execution and cancellation for background tasks?

Kotlin Multiplatform supports parallel execution and robust cancellation patterns through coroutines. This provides structured concurrency to manage resilient background tasks and responsive UIs across different platform targets.

Why do my Kotlin coroutines leak when the Android lifecycle changes?

Coroutines leak during Android lifecycle changes due to lacking structured concurrency. Aligning coroutine scopes with lifecycle components ensures reliable cancellation and prevents background task leaks.