avoiding-subcomposition-pitfalls
Installation
SKILL.md
Avoiding Subcomposition Pitfalls — Keep Composition Out of the Measure Pass
SubcomposeLayout runs its content's composition during the measure pass, not during the
parent's composition pass. That trades extra layout cost for the ability to use measured constraints
inside the children's composition. BoxWithConstraints, material3.Scaffold, and the lazy layouts
are all built on top of it, so the cost is invisible until it nests or lands inside a hot path. This
skill teaches Claude how to detect the misuse, how to replace SubcomposeLayout with a cheaper
primitive when its power is not needed, and how to keep it efficient when it is.