Smithery Logo
MCPsSkillsDocsPricing
Login
NewFlame, an assistant that learns and improves. Available onTelegramSlack
    pluginagentmarketplace

    kotlin-coroutines

    pluginagentmarketplace/kotlin-coroutines
    Coding
    3
    1 installs

    About

    SKILL.md

    Install

    • Telegram
      Telegram
    • Slack
      Slack
    • Claude Code
      Claude Code
    • Codex
      Codex
    • OpenClaw
      OpenClaw
    • Cursor
      Cursor
    • Amp
      Amp
    • GitHub Copilot
      GitHub Copilot
    • Gemini CLI
      Gemini CLI
    • Kilo Code
      Kilo Code
    • Junie
      Junie
    • Replit
      Replit
    • Windsurf
      Windsurf
    • Cline
      Cline
    • Continue
      Continue
    • OpenCode
      OpenCode
    • OpenHands
      OpenHands
    • Roo Code
      Roo Code
    • Augment
      Augment
    • Goose
      Goose
    • Trae
      Trae
    • Zencoder
      Zencoder
    • Antigravity
      Antigravity
    • Download skill
    ├─
    ├─
    └─
    Smithery Logo

    Give agents more agency

    Resources

    DocumentationPrivacy PolicySystem Status

    Company

    PricingAboutBlog

    Connect

    © 2026 Smithery. All rights reserved.

    About

    Kotlin coroutines - structured concurrency, Flows, exception handling

    SKILL.md

    Kotlin Coroutines Skill

    Master asynchronous programming with structured concurrency.

    Topics Covered

    Structured Concurrency

    // ✅ Structured - cancellation propagates
    class Repository(private val scope: CoroutineScope) {
        suspend fun load() = withContext(Dispatchers.IO) { fetch() }
    }
    
    // ❌ Avoid GlobalScope
    GlobalScope.launch { /* leaks */ }
    

    Exception Handling

    suspend fun loadData() = supervisorScope {
        val a = async { fetchA() }
        val b = async { fetchB() }
        Result(a.awaitOrNull(), b.awaitOrNull())
    }
    
    // Never swallow CancellationException
    catch (e: Exception) {
        if (e is CancellationException) throw e
    }
    

    Testing

    @Test
    fun test() = runTest {
        val vm = ViewModel(testDispatcher)
        vm.load()
        advanceUntilIdle()
        assertThat(vm.state.value.data).isNotNull()
    }
    

    Troubleshooting

    Issue Resolution
    Coroutine leak Use structured scopes, not GlobalScope
    Test hangs Inject TestDispatcher, use advanceUntilIdle()

    Usage

    Skill("kotlin-coroutines")
    
    Recommended Servers
    Thoughtbox
    Thoughtbox
    ScrapeGraph AI Integration Server
    ScrapeGraph AI Integration Server
    Nimble MCP Server
    Nimble MCP Server
    Repository
    pluginagentmarketplace/custom-plugin-kotlin
    Files