r8-analyzer

Analyze Android R8 keep rules for redundancy and broad scope.

Updated Jan 2, 2026
One-click install
npx skills add https://github.com/tanaka-mambinge/dotfiles --skill r8-analyzer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r8-analyzer
Source: https://github.com/tanaka-mambinge/dotfiles/tree/main/ai-configs/skills/r8-analyzer
Command: npx skills add https://github.com/tanaka-mambinge/dotfiles --skill r8-analyzer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Analyzes Android build files and R8 keep rules to identify redundancies, broad package-wide rules, and rules that subsume library consumer keep rules. Use when developers want to optimize their app's size, remove redundant or overly broad keep rules, or troubleshoot Proguard configurations.

Core Features & Use Cases

  • Analyze R8 configuration by inspecting build.gradle/build.gradle.kts, gradle.properties, and proguard/consumer rules using the references guidance to identify redundant or overly broad rules.
  • Evaluate rules against the KEEP-RULES-IMPACT-HIERARCHY.md to prioritize impact and propose targeted refinements.
  • Detect subsuming or conflicting keep rules and provide actionable guidance on narrowing rules via the REFLECTION-GUIDE.md.

Quick Start

Run the analyzer on your Android project to identify redundant and broad keep rules and review the suggested refinements

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 to reduce Android APK size?

Finding redundant Proguard keep rules requires analyzing build.gradle and proguard files to detect overly broad package-wide rules that inflate APK size. The analyzer evaluates rules against an impact hierarchy to pinpoint and recommend narrowing redundant configurations.

Why are broad package-wide R8 keep rules hindering my app optimization?

Broad package-wide R8 keep rules hinder optimization by preventing the compiler from pruning unused classes across entire packages. This restricts code shrinking and inflates the final app size unnecessarily.

Can I check if my R8 consumer rules conflict with library rules?

Checking if R8 consumer rules conflict with library rules involves inspecting proguard and consumer rule files to detect subsuming configurations. The analyzer identifies conflicts and provides guidance on narrowing rules based on reflection requirements.

What is the best way to analyze R8 configuration for subsuming keep rules?

Analyzing R8 configuration for subsuming keep rules is best done by examining build.gradle.kts, gradle.properties, and proguard files against a keep-rules-impact-hierarchy. This approach prioritizes impact and proposes targeted refinements without modifying files directly.

Does this analyzer modify my Android project files automatically?

No, the analyzer does not modify Android project files automatically. It examines build files and R8 keep rules to generate precise recommendations and actionable guidance for narrowing rules, leaving the actual code changes to the developer.