kotlin-specialist

Implements idiomatic Kotlin code using coroutines, Flow, Compose, Ktor, and multiplatform patterns.

Updated Mar 9, 2026
One-click install
npx skills add https://github.com/ArMaTeC/Redball --skill kotlin-specialist-armatec
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: kotlin-specialist
Source: https://github.com/ArMaTeC/Redball/tree/main/.devin/skills/kotlin-specialist
Command: npx skills add https://github.com/ArMaTeC/Redball --skill kotlin-specialist-armatec

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing production-quality Kotlin requires deep knowledge of coroutines, structured concurrency, Flow streams, and platform-specific patterns across Android, server, and multiplatform targets. This Skill provides senior-level Kotlin implementation guidance so you avoid common pitfalls like blocking coroutines, leaking scopes, and breaking null safety. ## Core Features & Use Cases - Coroutines & Flow Patterns: Structured concurrency, StateFlow/SharedFlow, cancellation handling, and dispatcher management with testable code using runTest and Turbine. - Multiplatform & Framework Guidance: Kotlin Multiplatform expect/actual patterns, Jetpack Compose UI with Material3 and Hilt DI, and Ktor server setup with JWT auth and Exposed database integration. - Idiomatic Kotlin Design: Sealed classes for state modeling, type-safe DSL builders, scope functions, delegated properties, and inline/reified functions. - Use Case: You are building an Android app with a shared KMP module and need a repository layer that exposes StateFlow, handles cancellation correctly, and passes detekt/ktlint checks. ## Quick Start Ask the assistant to implement a Kotlin repository class using coroutines and Flow with proper cancellation handling and sealed class state modeling.

Frequently Asked Questions about kotlin-specialist

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use Kotlin coroutines with Flow for async operations?▼

Use suspend functions for one-shot async work and Flow for streams of values. Wrap work in coroutineScope or supervisorScope for structured concurrency, apply flowOn to set the dispatcher, and handle errors with catch and retry operators.

What is the difference between StateFlow and SharedFlow in Kotlin?▼

StateFlow always holds a current value and is ideal for UI state, while SharedFlow is for one-time events with configurable replay and buffering. Expose both as read-only interfaces using asStateFlow and asSharedFlow.

How do I share code between Android and iOS with Kotlin Multiplatform?▼

Place shared business logic in commonMain and use expect/actual declarations for platform-specific APIs like databases or platform info. Configure targets in the Gradle Kotlin Multiplatform plugin and use Ktor client for cross-platform networking.

Why should I avoid runBlocking and GlobalScope in Kotlin?▼

runBlocking blocks the calling thread and defeats the purpose of coroutines, while GlobalScope creates coroutines outside structured concurrency that leak and ignore cancellation. Use viewModelScope, lifecycleScope, or injected CoroutineScope instead.

Does Jetpack Compose work with Kotlin coroutines and ViewModel?▼

Yes, Compose integrates with viewModelScope for launching coroutines and collectAsStateWithLifecycle for observing StateFlow in composables. Use LaunchedEffect for suspend work tied to composition and DisposableEffect for cleanup.

How do I test Kotlin coroutines and Flow code?▼

Use runTest from kotlinx-coroutines-test with advanceUntilIdle to control virtual time. For Flow assertions, use Turbine's test extension to await items sequentially and verify emissions in order.