r8-analyzer

Analyze R8 keep rules and generate a Markdown impact report.

Updated May 22, 2026
One-click install
npx skills add https://github.com/ekawijayasusilo/kmp_template --skill r8-analyzer-ekawijayasusilo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r8-analyzer
Source: https://github.com/ekawijayasusilo/kmp_template/tree/main/.claude/skills/r8-analyzer
Command: npx skills add https://github.com/ekawijayasusilo/kmp_template --skill r8-analyzer-ekawijayasusilo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It helps you identify redundant or overly broad R8/Proguard keep rules that prevent shrinking/obfuscation, so your release build size and optimization potential aren’t left on the table.

Core Features & Use Cases

  • Build configuration verification: Checks your Android/Gradle setup to ensure R8 app-optimization settings are aligned (including AGP and R8 full mode expectations).
  • Quantitative keep-rule impact analysis: When your R8 version supports it, generates a configuration analyzer dataset and derives optimization/impact metrics from the produced analysis output.
  • Heuristic fallback inspection: When quantitative analysis isn’t possible, evaluates keep rules by reviewing broad patterns, checking for redundant rules, and prioritizing refinements using provided rule hierarchy guidance.
  • Report generation: Produces a structured Markdown report following the required report format, based strictly on discovered issues/metrics.
  • Release-safety focus: Encourages validating proposed changes with macrobenchmark-style testing (UI Automator) to reduce regression risk.

Quick Start

Run r8-analyzer against your Android release build configuration to produce a keep-rules impact report for optimizing 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 R8 keep rules that bloat my Android app size?

To find redundant R8 keep rules, you need an analysis tool that inspects your Android Gradle build configuration and Proguard keep rules to detect overly broad patterns preventing code shrinking. The r8-analyzer Skill evaluates these rules and generates a structured Markdown report highlighting optimization opportunities.

What is the best way to check if my Proguard keep rules limit code shrinking and obfuscation?

The best way to check if Proguard keep rules limit shrinking and obfuscation is to run a quantitative or heuristic analysis on your R8 configuration. Depending on your R8 version, the analyzer generates configuration datasets or reviews broad rule patterns to identify wasteful keep rules.

Does R8 full mode require different keep rule analysis than older Proguard configurations?

Yes, R8 full mode requires different keep rule analysis because its optimization settings and expectations differ from older Proguard setups. The analysis verifies your Android Gradle configuration alignment and chooses between quantitative dataset generation or heuristic fallback inspection based on the detected R8 version.

How do I analyze R8 configuration analyzer output to refine overly broad keep rules?

To analyze R8 configuration analyzer output, you parse the generated dataset to derive optimization impact metrics for your keep rules. When quantitative analysis is unsupported, you evaluate rules using heuristic fallback inspection and rule hierarchy guidance to prioritize refinements.

Why are my Android release builds not shrinking even with R8 enabled?

Android release builds may not shrink because overly broad R8 keep rules protect unnecessary classes from removal. Inspecting your build.gradle and gradle.properties files reveals misaligned app-optimization settings or redundant rules that limit obfuscation and increase app size.

What should I do after refining R8 keep rules to prevent release build regressions?

After refining R8 keep rules, you should validate proposed changes using macrobenchmark-style testing with UI Automator to reduce regression risk. This release-safety focus ensures that removing redundant keep rules does not break app functionality during obfuscation and shrinking.