Skill / SKILL.md

Avoiding Subcomposition Pitfalls

skydoves/compose-performance-skills

Use this skill when a Compose tree uses SubcomposeLayout, BoxWithConstraints, or Scaffold and the developer reports extra measure passes, slow first frame, or layout passes running content composition repeatedly. Covers why SubcomposeLayout composes its slots during the measure phase, why BoxWithConstraints forces a subcomposition for every new Constraints value, why nesting Scaffold or BoxWithConstraints multiplies the cost, when a custom Layout or Modifier.layout { } replaces SubcomposeLayout, and how to use SubcomposeLayoutState's slot reuse policy and precompose APIs when SubcomposeLayout is genuinely required. Use when the developer mentions BoxWithConstraints, SubcomposeLayout, Scaffold, "extra measure pass", "double measurement", "first frame slow", "subcompose", or notices that wrapping content in BoxWithConstraints regresses scroll perf inside a LazyColumn.
2 views 535 repository stars 0 commentsUpdated Nov 27, 2026
Overview

Use this skill when a Compose tree uses SubcomposeLayout, BoxWithConstraints, or Scaffold and the developer reports extra measure passes, slow first frame, or layout passes running content composition repeatedly. Covers why SubcomposeLayout composes its slots during the measure phase, why BoxWithConstraints forces a subcomposition for every new Constraints value, why nesting Scaffold or BoxWithConstraints multiplies the cost, when a custom Layout or Modifier.layout { } replaces SubcomposeLayout, and how to use SubcomposeLayoutState's slot reuse policy and precompose APIs when SubcomposeLayout is genuinely required. Use when the developer mentions BoxWithConstraints, SubcomposeLayout, Scaffold, "extra measure pass", "double measurement", "first frame slow", "subcompose", or notices that wrapping content in BoxWithConstraints regresses scroll perf inside a LazyColumn.

Installation & variants

Download the repository, including the skill’s supporting files.

git clone -- 'https://github.com/skydoves/compose-performance-skills' skill-source

Use the complete skill-source/recomposition/avoiding-subcomposition-pitfalls directory with your client’s skill installer.

  • recomposition/avoiding-subcomposition-pitfalls

    main · SKILL.md

    Open installation source

    Source directory recorded from the imported repository path

Source directory recomposition/avoiding-subcomposition-pitfalls

Source instructions
Read source instructions

Open to load source instructions

Original SKILL.md

Open to load the original file

Source & validation
Source status
Awaiting source check
Format validation
Needs source review
Checked at
Pending source check
Content SHA-256
af279c5519e845a529011e43a13a818aefb3180f726d3ce07e3f74c9999d6347
Format validation findings
  • Metadata requires string values.
Agent Skills specification
Discussion
Comments Be the First to Comment

Please log in to comment

    No comments yet

Related skills