/master-skills-qa-testing:kotlin-coroutines-expertfrom master-skills-qa-testing
Expert patterns for Kotlin Coroutines and Flow, covering structured concurrency, error handling, and testing. Useful when implementing async operations or debugging coroutine issues.
Ships in master-skills-qa-testing. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A guide to mastering asynchronous programming with Kotlin Coroutines. Covers advanced topics like structured concurrency, Flow transformations, exception handling, and testing strategies.
Flow.Always launch coroutines within a defined CoroutineScope. Use coroutineScope or supervisorScope to group concurrent tasks.
suspend fun loadDashboardData(): DashboardData = coroutineScope {
val userDeferred = async { userRepo.getUser() }
val settingsDeferred = async { settingsRepo.getSettings() }
DashboardData(
user = userDeferred.await(),
settings = settingsDeferred.await()
)
}
Use CoroutineExceptionHandler for top-level scopes, but rely on try-catch within suspending functions for granular control.
val handler = CoroutineExceptionHandler { _, exception ->
println("Caught $exception")
}
viewModelScope.launch(handler) {
try {
riskyOperation()
} catch (e: IOException) {
// Handle network error specifically
}
}
Use StateFlow for state that needs to be retained, and SharedFlow for events.
// 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()
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
}
Dispatchers.IO for blocking I/O operations.ViewModel.onCleared).TestScope and runTest for unit testing coroutines.GlobalScope. It breaks structured concurrency and can lead to leaks.CancellationException unless you rethrow it.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.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
kotlin-coroutines, structured-concurrency, flow, error-handling, testing
npx claudepluginhub sinhoneyy/master-skills --plugin master-skills-qa-testing53 skills in this plugin
/active-directory-attacksProvide comprehensive techniques for attacking Microsoft Active Directory environments. Covers reconnaissance, credential harvesting, Kerberos attacks, lateral movement, privilege escalation, and domain dominance for red team operations and penetration testing./ai-mdConvert human-written CLAUDE.md into AI-native structured-label format. Battle-tested across 4 models. Same rules, fewer tokens, higher compliance./android_ui_verificationAutomated end-to-end UI testing and verification on an Android Emulator using ADB./backtesting-frameworksBuild robust, production-grade backtesting systems that avoid common pitfalls and produce reliable strategy performance estimates./bash-scriptingBash scripting workflow for creating production-ready shell scripts with defensive patterns, error handling, and testing./bats-testing-patternsMaster Bash Automated Testing System (Bats) for comprehensive shell script testing. Use when writing tests for shell scripts, CI/CD pipelines, or requiring test-driven development of shell utilities.22 plugins in 12 repositories ship this exact skill · first indexed Jun 3, 2026
Showing 6 of 22 plugins, one per repository first
Other plugins' skills for the same job