# Jetpack Compose Performance

Diagnose and optimize Android Jetpack Compose UI code.

- Repository: https://github.com/android/skills (10219 stars)
- Category: Design
- License: Complete terms in LICENSE.txt
- Last updated: 2026-10-29
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add android/skills --skill jetpack-compose-performance -g -a claude-code -y`
Codex: `npx skills add android/skills --skill jetpack-compose-performance -g -a codex -y`
Cursor: `npx skills add android/skills --skill jetpack-compose-performance -g -a cursor -y`
Gemini CLI: `npx skills add android/skills --skill jetpack-compose-performance -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add android/skills`

## Description

Diagnose and optimize Android Jetpack Compose UI code. Use this skill when analyzing performance bottlenecks of existing code to minimize recomposition overhead and prevent dropped frames and UI lag.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

## Foundational prerequisites

Before micro-optimizing composables, ensure standard production flags are in
place:

1. **Release Build**: Never profile or benchmark debuggable builds; ART runtime verification severely degrades performance.
2. **R8 Minification**: Keep R8 enabled to optimize bytecode and coroutine dispatch.
3. **Baseline Profiles**: Generate baseline profiles for critical user journeys (cold start, key scrolling feeds) so the ART VM pre-compiles and preloads classes ahead of time.

## Optimization audit workflow

1. **Exhaustive Scan** : Scan the target code against all 7 core categories in the following sections. Evaluate every `@Composable` function, modifier chain, and lazy-layout data model against all checklist rules rather than stopping after the first issue found.
2. **Mandatory Reference Read Before Flagging or Editing** : Whenever a file matches a rule in Categories 1--7, you **MUST** open and read the corresponding `references/*.md` file for the approved fix pattern and full scope guards **before** reporting a finding or editing code. Never rely on the summary bullets alone to write fixes.

## 1. State, snapshots, and stability ([references/state-and-stability.md](references/state-and-stability.md))

**MANDATORY** : Before flagging or fixing any issue in this category, you
**MUST** read [references/state-and-stability.md](references/state-and-stability.md).

The rest: https://github.com/android/skills/blob/HEAD/jetpack-compose/jetpack-compose-performance/SKILL.md
