kotlin-coroutines-structured-concurrency

Installation
SKILL.md

Kotlin coroutines: structured concurrency

Core principle

A well-structured coroutine is a self-contained unit of asynchronous work — single entry, single exit, scoped to a lifecycle known at the call site.

Scopes should usually be tied to the caller's lifecycle, not stored as a property on the callee. A stored CoroutineScope is a strong review signal: the class must prove it owns cancellation, error reporting, restart behavior, and lifecycle. Most repositories, managers, use cases, and data sources cannot prove that, so they should expose suspend APIs instead.

The fix is almost always the same: make the API suspend and let the caller own the scope.

When to use this skill

You're writing or reviewing Kotlin code and you see any of these:

Related skills
Installs
161
GitHub Stars
500
First Seen
3 days ago