/chrisbanes-skills:compose-state-and-effectsfrom chrisbanes-skills
Guides writing and reviewing Jetpack Compose state ownership, state hoisting, screen state holders, and effects (LaunchedEffect, DisposableEffect, SideEffect). Covers Flow collection, navigation, snackbar, analytics, and focus requests.
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 every piece of UI state one lowest responsible owner, then run imperative work through the effect whose lifecycle follows that owner. Composition renders; state and effects make rendering change safely.
A screen-ownership review is incomplete until it names the plain, previewable content composable that receives immutable state and event callbacks separately from app wiring and composition-owned runtime objects.
@Preview
wrapper is optional and is not required for the state-driven boundary.
Before adding it, confirm the module declares its tooling; do not assume
Compose runtime or UI dependencies provide it. Respect the task's file
scope: do not add tooling or change build files unless authorized. If
Preview tooling is needed but unavailable within scope, omit the wrapper
and report the setup gap.@ReadOnlyComposable contracts to Compose performance.
For that contract, distinguish a read of snapshot State.value from an
operation that changes the composer; the state read alone is not a violation.LazyListState with the composition coordinating them. When moving one
of those objects out of a model, distinguish it from the durable screen
data that belongs in the model. Apply the
previewable rendering seam in step 4 where the screen needs that split.| Signal | Read |
|---|---|
Bare local var, remember { mutableStateOf(...) }, state lists/maps, or reset state | Local state |
| State shared by siblings, UI state holders, ViewModel/component wiring, or previewable screen boundaries | State hoisting |
LaunchedEffect, DisposableEffect, SideEffect, snapshotFlow, rememberCoroutineScope, rememberUpdatedState, produceState, imperative requestFocus, callbacks, event Flow collection, snackbar, navigation, or analytics | Side effects |
| Focus ownership and keyboard/TV/D-pad behavior | Compose focus navigation |
| Tests or previews for the resulting UI contract | Compose UI testing patterns |
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub chrisbanes/skills --plugin chrisbanes-skills23 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./compose-component-designUse when designing or reviewing reusable Jetpack Compose component APIs with modifier parameters, root layout placement, caller-provided variable content, primitive content parameters, optional content, or boolean shape flags./compose-focus-navigationUse when writing or reviewing Jetpack Compose UI for TV, keyboard, desktop, accessibility focus, D-pad navigation, FocusRequester, focusProperties, key events, or initial focus behavior./compose-performanceUse when investigating Jetpack Compose recomposition cost, compiler stability reports, skippability, unstable parameters, frame-rate State reads, cross-phase snapshot back-writing, or @ReadOnlyComposable contracts.Other plugins' skills for the same job