kotlin-concurrency-expert

Diagnose and fix Kotlin coroutine race conditions and Flow mishandling in Android MVVM apps.

1|1|Updated Feb 5, 2026
One-click install
npx skills add https://github.com/ChooJeongHo/MovieFinder --skill kotlin-concurrency-expert-choojeongho
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-concurrency-expert
Source: https://github.com/ChooJeongHo/MovieFinder/tree/main/.claude/skills/kotlin-concurrency-expert
Command: npx skills add https://github.com/ChooJeongHo/MovieFinder --skill kotlin-concurrency-expert-choojeongho

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Diagnoses and fixes Kotlin coroutine race conditions, Flow misuses, and thread-safety bugs to improve reliability in Android apps using coroutines and flows.

Core Features & Use Cases

  • Detects and corrects race condition patterns in Kotlin coroutines (e.g., check-then-act, mutex usage, state flow updates)
  • Analyzes Flow emissions, upstream sharing, and dispatcher usage to prevent leaks and unnecessary recomputation
  • Provides actionable fixes and guidance for scope, cancellation, and synchronization to stabilize UI and data layers
  • Use cases include preventing duplicate API calls, debouncing UI actions, and ensuring safe background work in MVVM apps
  • Diagnoses and documents potential threading issues with concrete code examples

Quick Start

Provide an Android project with a failing race-condition scenario and let the tool analyze it.

Frequently Asked Questions about kotlin-concurrency-expert

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

FAQPage Schema
How do I fix race conditions in Kotlin coroutines using StateFlow and Mutex?

Fix Kotlin coroutine race conditions by applying Mutex-based synchronization and atomic StateFlow updates to prevent check-then-act bugs. This approach stabilizes concurrent state mutations across API calls and UI events in MVVM apps.

What causes duplicate API calls in Android MVVM apps using Kotlin coroutines and Flow?

Duplicate API calls in Android MVVM apps often stem from improper Flow sharing and unmanaged coroutine scopes. Analyzing upstream emissions and applying correct dispatcher usage prevents leaks and unnecessary recomputation.

How do I prevent deadlocks and handle cancellation in Kotlin SharedFlow and coroutines?

Prevent deadlocks in Kotlin SharedFlow by ensuring proper coroutine cancellation and scope management. Applying best-practice synchronization patterns stabilizes background work and UI data layers without blocking threads.

Does this concurrency diagnostic approach work for Android ViewModel and StateFlow architectures?

This concurrency diagnostic approach applies directly to Android ViewModel and StateFlow architectures. It analyzes MVVM-based structures to identify threading issues and provide concrete code fixes for UI event handling.

What is the best way to debounce UI actions and ensure safe background work in Kotlin Flow?

The best way to debounce UI actions in Kotlin Flow is by analyzing emissions and applying correct dispatcher usage. This prevents race conditions and ensures safe background work within coroutine scopes.

Why does my Kotlin coroutine leak memory during upstream Flow operations?

Kotlin coroutine memory leaks during upstream Flow operations occur due to improper scope and cancellation handling. Analyzing Flow emissions and dispatcher usage provides actionable fixes to prevent unnecessary recomputation and leaks.