Kotlin Coroutine Exception Handling — Development skill for Claude Code
Agent skill for exception handling in Kotlin coroutines & Flow — structured concurrency, CancellationException safety, Flow error operators, retry with backoff, ViewModel/Repository/WorkManager patter.
How to install Kotlin Coroutine Exception Handling
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open macsystems/kotlin-coroutine-exception-handling and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Kotlin Coroutine Exception Handling does
Agent skill for exception handling in Kotlin coroutines & Flow — structured concurrency, CancellationException safety, Flow error operators, retry with backoff, ViewModel/Repository/WorkManager patterns
Alternatives in Development
- Kotlin Lsp — Kotlin /plugin install kotlin-lsp@claude-plugins-official 14k ★
- L Docs Plugin — Document a Lowdefy plugin package (blocks, connections, operators, actions) 3k ★
- Exception — Signed gate-exception registry — replace ad-hoc --admin / --no-verify bypasses with an auditable, signed, expi 83 ★
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
Claude Code API Watchdog
Auto-recover Claude Code sessions stuck on transient API errors. Outer-loop watchdog for unattended tmux Claud
Agent API
Work as the API & Integration Engineer agent — Connects services with correct contracts, authorization, retry
Agm Diagnose
Diagnose a problem to a proven root cause. Use for หาสาเหตุ bug, error, 500/404, exception, ช้า, timeout, ข้อม
Fusebase Health
Run the read-only health check. Reports CLI_LAYER_DRIFT, FLOW_LAYER_DRIFT, SHARED_MERGE_DRIFT, EXCEPTION_IN_EF
Flow Approve
Approve one retry of a recently denied action
Verse Me Com Paid Consultation
Price a concrete forecasting or strategy question, decide whether to pay, then submit it through the x402 402-
Related Agents
Android Reviewer
Expert Android code reviewer specializing in Jetpack Compose best practices, Hilt DI scoping, Room migrations,
Kotlin Reviewer
Kotlin and Android/KMP code reviewer. Reviews Kotlin code for idiomatic patterns, coroutine safety, Compose be
Error Recovery Agent
Specialized agent for classifying, triaging, and recovering from errors in SkillOS task executions. Implements