Agent Skills
› chrisbanes/skills
› compose-performance
compose-performance
GitHub针对 Jetpack Compose 性能问题的分析技能,涵盖重组成本、编译器报告及帧率优化。指导通过复现过渡、分类问题轴并逐步修正来提升性能。
Trigger Scenarios
调查 Jetpack Compose 重组成本
分析编译器稳定性报告
解决 skippability 问题
优化不稳定参数导致的性能下降
处理 State reads 帧率问题
Install
npx skills add chrisbanes/skills --skill compose-performance -g -y
SKILL.md
Frontmatter
{
"name": "compose-performance",
"description": "Use when investigating Jetpack Compose recomposition cost, compiler stability reports, skippability, unstable parameters, frame-rate State reads, cross-phase snapshot back-writing, or @ReadOnlyComposable contracts."
}
Compose performance
Core principle
Measure one user-visible transition, identify the runtime axis that causes the work, then apply the smallest correction at the phase or boundary where that axis begins.
Procedure
- Reproduce one concrete transition and capture the observable evidence: recomposition counts, compiler reports, profiler data, or a clear trace.
- Classify the primary axis: parameter stability and skipping, State read phase, or snapshot state written back into an earlier phase.
- Check for a false lead: a real data change, a correctness defect, or an unchanged lazy item that is expected to recompose.
- Read the corresponding focused reference before proposing a change.
- Change one axis at a time and re-measure the same transition.
- Finish when the evidence improves at the observed boundary without hiding state changes, caching stale values, or moving work to a less correct owner.
Topic router
| Signal | Read |
|---|---|
| Cause is unknown, or several axes may interact | Diagnosis |
classes.txt, composables.txt, strong skipping, unstable parameters, or collection stability |
Stability |
| Scroll, animation, gesture, layout, or draw State read at frame rate; measured state fed back into composition | Deferred reads |
| A composable only reads composition locals or accessor-style values | Composition contracts |
| State ownership or effect lifecycle is the root cause | Compose state and effects |
RED/GREEN agent scenarios
- RED blames unstable parameters for unchanged lazy rows that recompose during a focus transition. GREEN checks composition and layout back-writing first.
- Novel case: an animation value controls only drawing. GREEN reads the State in a draw or layout lambda instead of propagating it through composition.
- Counterexample: a screen visibly recomposes because its displayed model actually changed. GREEN does not add stability wrappers or caches merely to lower a count.
Version History
- 2026.8.5 Current 2026-08-16 02:44


