What problem does it solve?
This skill helps Android teams improve the reliability of Kotlin coroutines by auditing and remediating improper scope usage, poor lifecycle handling, and potential race conditions that can cause UI freezes or leaks.
Core Features & Use Cases
- Review coroutine scope usage (viewModelScope, lifecycleScope, and custom scopes) to identify unstructured concurrency patterns.
- Propose and apply fixes to enforce structured concurrency, proper dispatcher usage, and safe cancellation handling.
- Provide remediation guidance for common UI and background tasks, including network I/O, disk I/O, and long-running operations, with code-review examples.
- Improve testability by advocating injectable dispatchers and test-friendly scoping strategies.
Quick Start
Run a quick code-review pass to locate GlobalScope launches, then refactor to viewModelScope or lifecycleScope, moving heavy work to withContext(Dispatchers.IO) and replacing launchWhenStarted with repeatOnLifecycle.