kotlin-coroutines-expert — Claude Code skill: setup and usage
This skill guides Claude Code through Kotlin Coroutines and Flow, from coordinating concurrent work to handling failures and testing asynchronous functions. Use it when debugging cancellation or building reactive data streams.
npx claude-code-templates@latest --skill development/kotlin-coroutines-expertWhat kotlin-coroutines-expert does
The skill provides coding guidance for coordinating concurrent operations with coroutineScope and supervisorScope, handling exceptions, and managing coroutine lifetimes. It also explains when StateFlow fits persistent UI state and when SharedFlow suits event delivery. Examples cover transformations that connect search queries to repository calls.
For tests, the guidance focuses on runTest, TestScope, and injecting TestDispatcher so virtual time can be controlled. Blocking I/O operations are directed to Dispatchers.IO. Cancellation needs care: swallowing CancellationException instead of rethrowing it can interfere with the expected cancellation behavior.
Designed for Claude Code projects using Kotlin Coroutines and Flow, the skill supplies patterns and code examples for reviewing asynchronous logic. It does not replace executing tests against the actual project. Avoiding GlobalScope is one of its recommendations, since detached coroutine work can cause resource leaks.
What it helps with
- Coordinate concurrent repository calls in a suspend function
- Trace unexpected coroutine cancellation
- Choose
StateFloworSharedFlowfor a data stream - Write tests for suspending functions and
Flow - Handle exceptions in concurrent operations
Example prompts for the agent
- Review my Kotlin async data loading and suggest a structure using
coroutineScope. - Investigate the cancellation bug in my coroutine code, including how
CancellationExceptionis handled. - Help me test this
FlowwithrunTestand an injectedTestDispatcher.
How to install kotlin-coroutines-expert
1claude-code-templates
npx claude-code-templates@latest --skill development/kotlin-coroutines-expert2Skills CLI (Vercel)
npx skills add davila7/claude-code-templates --skill kotlin-coroutines-expert -a claude-code3Manually: put the files in place
~/.claude/skills/kotlin-coroutines-expert/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/kotlin-coroutines-expert/
Manually: put the files in place
.agents/skills/kotlin-coroutines-expert/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/kotlin-coroutines-expert/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install davila7/claude-code-templates kotlin-coroutines-expert2Manually: put the files in place
.github/skills/kotlin-coroutines-expert/SKILL.mdPlatform CLI
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/development/kotlin-coroutines-expertManually: put the files in place
.devin/skills/kotlin-coroutines-expert/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about kotlin-coroutines-expert
How do I install kotlin-coroutines-expert in Claude Code?
Run npx claude-code-templates@latest --skill development/kotlin-coroutines-expert. Alternatively, use npx skills add davila7/claude-code-templates --skill kotlin-coroutines-expert -a claude-code. The skill file path is ~/.claude/skills/kotlin-coroutines-expert/SKILL.md.
What does the kotlin-coroutines-expert skill do?
It guides Claude Code when working with Kotlin asynchronous operations, Flow pipelines, coroutine cancellation, and exception handling. It also provides testing patterns for suspending functions and reactive streams.
How does kotlin-coroutines-expert help with coroutine tests?
It recommends runTest and TestScope, along with injecting TestDispatcher into classes under test. These techniques let tests control virtual time and help diagnose hangs or inconsistent results.