kotlin-concurrency-expert

Review and remediate Kotlin Coroutines usage in Android applications.

Updated Feb 28, 2026
One-click install
npx skills add https://github.com/trancee/noise-protocol --skill kotlin-concurrency-expert-trancee
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-concurrency-expert
Source: https://github.com/trancee/noise-protocol/tree/main/.github/skills/kotlin-concurrency-expert
Command: npx skills add https://github.com/trancee/noise-protocol --skill kotlin-concurrency-expert-trancee

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses common issues in Kotlin Coroutines usage within Android applications, ensuring robust, lifecycle-aware, and thread-safe concurrency.

Core Features & Use Cases

  • Concurrency Review: Analyzes Kotlin Coroutines implementation for best practices.
  • Bug Remediation: Fixes coroutine-related bugs like ANRs, memory leaks, and race conditions.
  • Performance Improvement: Optimizes thread safety and lifecycle management.
  • Use Case: A developer is experiencing ANRs in their Android app due to blocking the main thread. This Skill can identify the problematic coroutine usage and refactor it to use appropriate Dispatchers and structured concurrency.

Quick Start

Use the kotlin-concurrency-expert skill to review the provided Kotlin code snippet for lifecycle and concurrency issues.

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 ANRs caused by Kotlin Coroutines blocking the main thread in Android?

To fix ANRs caused by Kotlin Coroutines, you must refactor blocking operations off the main thread using appropriate Dispatchers. This Skill reviews your code to identify problematic coroutine usage and enforces structured concurrency to resolve application unresponsiveness.

What is structured concurrency and how does it prevent memory leaks in Android?

Structured concurrency in Android ensures coroutines are launched in specific scopes tied to a lifecycle. Proper scoping prevents memory leaks by automatically cancelling child coroutines when their parent scope is destroyed, which this Skill analyzes and remediates.

How do I ensure lifecycle-aware collection with Kotlin Coroutines?

To ensure lifecycle-aware collection with Kotlin Coroutines, you must use proper scoping that respects Android lifecycle boundaries. This Skill reviews your implementation to fix incorrect lifecycle-aware collection and avoid race conditions.

What is the best way to handle thread safety and race conditions in Kotlin?

The best way to handle thread safety and race conditions in Kotlin is through proper Dispatcher injection and structured concurrency. This Skill reviews your code to optimize thread safety and remediate concurrency bugs that cause unpredictable app behavior.

Why do my Kotlin Coroutines cause memory leaks when the Android activity is destroyed?

Kotlin Coroutines cause memory leaks when launched in global scopes without proper cancellation handling during Android lifecycle changes. This Skill identifies incorrect scoping and refactors your code to ensure lifecycle safety and proper coroutine cancellation.