Android concurrency
Skill ComeOnOliver/skillshub/skills/HoangNguyen0403/agent-skills-standard/android-concurrency
Standards for Coroutines, Flow, and Threading. Use when writing suspend functions, choosing coroutine scopes, switching between StateFlow and SharedFlow, injecting Dispatchers for testability, or debugging threading issues in Android. (triggers: **/*ViewModel.kt, **/*UseCase.kt, **/*Repository.kt, suspend, viewModelScope, lifecycleScope, Flow, coroutine, Dispatcher, DispatcherProvider, GlobalScope)From its SKILL.md
npx -y skills add ComeOnOliver/skillshub --skill android-concurrencyAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
1.2 KB, 193 tokens by cl100k_base, as published. Nobody here has run it
Android Concurrency Standards
Priority: P0
Implementation Guidelines
Structured Concurrency
- Scopes: Always use
viewModelScope(VM) orlifecycleScope(Activity/Fragment). - Dispatchers: INJECT Dispatchers (
DispatcherProvider) for testability. Do not hardcodeDispatchers.IO.
Flow usage
- Cold Streams: Use
Flowfor data streams. - Hot Streams: Use
StateFlow(State) orSharedFlow(Events). - Collection: Use
collectAsStateWithLifecycle()(Compose) orrepeatOnLifecycle(Views).
Anti-Patterns
- No GlobalScope: Use viewModelScope or lifecycleScope — never GlobalScope.
- No async/await by default: Prefer simple suspend functions; async only for parallel calls.
References
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.