r8-analyzer

Analyzes Android build files and R8 keep rules to identify redundant or overly broad ProGuard configurations.

1|Updated Jun 9, 2026
One-click install
npx skills add https://github.com/kariemSeiam/android-claw --skill r8-analyzer-kariemseiam
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: r8-analyzer
Source: https://github.com/kariemSeiam/android-claw/tree/main/skills/installed/performance-r8-analyzer
Command: npx skills add https://github.com/kariemSeiam/android-claw --skill r8-analyzer-kariemseiam

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Android projects accumulate redundant and overly broad R8/ProGuard keep rules that disable code shrinking, obfuscation, and optimization, inflating app size. This Skill audits your build configuration and every keep rule, then tells you exactly which rules to remove or narrow. ## Core Features & Use Cases - Build Configuration Audit: Checks build.gradle, build.gradle.kts, and gradle.properties for correct minification, resource shrinking, and R8 full mode settings, with AGP version-specific recommendations. - Redundant Rule Detection: Identifies keep rules already covered by consumer rules bundled in AndroidX, Kotlin, Coroutines, Gson, Retrofit, Room, and Parcelable libraries. - Impact-Ranked Refinement: Ranks remaining keep rules by optimization impact hierarchy and suggests narrow, reflection-aware replacements for broad package wildcards. - Use Case: A developer preparing a release build runs the analysis and receives a report showing that their Gson model package keeps and Retrofit annotation rules are redundant, plus narrower replacements for a package-wide wildcard rule. ## Quick Start Analyze my project's R8 and ProGuard keep rules and tell me which ones to remove or refine.

Frequently Asked Questions about r8-analyzer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find redundant ProGuard keep rules in my Android project?▼

Audit each keep rule against the consumer rules bundled in modern libraries like AndroidX, Gson 2.11+, Retrofit 2.9+, and Coroutines 1.7+. Rules targeting these libraries, Android components, or Parcelable classes are typically redundant and can be deleted.

Which R8 keep rules hurt app size the most?▼

Package-wide wildcards like -keep class com.example.** { *; } have the highest impact, followed by inversion operators (!) and full class-plus-member keeps. These disable optimization for entire packages and should be refined to target specific classes or members.

Do I still need keep rules for Gson or Retrofit?▼

No, if you use Gson 2.11.0+ or Retrofit 2.9.0+, both bundle their own consumer ProGuard rules. For Gson, annotate fields with @SerializedName and delete manual model and TypeAdapter keep rules.

Does R8 full mode need to be enabled manually?▼

For AGP 8.0 and later, R8 full mode is enabled by default; just ensure android.enableR8.fullMode=false is not present in gradle.properties. For pre-AGP 8.0, explicitly set android.enableR8.fullMode=true.

How do I verify keep rule changes don't break my app?▼

Run UI Automator tests against the release build with minification applied, concentrating on user flows that touch packages where keep rules were removed or narrowed. UI Automator tests the app from outside its process, exercising the optimized build.