Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

compose-state-and-effects

БесплатноБез исполняемых скриптовНе проверен

Use when writing or reviewing Jetpack Compose state ownership, remember state, state hoisting, screen state holders, LaunchedEffect, DisposableEffect…

chrisbanesот chrisbanes★ 1 172 звезды на GitHub

Об этом скилле

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

  1. 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. In a focused contract or correctness review, a missing provider, owner, or writer that the code never needs is at most a noted risk; do not recommend ownership, default-value, or API-surface changes for it, even as optional.
  2. Inventory mutable UI state, app state, event streams, app dependencies, and imperative work in the affected screen or component.
  3. Place each state value at its lowest necessary owner: local UI state, hoisted state, a plain UI state holder, or a screen state holder.
  4. 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 @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.
  5. Choose an effect API whose lifecycle matches the work, and key it by the semantic input that should restart or dispose it.
  6. Load the focused reference for every material concern below. Do not use a reference merely because its topic is adjacent.
  7. Route frame-rate reads, cross-phase back-writing, and @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.
  8. In an ownership review, name the owner and boundary for each concrete concern. Keep durable screen data in its state holder and say how the composable observes and renders it. Keep UI runtime objects such as 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.
  9. 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
Полный SKILL.md на GitHub

Установить compose-state-and-effects в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/local-state.mdreferences/side-effects.mdreferences/state-hoisting.md

FAQ

Что делает скилл compose-state-and-effects?

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.

Как установить скилл compose-state-and-effects?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл compose-state-and-effects запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить compose-state-and-effects с