kotlin-coroutines-flows

Standardize Android and Kotlin Multiplatform coroutine and Flow patterns.

Updated May 9, 2026
One-click install
npx skills add https://github.com/RambleRainbow/jd --skill kotlin-coroutines-flows-ramblerainbow
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-coroutines-flows
Source: https://github.com/RambleRainbow/jd/tree/main/.claude/skills/kotlin-coroutines-flows
Command: npx skills add https://github.com/RambleRainbow/jd --skill kotlin-coroutines-flows-ramblerainbow

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the common pain points of writing unmaintainable, leaky async code in Android and Kotlin Multiplatform (KMP) projects, resolving issues like uncancelled coroutines, unhandled Flow errors, and messy concurrent logic that lead to crashes and poor user experience.

Core Features & Use Cases

  • Structured Concurrency Patterns: Provides standardized scope hierarchy, parallel task decomposition with coroutineScope and async, and supervisorScope for independent operations to prevent coroutine leaks and ensure proper cancellation.
  • Reactive Flow Implementation: Includes ready-to-use patterns for StateFlow UI state management, SharedFlow one-time event handling, common Flow operators (debounce, retry, combine, flatMapLatest), and error handling with catch and retryWhen.
  • Cross-Platform & Testing Support: Offers dispatcher guidance for JVM/Android and other KMP targets, plus testable patterns using Turbine and TestDispatcher for validating coroutine and Flow behavior. Use case example: If you are building a KMP dashboard app that loads user items, daily stats, and profile data in parallel, this Skill provides the exact patterns to implement this reliably without memory leaks or race conditions.

Quick Start

Ask the AI to implement a parallel data loading ViewModel for your Android dashboard using structured coroutines and combined StateFlow for UI state, following the patterns defined in this Skill.

Frequently Asked Questions about kotlin-coroutines-flows

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

FAQPage Schema
How do I prevent coroutine leaks when loading data in parallel in Android?

Prevent coroutine leaks during parallel data loading by applying structured concurrency patterns with coroutineScope and async, ensuring proper cancellation and scope hierarchy. This Skill provides standardized patterns to decompose parallel tasks reliably without memory leaks.

How do I manage UI state with StateFlow and handle one-time events with SharedFlow?

Manage UI state with StateFlow and handle one-time events with SharedFlow using standardized reactive Flow patterns. This Skill provides ready-to-use implementations for UI state management and event handling, ensuring proper error handling and cooperative cancellation.

Does this approach support Kotlin Multiplatform dispatcher compatibility across different targets?

Kotlin Multiplatform dispatcher compatibility is supported through cross-platform dispatcher guidance for JVM, Android, and other KMP targets. This Skill ensures leak-free coroutine scope management and cooperative cancellation across all specified platforms.

What is the best way to test coroutines and Flows using Turbine and TestDispatcher?

The best way to test coroutines and Flows is by using Turbine and TestDispatcher to validate async behavior and reactive stream operations. This Skill offers testable patterns that verify structured concurrency and Flow logic without race conditions.

Why do my unhandled Flow errors cause crashes, and how can I implement retry logic for network calls?

Unhandled Flow errors cause crashes when reactive streams lack proper error handling, which you can fix with catch and retryWhen operators. This Skill provides standardized retry logic for network calls and debounced search inputs to resolve unhandled exceptions.

Can I use supervisorScope for independent operations to prevent coroutine cancellation failures?

You can use supervisorScope for independent operations to prevent one failure from cancelling all parallel coroutines. This Skill applies supervisorScope patterns to ensure independent operations continue running, preventing leaky async code and unexpected cancellation.