mcpbeat

Android Concurrency

hoangnguyen0403/android-concurrency

Write correct coroutine scopes, lifecycle collection, and dispatcher injection in Android production code. Use for suspend functions, coroutine scopes, and dispatcher mechanics; defer ViewModel StateFlow/LiveData architecture, Fragment lifecycle recipes, persistence/notifications, and unit-test recipes to their specific skills.

1k tokens
context cost
the whole folder, loaded on every use
3
files
instructions only
0
copies elsewhere
how many repositories repackaged it
536
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/HoangNguyen0403/agent-skills-standard --skill android-concurrency

What comes with it

4 333 bytes besides the instruction
evals/evals.json
references/implementation.md

The instruction itself

8 sections, as written by the author

Android Concurrency Standards

Priority: P0 (CRITICAL)

Implementation Guidelines

Structured Concurrency

  • Scopes: Always use viewModelScope (VM) or lifecycleScope (Activity/Fragment).
  • Dispatchers: INJECT Dispatchers (DispatcherProvider) for testability. not hardcode Dispatchers.IO.

Flow usage

  • Cold Streams: Use Flow for data streams.
  • Hot Streams: Use StateFlow (State) or SharedFlow (Events).
  • Replay: Use SharedFlow with replay only when late subscribers must receive recent events.
  • Collection: Use collectAsStateWithLifecycle() (Compose) or repeatOnLifecycle (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

  • Dispatcher Pattern

Canonical response anchors

  • Additional task-grounded exact anchors: hardcode

How to use it

Copy the folder

Take hoangnguyen0403/android-concurrency from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.