compose-state-and-effects
Skill299 starsChanged 18 days agoApache-2.0View on GitHub
Use when writing or reviewing Jetpack Compose state ownership, remember state, state hoisting, screen state holders, LaunchedEffect, DisposableEffect, SideEffect, Flow collection, navigation, snackbar, analytics, or focus requests.
2 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- maomaochong-ai/open-astraviaword for word, first seen Oct 20, 2026
- chrisbanes/skillsedited, first seen Jun 18, 2026
Other versions2 projects use a version of this.
Word for word · 1
- maomaochong-ai/open-astravia★ 53100% same
Edited · 1
- chrisbanes/skills★ 1.2k93% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository18 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- compose-component-designSkill
- design-taste-frontendSkill
- diagnoseSkill
- expo-overviewSkill
- expo-project-structureSkill
- expo-routerSkill
- find-skillsSkill
- frontend-designSkill
- grill-meSkill
- grill-with-docsSkill
- handoffSkill
- mobile-android-designSkill
- vetta-releaseSkill
- vetta-testingSkill
- web-design-guidelinesSkill
- zoom-outSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 25
Place each state value at its lowest necessary owner: local UI state, hoisted state, a plain UI state holder, or a screen state holder.
- Very specific: line 32
Keep this content callable with sample state and callbacks.
- Distinctive: line 34
Before adding it, confirm the module declares its tooling.
- Distinctive: line 47
Before responding to a screen-ownership review, verify all three screen seams in step 4 when visible code needs them.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Compose state and effects
Core principle
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.
Procedure
- Establish the requested scope and visible behavioral requirements. Treat an ownership change as a finding only when code or task evidence shows a lifecycle, testability, business, or coordination need.
- Inventory mutable UI state, app state, event streams, app dependencies, and imperative work in the affected screen or component.
- Place each state value at its lowest necessary owner: local UI state, hoisted state, a plain UI state holder, or a screen state holder.
- For a screen boundary, keep durable data and intents in the wiring owner,
Compose runtime objects in composition or a plain UI state holder, and
rendering in a previewable content composable that takes immutable state
and callbacks. Read State hoisting for the
implementation shape; naming only state and intents is not that boundary.
Keep this content callable with sample state and callbacks; an
@Previewwrapper 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. - Choose an effect API whose lifecycle matches the work, and key it by the semantic input that should restart or dispose it.
- Load the focused reference for every material concern below. Do not use a reference merely because its topic is adjacent.
- Route frame-rate reads, cross-phase back-writing, and
@ReadOnlyComposablecontracts to Compose performance. For that contract, distinguish a read of snapshotState.valuefrom an operation that changes the composer; the state read alone is not a violation. - Before responding to a screen-ownership review, verify all three screen seams in step 4 when visible code needs them.
- Finish when every state value has one owner, every effect has a justified lifecycle and key, and the UI can be previewed and tested without app dependencies. For review-only work, report no change when no evidence-backed issue remains; do not invent product requirements.
Topic router
| 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 |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

