/android-performance:android-performancefrom android-performance
Sets up Android Macrobenchmark and Baseline Profile work and app size reduction. Use for "add a baseline profile for startup", "cold start regressed between two CI runs", writing a startup benchmark, checking the profile is installed, or "why is the release APK so big". Covers StartupTimingMetric, CompilationMode, the androidx.baselineprofile plugin, BaselineProfileRule, reportFullyDrawn and APK Analyzer.
Ships in android-performance. 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.
Read when SKILL.md points to them.
Measure on a build that matches what ships, change one thing, measure again, and report what was and was not measured.
Not for (the android-skills: names are the third-party android-skills plugin, if installed): Perfetto and system traces, heap and memory, startup trace analysis (android-skills:android-profiler), ANRs (android-skills:anr-audit-and-fix), Compose recomposition and stability (android-skills:jetpack-compose-performance), R8 keep rules and code shrinking (android-skills:r8-analyzer), and unit or UI test setup (android-testing).
com.android.test module with androidx.benchmark.macro (Macrobenchmark), one applying androidx.baselineprofile (the profile producer), and the app module that consumes the profile. Read gradle/libs.versions.toml for the AndroidX Benchmark version; the baselineprofile plugin and benchmark-macro-junit4 are released together.benchmark, initialised from release, signed with the debug key), not debug.adb devices must list a physical device; an emulator gives numbers that say nothing about users. Without one, you can write the code and the Gradle wiring but cannot claim any timing. With several attached, pin one with ANDROID_SERIAL=<serial> for every Gradle and adb command, and name the device in the report.baseline-prof.txt under app/src/main/, generated/baselineProfiles/, or profileinstaller in dependencies.androidx.benchmark.suppressErrors to get a number. Macrobenchmark refuses debuggable apps, emulators and low battery for a reason; fix the setup instead.com.android.test plugin, targetProjectPath set to the app, and a benchmark build type that falls back to the app's release. Details and a rule skeleton are in references/macrobenchmark.md.StartupTimingMetric (time to initial display, plus time to full display once the app calls reportFullyDrawn). Scrolling and animation: FrameTimingMetric. Use a StartupMode of COLD for startup claims.None is the worst case with no profile, Partial uses the shipped baseline profile, Full is the best case with everything ahead-of-time compiled. A startup claim compares None against Partial.measureBlock, with a fixed scenario and setupBlock that resets state.androidx.baselineprofile in the producer module and the app, point the app at the producer with the baselineProfile configuration, and write a generator with BaselineProfileRule.collect. references/baseline-profiles.md has the wiring and the generate command.assets/dexopt/baseline.prof, the device compiled it (speed-profile), and a Partial benchmark beats None. Without that comparison the profile is unproven.reportFullyDrawn() in the Activity, or ReportDrawnWhen in Compose, marks the point where the content users came for is shown. Call it once the data the first screen needs is on screen, not at onCreate. Without it the time-to-full-display metric is missing. The macrobenchmark and the profile both improve when this is honest.
references/macrobenchmark.md shows where the JSON lands and what to read.Measure first, then cut the largest contributor: references/size.md covers APK Analyzer and apkanalyzer, download size vs install size, resource shrinking, native libraries and ABIs, and the order to attack them. Code shrinking itself goes to android-skills:r8-analyzer.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub adminhead/claude-plugins --plugin android-performance