# /jetpack-compose-performance: Find and fix the Compose code that drops frames

Source: https://trendhub.net/skills/android-skills/jetpack-compose-performance
Skill folder: https://github.com/android/skills/tree/main/jetpack-compose/jetpack-compose-performance
Pack: Android Skills (https://trendhub.net/skills/android-skills)
Works with: Android CLI (detected agents), Claude Code, Codex

jetpack-compose-performance has the agent audit composables against seven categories: state and stability, layouts, lazy lists, animation, effects and threading, graphics, and custom modifiers. It must read the matching reference file before flagging or editing anything, and it pushes back on common folklore, such as adding stability annotations to collection models, in favour of cheaper composables and deferred state reads.

## When to use it

- A scrolling feed or animation stutters on real devices.
- You want a structured performance review of Compose code before release.
- Someone proposes adding Immutable annotations everywhere and you want a second opinion.

## How it works

1. **Check the basics**: The agent confirms profiling happens on release builds with R8 on and baseline profiles generated for key journeys.
2. **Scan everything**: Every composable, modifier chain and lazy list model is checked against all seven categories rather than stopping at the first issue.
3. **Read before fixing**: For any matching rule it opens the category's reference file to get the approved fix pattern and its scope limits.
4. **Apply targeted fixes**: Typical fixes defer fast-changing reads into layout or draw lambdas, add keys and content types to lazy items and move heavy work off the main thread.

## What it steers the agent away from

- Adding Stable, Immutable or ImmutableList to models that hold collections.
- Triggering impression analytics from effects inside pre-fetched lazy items.
- Benchmarking debuggable builds.

## What it can touch

It reads and edits Kotlin Compose code in your project and relies on its own reference files for each fix pattern.

## Pairs well with

- `/anr-audit-and-fix`
- `/r8-analyzer`
- `/android-profiler`

## Questions

### Does it tell me to chase recomposition counts?

No. It says skipping is not free and focuses on making composables cheap and verifying with benchmarks.

### Does it cover Modifier.Node?

Yes. One category covers migrating Modifier.composed modifiers to Modifier.Node implementations.
