/chrisbanes-skills:kotlin-concurrency-and-flowfrom chrisbanes-skills
Guides writing and reviewing Kotlin coroutine scope ownership, cancellation, and Flow primitives (StateFlow, SharedFlow, Channel). Helps choose sharing semantics and lifecycle boundaries for async work.
Ships in chrisbanes-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Give asynchronous work an explicit owner and lifetime, then model durable state and transient events with primitives whose delivery and replay semantics match the product contract.
launch, callback, or deferred wrapper merely for convenience.Deferred from
scope.async is still a child of that scope, even when the caller awaits it.
Retain a scope only for work owned by a separate, explicit lifecycle.Channel hands each event to one consumer; a configured
SharedFlow broadcasts to active consumers. If that consumer contract is
unknown, state both options and the decision needed before choosing one.
For a one-consumer navigation handoff that must survive a collector gap
but can lose an event after receipt, expose a bounded
Channel(Channel.BUFFERED) through receiveAsFlow(). For work that must
survive cancellation before handling completes, keep it pending until
the owner receives an acknowledgement.| Signal | Read |
|---|---|
Stored CoroutineScope, raw Thread or Executor work, init { launch }, fire-and-forget API, runBlocking, broad catch, or cancellation boundary | Structured concurrency |
StateFlow, SharedFlow, Channel, stateIn, SharingStarted, .value, state updates, sentinel values, or one-shot events | Flow state and events |
| Running Gradle to validate a change | Gradle run; never raw ./gradlew |
| Compose collection or UI effect handling | Compose state and effects |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
kotlin-coroutines, structured-concurrency, flow, stateflow, sharedflow, channel
23 skills in this plugin
/android-benchmark-comparisonUse when comparing physical Android benchmark configurations, investigating inconsistent rankings, or selecting an Android default from measured results. Do not use for code-level Compose performance diagnosis without a configuration comparison./changelogUse when updating or reviewing Unreleased changelog entries, reconciling a changelog against Git history and issue or PR evidence, or preparing changelog notes for a specified release./compose-animationsUse when writing or reviewing Jetpack Compose motion: visibility enter/exit, animating one property toward a target, color or size transitions, multiple properties from one state, switching composable content, or choosing between AnimatedVisibility, animate*AsState, updateTransition, rememberTransition, AnimatedContent, and Crossfade.npx claudepluginhub chrisbanes/skills --plugin chrisbanes-skillsOther plugins' skills for the same job