← ClaudeAtlas

compose-internalslisted

Use when writing, modifying, or reviewing Jetpack Compose UI code — @Composable functions, recomposition and skipping, Compose state (remember / MutableState), side effects in Compose (LaunchedEffect, DisposableEffect, rememberCoroutineScope, SideEffect, produceState, snapshotFlow), stability (@Stable / @Immutable), state hoisting / UDF, modifiers, declarative Compose style. Distilled from "Jetpack Compose Internals" — the rules digest is mandatory reading before any @Composable is written.
gorban-dev/gor-mobile · ★ 2 · AI & Automation · score 75
Install: claude install-skill gorban-dev/gor-mobile
# Jetpack Compose Internals — rules digest Mandatory ground rules for any code that creates or modifies a `@Composable`. Read this digest fully; open the reference file for the topic your task touches; check your shape against `examples/*.kt`. ## The 9 properties of composable functions The runtime optimizes (skipping, parallel composition, reordering, memoization) only because it can assume these properties. Code that breaks one takes the optimization down with it. 1. **Calling context** — a composable can be called only from another composable: the compiler appends an implicit `Composer` parameter and forwards it down every call; bodies use it to emit changes to the runtime. 2. **Idempotent** — re-executing with the same inputs must emit the same node tree; recomposition and skipping are built on this assumption. 3. **Free of uncontrolled side effects** — the body depends on its parameters alone; anything touching the outside world goes through an effect handler, which ties it to the composable lifecycle. 4. **Any execution order** — the runtime may run sibling composables in whatever order suits it (e.g. by priority); never let one sibling depend on another having run first. 5. **Parallel-safe** — recompositions may be offloaded to different threads to use multiple cores; bodies must tolerate concurrent execution. 6. **Restartable and reactive** — a body re-executes whenever state it read changes, any number of times; the compiler generates r