compose-performance-skills
```markdown
What this skill does
```markdown
---
name: compose-performance-skills
description: Install and use the skydoves/compose-performance-skills agent skill library to diagnose and fix Jetpack Compose performance issues including stability, recomposition, lazy layouts, modifiers, side effects, and build configuration.
triggers:
- "my composable recomposes too often"
- "LazyColumn drops frames during scroll"
- "diagnose Compose stability issues"
- "fix unnecessary recomposition in Jetpack Compose"
- "optimize Compose performance"
- "Compose unstable parameters compiler report"
- "baseline profile for Compose app"
- "install compose performance skills"
---
# Compose Performance Skills
> Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.
A curated library of Agent Skills (SKILL.md files) for Jetpack Compose performance. Each skill teaches an AI coding agent to diagnose and fix one specific Compose performance problem—stability, recomposition, lazy layouts, custom modifiers, side effects, baseline profiles, R8, and hot reload.
## What This Library Does
- **26 skills** organized into 9 categories: `stability`, `recomposition`, `lists`, `modifiers`, `side-effects`, `measurement`, `build`, `audit`, `hot-reload`
- Each `SKILL.md` is operational instructions for an LLM—terse, imperative, with RIGHT/WRONG code pairs and a verification checklist
- Skills chain together: a diagnostic skill names the fix skills it hands off to; a fix skill states which diagnostic skill produced its input
- Grounded in primary sources: Android Developers docs, Compose compiler internals, AndroidX release notes
## Installation
### Claude Code (Recommended)
```bash
# Clone to stable location
git clone https://github.com/skydoves/compose-performance-skills.git \
~/.claude/skills-sources/compose-performance-skills
# Run idempotent install script (symlinks each skill into ~/.claude/skills/<slug>/)
~/.claude/skills-sources/compose-performance-skills/scripts/install-skills.sh
```
Custom target directory:
```bash
./scripts/install-skills.sh /path/to/agent/skills
```
Uninstall:
```bash
./scripts/install-skills.sh --uninstall
```
Restart Claude Code after install. Mention a Compose performance symptom and Claude Code matches trigger vocabulary in skill frontmatter to load the relevant `SKILL.md` automatically.
### Android Studio Agent Mode / Gemini (Project-Local)
```bash
cd <your-android-project>
git clone https://github.com/skydoves/compose-performance-skills.git \
.compose-performance-skills-source
./.compose-performance-skills-source/scripts/install-skills.sh .agent/skills
```
Add `.compose-performance-skills-source/` to `.gitignore`. Update skills with `git pull` inside the source directory.
### Claude.ai / Anthropic API
Upload individual `SKILL.md` files as Agent Skill attachments in a Claude.ai workspace, or inject them into the system prompt for direct API use. Skills are self-contained Markdown—no external runtime required.
## Directory Layout
```
compose-performance-skills/
├── README.md
├── INDEX.md # symptom → skill lookup table
├── scripts/
│ └── install-skills.sh
└── <category>/<slug>/
├── SKILL.md # the skill (required)
└── references/
└── <topic>.md # supplemental material (one level deep)
```
**Categories and slugs:**
| Category | Key Skills |
|---|---|
| `stability/` | `diagnosing-compose-stability`, `stabilizing-compose-types`, `configuring-stability-config` |
| `recomposition/` | `deferring-state-reads`, `applying-derived-state-of`, `tracing-recomposition` |
| `lists/` | `optimizing-lazy-layouts`, `stable-keys-content-type`, `lazy-layout-prefetch` |
| `modifiers/` | `migrating-to-modifier-node`, `graphics-layer-animated-reads` |
| `side-effects/` | `collecting-flows-safely`, `memoizing-lambdas-strong-skipping` |
| `measurement/` | `running-macrobenchmark`, `generating-baseline-profiles` |
| `build/` | `enabling-r8-full-mode`, `enabling-strong-skipping`, `ci-stability-validation` |
| `audit/` | `end-to-end-performance-audit` |
| `hot-reload/` | `compose-hot-reload-hotswan` |
## Key Skill Workflows
### Diagnosing Stability (`stability/diagnosing-compose-stability/SKILL.md`)
Triggered by: "recomposition spike", "unstable parameters", "composable won't skip"
**What it does:**
1. Enables Compose Compiler reports in `release` build type
2. Parses `<module>-composables.txt` for `unstable` parameters
3. Chains to `stabilizing-compose-types` for the fix
```kotlin
// build.gradle.kts – enable compiler reports
android {
buildTypes {
release {
// Compose compiler metrics output
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
compilerOptions {
freeCompilerArgs.addAll(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" +
layout.buildDirectory.dir("compose_metrics").get().asFile.absolutePath,
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" +
layout.buildDirectory.dir("compose_metrics").get().asFile.absolutePath
)
}
}
```
Run the report:
```bash
./gradlew :app:assembleRelease
cat app/build/compose_metrics/app_release-composables.txt | grep "unstable"
```
### Stabilizing Compose Types (`stability/stabilizing-compose-types/SKILL.md`)
```kotlin
// WRONG – List<T> is unstable
@Composable
fun ItemList(items: List<Item>) { ... }
// RIGHT – use ImmutableList from kotlinx.collections.immutable
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.persistentListOf
@Composable
fun ItemList(items: ImmutableList<Item>) { ... }
// In ViewModel
val items: StateFlow<ImmutableList<Item>> = _items.asStateFlow()
```
```kotlin
// WRONG – data class with unstable field
data class UiState(
val items: List<Item>, // unstable
val callback: () -> Unit // unstable
)
// RIGHT – @Stable annotation + immutable collections
@Stable
data class UiState(
val items: ImmutableList<Item>,
val onItemClick: (Item) -> Unit
)
```
### Deferring State Reads (`recomposition/deferring-state-reads/SKILL.md`)
```kotlin
// WRONG – offset read triggers recomposition of the entire composable
@Composable
fun AnimatedBox(scrollState: ScrollState) {
val offset = scrollState.value // read here = recompose entire function
Box(Modifier.offset(y = offset.dp)) { ... }
}
// RIGHT – defer read into modifier lambda (layout phase only)
@Composable
fun AnimatedBox(scrollState: ScrollState) {
Box(
Modifier.offset { // read deferred to layout phase
IntOffset(0, scrollState.value)
}
) { ... }
}
// RIGHT – defer into graphicsLayer lambda (draw phase only)
@Composable
fun FadingBox(alpha: State<Float>) {
Box(
Modifier.graphicsLayer { // read deferred to draw phase
this.alpha = alpha.value
}
) { ... }
}
```
### Optimizing Lazy Layouts (`lists/optimizing-lazy-layouts/SKILL.md`)
```kotlin
// WRONG – no keys, no contentType
LazyColumn {
items(itemList) { item ->
ItemCard(item)
}
}
// RIGHT – stable keys + contentType
LazyColumn {
items(
items = itemList,
key = { item -> item.id }, // stable, unique key
contentType = { item -> item::class } // group similar items
) { item ->
ItemCard(item)
}
}
```
```kotlin
// WRONG – lambda captures unstable reference
LazyColumn {
items(items, key = { it.id }) { item ->
ItemCard(
item = item,
onClick = { viewModel.onItemClick(item) } // new lambda each recomposition
)
}
}
// RIGHT – hoist click handler, use rememberUpdatedState if needed
LazyColumn {
items(items, key = { it.id }) { item ->
ItemCard(
item = item,
onClick = remember(item.Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.