移动开发

kotlin-concurrency-expert

new-silvermoon/…t-skills

Kotlin Coroutines review and remediation for Android. Use when asked to review concurrency usage, fix coroutine-related bugs, improve thread safety, or resolve lifecycle issues in Kotlin/Android code.

  • 663 次安装
  • 992 星标
  • 收录于

安装命令

npx skills add https://github.com/new-silvermoon/awesome-android-agent-skills --skill kotlin-concurrency-expert

SKILL.md

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-android version, lifecycle-runtime-ktx version.
  • 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.