kotlin-coroutines-flows

Provide Kotlin coroutines and Flow guidance for Android and Kotlin Multiplatform projects.

2|Updated Mar 20, 2026
One-click install
npx skills add https://github.com/multiplex-ai/muggle-ai-teams --skill kotlin-coroutines-flows-multiplex-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-coroutines-flows
Source: https://github.com/multiplex-ai/muggle-ai-teams/tree/main/skills/kotlin-coroutines-flows
Command: npx skills add https://github.com/multiplex-ai/muggle-ai-teams --skill kotlin-coroutines-flows-multiplex-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Kotlin developers often struggle with chaining asynchronous tasks, managing lifecycles, and testing flows across Android and Kotlin Multiplatform. This Skill provides patterns for structured concurrency, Flow operators, and testing, enabling reliable, scalable async code.

Core Features & Use Cases

  • Structured concurrency patterns to avoid global scopes and cancellation hazards.
  • Flow-based reactive streams using Flow, StateFlow, and SharedFlow with practical examples.
  • Testing strategies for coroutines and flows across UI and data layers, including unit and integration tests.

Quick Start

Start by reading the patterns and applying structured concurrency and Flow usage in your Android or Kotlin Multiplatform projects.

Frequently Asked Questions about kotlin-coroutines-flows

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

FAQPage Schema
How do I test Kotlin coroutines and StateFlow in Android ViewModels?

Test Kotlin coroutines and StateFlow by applying structured testing strategies across UI and data layers. This Skill provides patterns for unit and integration testing of ViewModels, repositories, and use-cases to verify reactive stream behavior and cancellation effectively.

What is the best way to handle structured concurrency and avoid global scopes in Kotlin Multiplatform?

The best way to handle structured concurrency is to apply specific patterns that avoid global scopes and cancellation hazards. This Skill provides guidance for managing asynchronous tasks and lifecycles reliably across Android and Kotlin Multiplatform projects.

When should I use SharedFlow instead of StateFlow for reactive UI streams?

Use SharedFlow instead of StateFlow when you need reactive UI streams that handle multiple consumers or events without an initial value. This Skill covers Flow, StateFlow, and SharedFlow usage with practical examples to determine the right operator for your data loading.

How do I manage cancellation and error handling in Kotlin Flow operators?

Manage cancellation and error handling in Kotlin Flow operators by applying structured concurrency patterns and robust testing strategies. This Skill covers Flow operators, error handling, and performance considerations to ensure reliable asynchronous data streams.

Does this Kotlin coroutines guidance apply to Kotlin Multiplatform repositories and use-cases?

Yes, this Kotlin coroutines guidance applies directly to Kotlin Multiplatform repositories and use-cases. It provides practical patterns for asynchronous data loading, reactive UI streams, and structured concurrency across shared codebases.

Why does my Kotlin Flow test hang or fail during asynchronous data loading?

Your Kotlin Flow test may hang or fail due to improper cancellation handling or missing testing strategies for asynchronous data loading. This Skill provides unit and integration testing patterns to verify flows across UI and data layers reliably.