kotlin-coroutines-flows

Implement structured concurrency and Flow operators in Kotlin Coroutines.

86|21|Updated Feb 9, 2026
One-click install
npx skills add https://github.com/Jamkris/everything-gemini-code --skill kotlin-coroutines-flows-jamkris
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-coroutines-flows
Source: https://github.com/Jamkris/everything-gemini-code/tree/main/skills/kotlin-coroutines-flows
Command: npx skills add https://github.com/Jamkris/everything-gemini-code --skill kotlin-coroutines-flows-jamkris

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Streamlining and organizing asynchronous work and reactive data flows in Android and Kotlin Multiplatform projects to reduce complexity and bugs.

Core Features & Use Cases

  • Structured concurrency patterns across coroutines to avoid leaks and cancellation issues.
  • Flow-based data streams with operators, and stateful patterns using StateFlow and SharedFlow.
  • Utilities for testing coroutines and flows, including deterministic scheduling and verification of UI state.
  • Real-world usage: building responsive UIs, data loading, and parallel task orchestration across platforms.

Quick Start

Integrate the Kotlin Coroutines & Flows patterns into your Android or Kotlin Multiplatform project to adopt structured concurrency and reactive streams.

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 coroutines to avoid memory leaks?

Structured concurrency in Kotlin organizes asynchronous work to prevent leaks by enforcing parent-child relationships between coroutines. This ensures tasks are properly cancelled and scoped within Android and Kotlin Multiplatform applications.

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

Use StateFlow for stateful data streams requiring a single updated state, and SharedFlow for broadcasting multiple values to multiple collectors. Both manage reactive data streams in Kotlin but serve distinct state-holding and event broadcasting purposes.

How do I test Kotlin coroutines and flows with deterministic scheduling?

Testing Kotlin coroutines and flows requires deterministic scheduling to verify UI state and asynchronous behavior predictably. This approach controls virtual time and execution order to validate flow emissions and cancellation logic accurately.

Does Kotlin Multiplatform support parallel task orchestration with coroutines?

Kotlin Multiplatform supports parallel task orchestration using coroutines across Android, JVM, and native platforms. This enables concurrent data loading and responsive UI development while maintaining structured concurrency and error handling.

What is the best way to handle errors in Kotlin Flow operators?

Handling errors in Kotlin Flow operators involves using specific operators to catch exceptions and manage reactive data stream failures. This ensures robust asynchronous work by handling errors gracefully without crashing the application.

Why does my Android coroutine leak when the user navigates away?

Android coroutine leaks occur when asynchronous work is not properly scoped to the lifecycle. Applying structured concurrency patterns scopes tasks to appropriate lifecycles, ensuring automatic cancellation when navigation destroys the view.