kotlin-coroutines

Guide Kotlin coroutines for Android and KMP asynchronous code.

6|Updated Jun 24, 2026
One-click install
npx skills add https://github.com/PL-Coding-GmbH/Skills --skill kotlin-coroutines-pl-coding-gmbh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-coroutines
Source: https://github.com/PL-Coding-GmbH/Skills/tree/main/skills/kotlin-coroutines
Command: npx skills add https://github.com/PL-Coding-GmbH/Skills --skill kotlin-coroutines-pl-coding-gmbh

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides in-depth knowledge and best practices for using Kotlin coroutines, solving challenges related to asynchronous programming, cancellation safety, and structured concurrency.

Core Features & Use Cases

  • Suspension and Cancellation: Learn how to write safe and efficient Kotlin coroutines with focus on cancellation safety and cooperative cancellation.
  • Parallel Execution: Explore techniques for parallel execution, including async and launch, and how to handle concurrent tasks effectively.
  • Synchronization: Understand synchronization tools such as Mutex and limitedParallelism for thread-safe operations.
  • Custom Scopes: Discover how to create custom coroutine scopes with SupervisorJob() and manage lifecycle-aware operations with applicationScope.
  • Use Case: For a developer looking to enhance Android or KMP applications with efficient and robust asynchronous code, this Skill offers essential guidance on implementing coroutines and avoiding common pitfalls.

Quick Start

Use the kotlin-coroutines skill to learn about coroutine cancellation safety by reviewing the provided code examples and best practices.

Frequently Asked Questions about kotlin-coroutines

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

FAQPage Schema
How do I implement structured concurrency in Kotlin coroutines for Android?

Structured concurrency in Kotlin coroutines manages parallel execution through custom scopes and SupervisorJob, ensuring synchronized operations and safe cancellation across Android and KMP applications.

What is cooperative cancellation in Kotlin coroutines and how do I make suspend functions safe?

Cooperative cancellation in Kotlin coroutines requires checking cancellation states within suspend functions to safely stop execution. It prevents resource leaks and ensures structured concurrency.

How do I handle parallel execution with async and launch in Kotlin coroutines?

Parallel execution in Kotlin coroutines uses async and launch builders to handle concurrent tasks. You manage these operations within custom coroutine scopes to maintain synchronization and thread safety.

When should I use Mutex and limitedParallelism for thread-safe operations in Kotlin?

Use Mutex and limitedParallelism for thread-safe operations in Kotlin when synchronizing concurrent access to shared resources. These tools prevent race conditions in asynchronous programming.

Does this Kotlin coroutines guidance apply to both Android and KMP development?

This Kotlin coroutines guidance applies to both Android and KMP development, offering comprehensive best practices for suspend functions, structured concurrency, and scope management across multiplatform projects.

How do I create custom coroutine scopes with applicationScope for lifecycle-aware operations?

Create custom coroutine scopes using SupervisorJob and applicationScope to manage lifecycle-aware operations. This approach ensures structured concurrency and safe cancellation for Android and KMP applications.