Agent skill

Kotlin Coroutines Expert

by davila7 in davila7/claude-code-templates

Expert patterns for Kotlin Coroutines and Flow, covering structured concurrency, error handling, and testing.

MITAuto-check passedDevelopment

Install Kotlin Coroutines Expert

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

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install davila7/claude-code-templates kotlin-coroutines-expert --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/davila7/claude-code-templates.git skills-src && mkdir -p .claude/skills && cp -r skills-src/cli-tool/components/skills/development/kotlin-coroutines-expert .claude/skills/kotlin-coroutines-expert && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
kotlin-coroutines-expert
GitHub stars
33k
Used in
4 other repos
Token cost
~763 tokens
SKILL.md length
201 words
Files
1
Skills in repo
479
Repo updated
First seen
Licence
MIT

At a glance

Expert patterns for Kotlin Coroutines and Flow, covering structured concurrency, error handling, and testing.

  • Works in 3 steps: Structured Concurrency → Exception Handling → Reactive Streams with Flow
  • Tasks that involve Error handling
  • SKILL.md covers Overview, When to Use This Skill, Step-by-Step Guide and Examples, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Kotlin Coroutines Expert is an agent skill from davila7/claude-code-templates. Expert patterns for Kotlin Coroutines and Flow, covering structured concurrency, error handling, and testing.

Its SKILL.md is about 760 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Error handling and Async programming. It works with Kotlin. The repository describes itself as: CLI tool for configuring and monitoring Claude Code. The licence is MIT.

When your agent uses it

  • Tasks that involve Error handling
  • Tasks that involve Async programming

Example prompts

  • “/kotlin-coroutines-expert”

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Structured Concurrency
  2. Exception Handling
  3. Reactive Streams with Flow

What it can do on your machine

Read from SKILL.md and the folder at commit 79182c5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are kotlin).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Kotlin Coroutines Expert loads about 763 tokens when it runs. Until then it costs about 34 tokens; SKILL.md has 201 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~34
When it runs · the whole SKILL.md, loaded when a task matches
~763

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from davila7/claude-code-templates at commit 79182c5, republished under its MIT licence (© davila7). 201 words, ~763 tokens.

Download SKILL.mdSave it as .claude/skills/kotlin-coroutines-expert/SKILL.md (or your agent's skills folder).
name
kotlin-coroutines-expert
description
Expert patterns for Kotlin Coroutines and Flow, covering structured concurrency, error handling, and testing.
risk
safe
source
community
date_added
2026-02-27

Kotlin Coroutines Expert

Overview

A guide to mastering asynchronous programming with Kotlin Coroutines. Covers advanced topics like structured concurrency, Flow transformations, exception handling, and testing strategies.

When to Use This Skill

  • Use when implementing asynchronous operations in Kotlin.
  • Use when designing reactive data streams with Flow.
  • Use when debugging coroutine cancellations or exceptions.
  • Use when writing unit tests for suspending functions or Flows.

Step-by-Step Guide

1. Structured Concurrency

Always launch coroutines within a defined CoroutineScope. Use coroutineScope or supervisorScope to group concurrent tasks.

kotlin
suspend fun loadDashboardData(): DashboardData = coroutineScope {
    val userDeferred = async { userRepo.getUser() }
    val settingsDeferred = async { settingsRepo.getSettings() }
    
    DashboardData(
        user = userDeferred.await(),
        settings = settingsDeferred.await()
    )
}
2. Exception Handling

Use CoroutineExceptionHandler for top-level scopes, but rely on try-catch within suspending functions for granular control.

kotlin
val handler = CoroutineExceptionHandler { _, exception ->
    println("Caught $exception")
}

viewModelScope.launch(handler) {
    try {
        riskyOperation()
    } catch (e: IOException) {
        // Handle network error specifically
    }
}
3. Reactive Streams with Flow

Use StateFlow for state that needs to be retained, and SharedFlow for events.

kotlin
// Cold Flow (Lazy)
val searchResults: Flow<List<Item>> = searchQuery
    .debounce(300)
    .flatMapLatest { query -> searchRepo.search(query) }
    .flowOn(Dispatchers.IO)

// Hot Flow (State)
val uiState: StateFlow<UiState> = _uiState.asStateFlow()

Examples

Example 1: Parallel Execution with Error Handling
kotlin
suspend fun fetchDataWithErrorHandling() = supervisorScope {
    val task1 = async { 
        try { api.fetchA() } catch (e: Exception) { null } 
    }
    val task2 = async { api.fetchB() }
    
    // If task2 fails, task1 is NOT cancelled because of supervisorScope
    val result1 = task1.await()
    val result2 = task2.await() // May throw
}

Best Practices

  • ✅ Do: Use Dispatchers.IO for blocking I/O operations.
  • ✅ Do: Cancel scopes when they are no longer needed (e.g., ViewModel.onCleared).
  • ✅ Do: Use TestScope and runTest for unit testing coroutines.
  • ❌ Don't: Use GlobalScope. It breaks structured concurrency and can lead to leaks.
  • ❌ Don't: Catch CancellationException unless you rethrow it.

Troubleshooting

Problem: Coroutine test hangs or fails unpredictably. Solution: Ensure you are using runTest and injecting TestDispatcher into your classes so you can control virtual time.

© davila7, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in cli-tool/components/skills/development/kotlin-coroutines-expert of davila7/claude-code-templates.

Open the folder on GitHubat commit 79182c5

Used in 4 other repositories

We found 13 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 4 other GitHub owners. This page covers the copy in davila7/claude-code-templates, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Kotlin Coroutines Expert next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Kotlin Coroutines Expert compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Kotlin Coroutines Expert this skilldavila7/claude-code-templates33k4 repos~763Automated safety check: PassMIT
Rust Async Patternsdiodeme/Gold-Band14310 repos~3.1kAutomated safety check: PassAGPL-3.0
Rust Engineerfarm-fe/farm5.6k1 repos~1.5kAutomated safety check: PassMIT
Ha Android Concurrencyhome-assistant/android4k—~1kAutomated safety check: PassApache-2.0
Windmill Rust Backend Patternswindmill-labs/windmill18k—~869Automated safety check: PassCustom licence
Akka.NET Best PracticesAaronontheweb/dotnet-skills1.2k1 repos~3.3kAutomated safety check: PassMIT

Similar skills

  • Rust Async Patterns

    diodeme/Gold-Band

    Master Rust async programming with Tokio, async traits, error handling, and concurrent patterns.

    143 GitHub starsUsed in 10 repos~3.1k tokens
    DevelopmentAuto-check passed
  • Rust Engineer

    farm-fe/farm

    Writes, reviews, and debugs idiomatic Rust code with memory safety and zero-cost abstractions.

    5.6k GitHub starsUsed in 1 repo~1.5k tokens
    DevelopmentAuto-check passed
  • Ha Android Concurrency

    home-assistant/android

    Home Assistant Android coroutine and threading guidance. An agent skill from home-assistant/android.

    4k GitHub stars~1k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Windmill Rust Backend Patterns

    windmill-labs/windmill

    Sets Rust conventions for the Windmill backend: error types, SQLx queries, JSON handling, async rules, module layout and rust-analyzer navigation.

    18k GitHub stars~869 tokensUpdated today
    DevelopmentAuto-check passed
  • Akka.NET Best Practices

    Aaronontheweb/dotnet-skills

    Guidance for Akka.NET actor systems covering EventStream versus DistributedPubSub, supervision, Props versus DependencyResolver, work distribution and testable cluster code.

    1.2k GitHub starsUsed in 1 repo~3.3k tokens
    DevelopmentAuto-check passed
  • Python Patterns for agent-core

    openJiuwen-ai/agent-core

    Reference for idiomatic Python in the agent-core codebase: immutability, protocols, exception hierarchies, context managers and async patterns.

    446 GitHub stars~2.1k tokensUpdated today
    DevelopmentAuto-check passed

More from davila7/claude-code-templates

All 479 skills in this repo
  • Perplexity Web Search

    davila7/claude-code-templates

    Runs web-grounded searches through Perplexity's Sonar models over OpenRouter for current events, recent literature and cited facts beyond the model's training cutoff.

    33k GitHub starsUsed in 11 repos~3.5k tokens
    Auto-check: notes
  • Neuropixels Data Analysis

    davila7/claude-code-templates

    Analyzes Neuropixels recordings from SpikeGLX or Open Ephys through preprocessing, drift correction, Kilosort4 spike sorting, quality metrics and curation.

    33k GitHub starsUsed in 9 repos~2.8k tokens
    Auto-check passed
  • Scientific Venue Templates

    davila7/claude-code-templates

    Supplies LaTeX templates and formatting rules for journals, conferences, posters, and grant proposals, then can check a draft against them.

    33k GitHub starsUsed in 9 repos~5.1k tokens
    Auto-check: notes
  • Brand Voice Content Creator

    davila7/claude-code-templates

    Analyzes a brand's existing writing to lock in a consistent voice, then builds SEO blog posts and platform-specific social content around it.

    33k GitHub starsUsed in 3 repos~1.9k tokens
    Auto-check passed
  • CAPA Officer

    davila7/claude-code-templates

    Guides corrective and preventive action (CAPA) work in a quality management system, from initiation and root cause analysis through effectiveness verification.

    33k GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed
  • Fda Consultant Specialist

    davila7/claude-code-templates

    Senior FDA consultant and specialist for medical device companies including HIPAA compliance and requirement management.

    33k GitHub starsUsed in 1 repo~2.7k tokens
    Auto-check passed

Works with

Categories

Questions about Kotlin Coroutines Expert

What does Kotlin Coroutines Expert do?

Expert patterns for Kotlin Coroutines and Flow, covering structured concurrency, error handling, and testing. Kotlin Coroutines Expert is an agent skill from davila7/claude-code-templates. Expert patterns for Kotlin Coroutines and Flow, covering structured concurrency, error handling, and testing.

When should I use Kotlin Coroutines Expert?

Kotlin Coroutines Expert fits situations like: tasks that involve Error handling; tasks that involve Async programming.

How do I install Kotlin Coroutines Expert in Claude Code?

Run `npx skills add davila7/claude-code-templates --skill kotlin-coroutines-expert -a claude-code`. Or copy the skill folder (cli-tool/components/skills/development/kotlin-coroutines-expert in davila7/claude-code-templates) into .claude/skills/kotlin-coroutines-expert in your project. Claude Code loads it when a task matches its description.

How do I install Kotlin Coroutines Expert in Codex?

Run `npx skills add davila7/claude-code-templates --skill kotlin-coroutines-expert -a codex`. Or copy the skill folder (cli-tool/components/skills/development/kotlin-coroutines-expert in davila7/claude-code-templates) into .agents/skills/kotlin-coroutines-expert in your project. Codex loads it when a task matches its description.

Can I use Kotlin Coroutines Expert in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add davila7/claude-code-templates --skill kotlin-coroutines-expert -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/kotlin-coroutines-expert, .gemini/skills/kotlin-coroutines-expert, .github/skills/kotlin-coroutines-expert and .opencode/skills/kotlin-coroutines-expert in your project.

What does Kotlin Coroutines Expert need to run?

SKILL.md names no scripts, command-line tools or credentials: Kotlin Coroutines Expert is instructions for the agent only.

Does Kotlin Coroutines Expert access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Kotlin Coroutines Expert safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Kotlin Coroutines Expert use?

Kotlin Coroutines Expert is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Kotlin Coroutines Expert use?

About 763 tokens (SKILL.md is roughly 3.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Kotlin Coroutines Expert?

Skills that share tags, products or a category with Kotlin Coroutines Expert: Rust Async Patterns (diodeme/Gold-Band, 143 stars), Rust Engineer (farm-fe/farm, 5.6k stars), Ha Android Concurrency (home-assistant/android, 4k stars) and Windmill Rust Backend Patterns (windmill-labs/windmill, 18k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Kotlin Coroutines Expert?

davila7 (a GitHub user) maintains it in davila7/claude-code-templates, which has 32,552 GitHub stars. The repository holds 479 skills in this directory. The repository was last updated on October 11, 2026.

Source: davila7/claude-code-templates on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.