r8-analyzer

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

1|Updated Jul 6, 2026
One-click install
npx skills add https://github.com/citytexi/team-yg-pesonal-agent --skill r8-analyzer-citytexi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: r8-analyzer
Source: https://github.com/citytexi/team-yg-pesonal-agent/tree/main/.claude/skills/r8-analyzer
Command: npx skills add https://github.com/citytexi/team-yg-pesonal-agent --skill r8-analyzer-citytexi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires protobuf, and includes references (resource) components.

What problem does it solve? Android apps often accumulate redundant or overly broad ProGuard/R8 keep rules that block code shrinking, obfuscation, and optimization, inflating app size. This Skill audits your build configuration and keep rules to pinpoint exactly which rules to remove or refine. ## Core Features & Use Cases - Quantitative analysis: On R8 9.3.7-dev or later, runs the R8 Configuration Analyzer to generate optimization, shrinking, and obfuscation scores plus per-rule impact metrics. - Heuristic evaluation: On older R8 versions, manually inspects proguard-rules.pro against known redundant library rules (Gson, Retrofit, Room, Coroutines) and a keep-rule impact hierarchy. - Structured report: Outputs a strict Markdown report covering configuration issues, global disable rules, optimization scores, keep rule evaluation, and subsumed rules. - Use Case: A developer notices their release APK is larger than expected and runs this Skill to discover that a package-wide -keep class com.example.** { *; } rule is preventing optimization of 30% of the codebase. ## Quick Start Analyze my Android project's R8 and ProGuard keep rules and tell me which ones to remove or refine to reduce app size.

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?▼

Run an R8 keep rule analysis that compares your proguard-rules.pro against rules already bundled in libraries like Gson, Retrofit, Room, and Kotlin Coroutines. Rules targeting androidx, kotlin, or kotlinx packages are usually redundant and can be deleted.

How to reduce Android app size with R8 optimization?▼

Enable minification and resource shrinking in your release build, use proguard-android-optimize.txt, remove android.enableR8.fullMode=false, and refine broad keep rules. Package-wide rules like -keep class com.example.** { *; } prevent the most optimization and should be narrowed.

What is the R8 Configuration Analyzer and which version do I need?▼

The R8 Configuration Analyzer generates quantitative reports showing optimization, shrinking, and obfuscation scores plus per-rule impact metrics. It requires R8 version 9.3.7-dev or later, available from AGP 9.3.0-alpha05, along with Python and the protobuf package.

Does Retrofit still need manual ProGuard rules?▼

No. Retrofit 2.9.0 and higher bundles consumer keep rules that automatically preserve interfaces annotated with @GET, @POST, and other HTTP annotations. Manual rules for retrofit2.** packages are redundant and harm shrinking.

Why does a package-wide keep rule hurt R8 optimization?▼

A rule like -keep class com.example.package.** { *; } prevents shrinking, obfuscation, and optimization of every class and member in that package and its subpackages. The higher the package level, the more of your codebase R8 cannot optimize.

Can I use this analysis with older AGP or R8 versions?▼

Yes. When R8 is older than 9.3.7-dev, the analysis falls back to heuristic evaluation: manually inspecting proguard-rules.pro against known redundant library rules and a keep-rule impact hierarchy, then suggesting removals or refinements.