r8-analyzer

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

2|Updated Jun 21, 2026
One-click install
npx skills add https://github.com/IsKenKenYa/skills --skill r8-analyzer-iskenkenya
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r8-analyzer
Source: https://github.com/IsKenKenYa/skills/tree/main/skills/android/performance/r8-analyzer
Command: npx skills add https://github.com/IsKenKenYa/skills --skill r8-analyzer-iskenkenya

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Android apps often accumulate redundant or overly broad R8/ProGuard keep rules that block code shrinking, obfuscation, and optimization, inflating app size. This Skill audits your build configuration and keep rules, quantifies their impact, and produces a structured report with concrete removal or refinement actions. ## Core Features & Use Cases - Configuration audit: Checks build.gradle, gradle.properties, and AGP/R8 versions for missing optimizations such as full mode, minification, and resource shrinking. - Three analysis paths: Uses the standalone analyzeReleaseR8Config Gradle task (AGP >= 9.3.0), quantitative R8 Configuration Analyzer proto reports (R8 >= 9.3.7-dev), or heuristic rule evaluation for older toolchains. - Redundant rule detection: Identifies rules already bundled by libraries like Gson, Retrofit, Room, and Kotlin Coroutines, plus package-wide wildcards and global -dontoptimize style rules. - Use Case: A developer preparing a release build runs the analysis, receives optimization, shrinking, and obfuscation scores, and learns that a package-wide -keep class com.example.** { *; } rule is blocking 30% of the codebase from optimization. ## Quick Start Analyze my Android project's R8 keep rules and build configuration, then report which rules are redundant or too broad.

Frequently Asked Questions about r8-analyzer

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

FAQPage Schema
How do I analyze R8 keep rules in an Android project?

Run the analysis against your build files and proguard-rules.pro. With AGP 9.3.0 or higher it executes the analyzeReleaseR8Config Gradle task; older versions use the R8 Configuration Analyzer proto dump or heuristic rule inspection.

Which ProGuard keep rules are redundant in Android apps?

Rules for Android components, AndroidX, Kotlin, Gson, Retrofit, Room, and Kotlin Coroutines are typically redundant because modern library versions bundle their own consumer keep rules. Global rules like -dontoptimize or -dontshrink should also be removed.

What AGP version is required for R8 configuration analysis?

The standalone analyzeReleaseR8Config task requires AGP 9.3.0 or higher. Quantitative analysis via the R8 Configuration Analyzer works with R8 9.3.7-dev or later; older toolchains fall back to heuristic evaluation of proguard-rules.pro.

Why are package-wide keep rules bad for app size?

Rules like -keep class com.example.** { *; } prevent R8 from shrinking, optimizing, and obfuscating every class in the package and subpackages. They should be refined to target specific classes or members actually accessed via reflection.

Does the R8 analyzer modify my ProGuard configuration files?

No, it only researches and suggests changes. The skill outputs a Markdown report with Remove or Refine recommendations per rule and never edits build files or keep rule files directly.