Agent skill · Android Skills
/r8-analyzer Find redundant and overly broad R8 keep rules
r8-analyzer reviews how an Android app configures R8 and which keep rules are hurting shrinking. Depending on the AGP version it either runs the built-in configuration analyzer task or a temporary newer R8 build, converts the report with bundled Python scripts, and returns a strict Markdown report on broad, redundant or subsumed rules. It does not change project code.
Works with
- Android CLI
- Claude Code
- Codex
Used forAndroid, Expo and React Native
When to use it
- Your APK or AAB is larger than expected and you suspect keep rules.
- You inherited a ProGuard file full of package-wide keep rules.
- You want to know whether your app overrides library consumer rules.
How it works
- 1Check configuration
The agent inspects Gradle files and gradle.properties for missing optimisations and suggests AGP 9.3 when the project is older.
- 2Choose a path
On AGP 9.3 or later it runs the analyze R8 config Gradle task; on older versions it temporarily pins a newer R8 in settings to produce the report.
- 3Convert and analyse
Bundled Python scripts, which need the protobuf package, turn the report into JSON and compute scores and rule impact.
- 4Report only
The final reply is the Markdown report in the prescribed format, listing affected rules with their impact and remediation guidance.
What it steers the agent away from
- Editing project files beyond the temporary, reverted R8 pin.
- Printing placeholder scores when data is missing.
- Padding the report with general R8 explanations or next-step chatter.
Install this skill
It installs with the Android Skills pack.
Android CLI (detected agents)--all installs every skill for each detected agent (Gemini and Antigravity if none are found), while --project puts one skill in a given folder.
android skills add --all
android skills add r8-analyzer --project=.
android skills update --allClaude CodeInstalls the collection as a Claude Code plugin.
/plugin marketplace add android/skills
/plugin install android-skills@android-skillsCodexInstalls the collection as a Codex plugin.
codex plugin marketplace add android/skills
codex plugin add android-skills@android-skillsCommands come from the author’s README; check it for changes before you run them.
Questions
What do I need installed?
Python with protobuf 6.33.4 or later, plus an app module with an R8-enabled variant such as release.
What if I refuse the settings change on older AGP?
The agent still reports rule-level and build file findings, but without scores, and says why.
More guides from Android Skills
/android-cliLet the agent drive Android devices with the android CLITeaches the agent the android command line for projects, SDK packages, emulators, UI dumps, screenshots, docs and journey tests.Read the guide →/jetpack-compose-performanceFind and fix the Compose code that drops framesAudits Compose code for recomposition, layout, lazy list, animation, effect and drawing costs that cause dropped frames.Read the guide →/migrate-xml-views-to-jetpack-composeConvert one XML layout to Compose with visual parityMoves one XML layout to Compose in ten steps, from a baseline screenshot to visual parity checks and XML removal.Read the guide →/play-billing-library-version-upgradeUpgrade Play Billing Library without missing breaking changesUpgrades Play Billing Library to the latest stable release, in two-version steps when the app is far behind.Read the guide →/edge-to-edgeMake a Compose app edge-to-edge without hidden buttonsMakes every Activity in a Compose app edge-to-edge and fixes insets, keyboard overlap and system bar legibility.Read the guide →/testing-setupSet up a complete testing strategy for an Android appAssesses an app's test setup, then adds dependency injection for tests, unit, UI, screenshot and end-to-end tests and coverage.Read the guide →
Also in this pack
/cameraxGuides CameraX work such as preview, capture and recording lifecycles, Camera2 interop and ML Kit or Media3 effects.↗/android-for-cars-parked-appsAdapts video, game and browser apps to run while parked on Android Auto and Automotive OS within car app quality rules.↗/appfunctionsFinds app workflows worth exposing as AppFunctions and generates the Kotlin code and KDoc so agents and shortcuts can call them.↗/ml-kit-genai-prompt-apiAdds the ML Kit GenAI Prompt API for on-device Gemini Nano requests, with structured output and prefix caching.↗/mlkit-agent-apiBuilds on-device agent loops with the ML Kit GenAI Agent API, AgentSession chat and AppFunctions tool calling.↗/restore-credentialsImplements Restore Credentials with Credential Manager so users are signed back in silently on a new device.↗/verified-emailAdds OTP-free verified email retrieval through Credential Manager digital credentials during sign-up.↗/ink-app-builderAdds stylus and touch drawing with Jetpack Ink, including stock brushes, erasing, undo and redo and Room persistence.↗/ink-custom-brush-builderWrites custom Jetpack Ink BrushFamily definitions with tip shapes, input behaviours, layered coats and textures.↗/adaptiveMakes Compose UIs adapt to phones, tablets, foldables, desktop, TV and XR, keeping state across configuration changes.↗/litert-lmBuilds an Android chat, summary or extraction feature on an on-device open LLM via LiteRT-LM, from model download to streamed Compose UI.↗/litert-runtimeSets up .tflite inference with the LiteRT CompiledModel API on CPU or GPU, including migration from the old Interpreter.↗
Summary by trendhub. The skill itself lives in android/skills/performance/r8-analyzer by Android (Apache-2.0); read the full, current text there.