kotlin-coroutines-flows

Implement structured concurrency and reactive data streams with Kotlin Coroutines and Flows.

1|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/TakMczk/copilot-cli-ecc --skill kotlin-coroutines-flows-takmczk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-coroutines-flows
Source: https://github.com/TakMczk/copilot-cli-ecc/tree/main/.github/skills/kotlin-coroutines-flows
Command: npx skills add https://github.com/TakMczk/copilot-cli-ecc --skill kotlin-coroutines-flows-takmczk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill simplifies the complexities of asynchronous programming in Kotlin, providing clear patterns for structured concurrency, reactive data streams with Flows, and robust testing strategies.

Core Features & Use Cases

  • Structured Concurrency: Implement safe, cancellable asynchronous operations using coroutine scopes, avoiding common pitfalls like GlobalScope.
  • Flow Management: Utilize StateFlow, SharedFlow, and various operators (combine, debounce, retryWhen) for efficient reactive data handling.
  • Testing Coroutines: Learn to effectively test asynchronous code with runTest and TestDispatcher.
  • Use Case: Build responsive Android UIs or KMP applications by managing network requests, database operations, and UI state updates seamlessly with coroutines and Flows.

Quick Start

Use the kotlin-coroutines-flows skill to demonstrate structured concurrency with a viewModelScope.launch example.

Frequently Asked Questions about kotlin-coroutines-flows

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

FAQPage Schema
How do I manage background tasks in Android using Kotlin Coroutines?

Manage background tasks in Android using Kotlin Coroutines by implementing structured concurrency with viewModelScope, ensuring safe and cancellable operations without common pitfalls like GlobalScope.

What's the best way to handle reactive data streams with Kotlin Flow?

Handle reactive data streams with Kotlin Flow by utilizing StateFlow and SharedFlow alongside operators like combine, debounce, and retryWhen for efficient UI state updates and data management.

How do I test asynchronous code with Kotlin Coroutines and Flows?

Test asynchronous code with Kotlin Coroutines and Flows by using the runTest API and TestDispatcher to effectively validate reactive data streams and background task execution.

When should I use StateFlow vs SharedFlow for UI state updates?

Use StateFlow for UI state updates requiring a single latest value to represent current screen state, and SharedFlow for broadcasting events to multiple collectors without retaining state.

Does this Kotlin Coroutines and Flows skill support KMP development?

Yes, this skill supports Kotlin Multiplatform (KMP) development, providing patterns and best practices for managing network requests, database operations, and UI state seamlessly across platforms.

Why should I avoid GlobalScope when implementing structured concurrency?

Avoid GlobalScope when implementing structured concurrency because it breaks the parent-child coroutine hierarchy, preventing automatic cancellation and leading to potential memory leaks and unmanaged background tasks.