Kotlin Coroutine Exception Handling
Description
Agent skill for exception handling in Kotlin coroutines & Flow — structured concurrency, CancellationException safety, Flow error operators, retry with backoff, ViewModel/Repository/WorkManager patterns
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
kotlin-coroutine-exception-handling
An agent skill for handling failures correctly in Kotlin coroutines and Flow on Android. It teaches an AI coding agent (Claude Code, Gemini CLI, or anything else that reads [Agent Skills](https://agentskills.io)-style `SKILL.md` files) the failure semantics of structured concurrency, so generated and reviewed code gets the hard parts right:
- Where an exception actually surfaces —
launchvsasync, root vs child,coroutineScopevssupervisorScope, and why "async defers untilawait()" is only half true. CancellationExceptionis not a failure — whycatch (e: Exception)andrunCatchingaround suspending calls are bugs, and the three safe patterns (including arunCatchingCancellablehelper).CoroutineExceptionHandleras a safety net wired to crash reporting, not an error-handling strategy.- Flow —
catchtransparency, why an exception insidecollect {}bypasses upstreamcatch, and terminating errors beforestateIn/shareIn. - Retry with real exponential backoff — bounded, transient-only, jittered, and testable with virtual time.
- Layering — which layer catches what (Repository → domain error type, ViewModel → UI state, UI → renders state).
Contents
| File | What it covers |
|---|---|
SKILL.md |
The core mental model, propagation table, scope shapes, cancellation safety, CoroutineExceptionHandler, Flow rules, backoff, layering, and a review checklist. |
references/android-integration.md |
Repository, ViewModel, lifecycle scopes and Compose, CoroutineWorker/WorkManager (Result.retry() with bounded attempts), app-scoped work. |
references/testing.md |
Testing failure paths with runTest, asserting cancellation is propagated (not swallowed), Turbine for Flow errors, backoff-curve assertions in virtual time. |
Installation
Claude Code
Clone into your skills directory — per project:
git clone https://github.com/macsystems/ko
Related Skills
Auto Update
Pull the latest ECC repo changes and reinstall the current managed targets.
Development Ecc Guide
Navigate ECC's current agents, skills, commands, hooks, install profiles, and docs from the live repository su
Development Epic Claim
Claim an epic issue, stamp coordination state, and sync local ownership.
Development Epic Publish
Publish a validated epic update back to the issue and local cache.
Development Epic Review
Mark epic review requested, approved, or changes requested.
Development Epic Unblock
Sweep blocked epic issues and reopen anything whose dependencies are closed.
Development Related Agents
Django Build Resolver
Django/Python build, migration, and dependency error resolution specialist. Fixes pip/Poetry errors, migration
Openai Codex CLI
(55.8k ⭐) - Lightweight coding agent that runs in your terminal.
src/agents/ — 11 Agent Definitions
**Generated:** 2026-04-11