Skill Wiki v0.1.0
principle @android-compose/principle-recomposition-as-source-of-truth

Recomposition As Source Of Truth

Recomposition is the source of truth, not the developer's intuitions about call frequency.…

Skill
@android-compose
Domain
android-compose
Version
0.1.0
Quality
4.0
Edges
4 out · 7 in
Tokens
221/389/389
$ prime install @android-compose/principle-recomposition-as-source-of-truth

Projection

Always in _index.xml · the agent never has to ask for this.

RecompositionAsSourceOfTruth [principle] v0.1.0

Recomposition is the runtime mechanism that keeps the UI consistent with state. When a snapshot read inside a composable changes, the runtime invalidates that scope and re-runs it. Recomposition can happen at any time, in any order, often, and may be cancelled mid-way. Code that assumes a composable runs 'once' or 'exactly when the user pressed the button' is wrong; the only contract is 'the body returns the latest projection of inputs to UI'.

Recomposition is the source of truth, not the developer's intuitions about call frequency. Design every composable so that running it 1 time, 100 times, or being aborted at line 7 all produce identical user-visible behaviour. Side effects, expensive allocations, and impure operations belong outside the composition path (effect APIs, remember, ViewModel).

Source

prime-system/examples/android-compose/primes/compiled/@android-compose/principle-recomposition-as-source-of-truth/atom.yaml

Compiled at 2026-05-10