kotlin-coroutines-flows

Implement structured concurrency and Flow patterns for Kotlin asynchronous code.

Updated Mar 25, 2026
One-click install
npx skills add https://github.com/SOLEROM/cldlab --skill kotlin-coroutines-flows-solerom
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-coroutines-flows
Source: https://github.com/SOLEROM/cldlab/tree/main/ecc/ref_claude/skills/kotlin-coroutines-flows
Command: npx skills add https://github.com/SOLEROM/cldlab --skill kotlin-coroutines-flows-solerom

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Patterned guidance to implement efficient asynchronous code using Kotlin coroutines and Flow across Android and Kotlin Multiplatform projects, reducing boilerplate and errors.

Core Features & Use Cases

  • Structured concurrency and scope usage: viewModelScope, coroutineScope for safe task lifecycles
  • Flow operators, StateFlow, and SharedFlow: reactive streams for UI state and events
  • Error handling, cancellation, and testing: robust resilience in coroutine-based code
  • Patterns for parallel loading, combining flows, and practical testing strategies

Quick Start

Describe a minimal Kotlin snippet that demonstrates structured concurrency with two parallel tasks and a StateFlow-based UI state.

Frequently Asked Questions about kotlin-coroutines-flows

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

FAQPage Schema
How do I use Kotlin coroutines and StateFlow for reactive UI state in Android?

You can use Kotlin coroutines and StateFlow for reactive UI state by exposing StateFlow from your ViewModel to emit state updates asynchronously. This Skill provides structured patterns for managing UI state and events using Flow operators and StateFlow in Android and Kotlin Multiplatform projects.

What's the best way to handle parallel data loading with structured concurrency in Kotlin?

Handle parallel data loading in Kotlin using structured concurrency via coroutineScope for safe task lifecycles. This Skill demonstrates parallel decomposition and combining flows to execute concurrent asynchronous tasks safely without boilerplate.

How do I handle cancellation and errors in Kotlin coroutine Flow operators?

Handle cancellation and errors in Kotlin Flow operators using supervisorScope and structured error handling patterns. This Skill provides robust resilience guidance for managing exceptions and cancellation safely in coroutine-based code.

How do I unit test Kotlin coroutine-based code that uses Flow and StateFlow?

Unit test Kotlin coroutine code by applying specific testing patterns for Flow and StateFlow. This Skill demonstrates practical testing strategies to verify asynchronous behavior, reactive streams, and structured concurrency in your Kotlin Multiplatform projects.