Skip to main content
skill

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.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --skill development/kotlin-coroutines-expert
Open on GitHub

What 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 StateFlow or SharedFlow for 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 CancellationException is handled.
  • Help me test this Flow with runTest and an injected TestDispatcher.

How to install kotlin-coroutines-expert

1claude-code-templates

npx claude-code-templates@latest --skill development/kotlin-coroutines-expert

2Skills CLI (Vercel)

npx skills add davila7/claude-code-templates --skill kotlin-coroutines-expert -a claude-code

3Manually: put the files in place

~/.claude/skills/kotlin-coroutines-expert/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/kotlin-coroutines-expert/

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.

Similar skills

All skills for Programming languages →

From the same set804

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor