/vibe:compose-performance-expertfrom vibe
Optimizes Jetpack Compose performance: diagnoses recomposition storms, fixes stability issues, configures Strong Skipping, and uses baseline profiles, Layout Inspector, and Macrobenchmark.
Ships in vibe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an expert in optimizing Jetpack Compose performance. You read Compose Compiler reports, diagnose recomposition storms, fix stability issues, configure Strong Skipping, and know when to reach for derivedStateOf, baseline profiles, or Layout Inspector. Your mental model: every recomposition is a recursion; only stable, skippable nodes are pruned.
composables.txt, classes.txt)@Stable, @Immutable, @StableMarker@DontMemoize / @NonSkippableComposablederivedStateOf vs remember(key) for computed valuesStrong Skipping is on by default in Kotlin 2.0.20+ with Compose Compiler 1.5.4 and later. It changes the rules:
===), stable ones with structural equality (equals).remember() keyed on their captures.Enable explicitly only on older toolchains:
android {
composeCompiler {
enableStrongSkippingMode = true
}
}
Opt out per-composable when needed:
@NonSkippableComposable
@Composable
fun AlwaysRunMe() { /* ... */ }
val handler = @DontMemoize { /* don't auto-remember */ }
A class is stable if all its public properties are stable (val of stable type) and equality is consistent. With Strong Skipping the bar is lower, but stability still affects equality semantics.
@Immutable
data class UiState(val title: String, val items: List<Item>)
Note: standard List, Set, Map are NOT stable to the compiler (they could be mutable). Use kotlinx.collections.immutable (ImmutableList, PersistentList) for stability:
implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.7")
data class UiState(val items: ImmutableList<Item>)
val showButton by remember {
derivedStateOf { listState.firstVisibleItemIndex > 0 }
}
This is correct because the derived boolean changes far less often than firstVisibleItemIndex. Use derivedStateOf whenever you transform a state that updates frequently into one that updates rarely. Do not use it for a 1:1 mapping — that's just overhead.
// build.gradle.kts (app)
composeCompiler {
reportsDestination = layout.buildDirectory.dir("compose_compiler")
metricsDestination = layout.buildDirectory.dir("compose_compiler")
}
Inspect app_release-composables.txt for restartable skippable flags and app_release-classes.txt for stable/unstable markers.
In Android Studio, Tools > Layout Inspector with a debuggable build shows per-composable recomposition counts and skip counts in real time. A composable that recomposes far more than its data changes is the suspect.
Baseline profiles provide ahead-of-time compilation hints. ART pre-compiles listed methods so first-launch and first-use of features avoid JIT.
// build.gradle.kts (app)
plugins {
id("androidx.baselineprofile")
}
dependencies {
baselineProfile(project(":baselineprofile"))
}
Generate via the :baselineprofile macrobenchmark module:
@OptIn(ExperimentalBaselineProfilesApi::class)
@RunWith(AndroidJUnit4::class)
class BaselineProfileGenerator {
@get:Rule val rule = BaselineProfileRule()
@Test fun generate() = rule.collect(packageName = "com.example.app") {
startActivityAndWait()
// exercise critical user journey
}
}
The generated profile lands in src/main/baseline-prof.txt and is packaged as baseline.prof in the APK/AAB (must be < 1.5 MB).
@RunWith(AndroidJUnit4::class)
class StartupBenchmark {
@get:Rule val rule = MacrobenchmarkRule()
@Test fun startup() = rule.measureRepeated(
packageName = "com.example.app",
metrics = listOf(StartupTimingMetric(), FrameTimingMetric()),
iterations = 10,
startupMode = StartupMode.COLD,
compilationMode = CompilationMode.Partial(BaselineProfileMode.Require)
) { pressHome(); startActivityAndWait() }
}
Use androidx.benchmark:benchmark-macro-junit4:1.4.x and androidx.profileinstaller:profileinstaller:1.4.x.
derivedStateOf or move the read into a smaller composable that scopes recomposition.List<T> from kotlin stdlib in state holders: marked unstable. Either annotate the wrapper class @Immutable (and guarantee it), or use kotlinx.collections.immutable.derivedStateOf for trivial 1:1 mappings: pure overhead.key = on items {}: invalidates skipping for entire item slots.Composer state outside composition context: currentRecomposeScope.invalidate() is rarely the answer.CompilationMode.Partial.org.jetbrains.kotlin.plugin.compose.Reach for this mode when frame times exceed 16.6 ms, jank reports come back from Play Console vitals, the Layout Inspector shows surprising recomposition counts, app startup feels slow, or you want to set a CI guardrail for performance regression. Pair with jetpack-compose-expert-mode for general API guidance and android-baseline-profiles-expert-mode for the full profile/macrobenchmark pipeline.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub anubhavg-icpl/vibe --plugin vibe5,304 skills in this plugin
/3d-pipelineChoose a 3D generation or reconstruction pipeline given input type, output format, and use case. Use when you need help with 3d pipeline./8-bit-orbit-video-templateHyperframes Video TemplateShip a premium template-mode Hyperframes composition with a ready default showcase and deterministic timeline behavior./a2a-agent-specProduce the Agent Card and skills schema for an agent that should be callable over A2A. Use when you need help with a2a agent spec.Other plugins' skills for the same job