
Kotlin Concurrency Expert
This one tackles the messy reality of Kotlin coroutines in Android: ANRs from blocking the main thread, memory leaks from GlobalScope, zombie coroutines outliving their ViewModels, and the deprecated launchWhenStarted pattern that still haunts older codebases. It pushes you toward dispatcher injection for testability, repeatOnLifecycle for safe Flow collection, and proper CancellationException handling. The workflow is triage first, then apply the smallest fix that gets you to structured concurrency without rewriting everything. If you're debugging why your app freezes on rotation or why background work never cancels, this covers the common patterns and anti-patterns with specific before-and-after examples.
- skills.sh installs
- 684
- GitHub stars
- 1K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add new-silvermoon/awesome-android-agent-skills --skill kotlin-concurrency-expert --agent claude-codeInstalls into .claude/skills of the current project.
Files
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.
Common fixes:
Sponsors
Details
- Repository
- github.com/new-silvermoon/awesome-android-agent-skills
- Categories
- Git & Pull Requests, Code Review & Quality, AI & Agent Building, Debugging, Mobile Development, Java & JVM
- First seen
- Jun 3, 2026
More from new-silvermoon/awesome-android-agent-skills
All 17- Compose Performance Audit596
- Android Emulator Skill578
- Android Viewmodel576
- Android Coroutines569
- Android Accessibility560
- Android Data Layer531
- Android Retrofit495
- Coil Compose464
- Xml To Compose Migration451
- Compose Navigation438
- Rxjava To Coroutines Migration347
- Android Testing869
- Gradle Build Performance809
- Compose Ui760
- Android Gradle Logic738
- Android Architecture701