kotlin-concurrency-expert
Kotlin Concurrency Expert
Overview
Review and fix Kotlin Coroutines issues in Android codebases by applying structured concurrency, lifecycle safety, proper scoping, and modern best practices with minimal behavior changes.
Workflow
1. Triage the Issue
- Capture the exact error, crash, or symptom (ANR, memory leak, race condition, incorrect state).
- Check project coroutines setup:
kotlinx-coroutines-androidversion,lifecycle-runtime-ktxversion. - Identify the current scope context (
viewModelScope,lifecycleScope, custom scope, or none). - Confirm whether the code is UI-bound (
Dispatchers.Main) or intended to run off the main thread (Dispatchers.IO,Dispatchers.Default). - Verify Dispatcher injection patterns for testability.
2. Apply the Smallest Safe Fix
Prefer edits that preserve existing behavior while satisfying structured concurrency and lifecycle safety.
More from new-silvermoon/awesome-android-skills
compose-ui
Best practices for building UI with Jetpack Compose, focusing on state hoisting, detailed performance optimizations, and theming. Use this when writing or refactoring Composable functions.
3android-viewmodel
Best practices for implementing Android ViewModels, specifically focused on StateFlow for UI state and SharedFlow for one-off events.
3android-testing
Comprehensive testing strategy involving Unit, Integration, Hilt, and Screenshot tests.
2gradle-build-performance
Debug and optimize Android/Gradle build performance. Use when builds are slow, investigating CI/CD performance, analyzing build scans, or identifying compilation bottlenecks.
2android-coroutines
Authoritative rules and patterns for production-quality Kotlin Coroutines onto Android. Covers structured concurrency, lifecycle integration, and reactive streams.
2compose-navigation
Implement navigation in Jetpack Compose using Navigation Compose. Use when asked to set up navigation, pass arguments between screens, handle deep links, or structure multi-screen apps.
2