r8-analyzer

Identify redundant and overly broad R8 keep rules in Android projects.

3|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/tajemniktv/TajsOS --skill r8-analyzer-tajemniktv
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r8-analyzer
Source: https://github.com/tajemniktv/TajsOS/tree/main/.agent/skills/r8-analyzer
Command: npx skills add https://github.com/tajemniktv/TajsOS --skill r8-analyzer-tajemniktv

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Android apps often bloat due to redundant, overly broad, or unnecessary R8/ProGuard keep rules that block code shrinking and optimization, leading to larger download sizes and worse runtime performance.

Core Features & Use Cases

  • Redundant Rule Detection: Flags keep rules for common libraries (AndroidX, Kotlin, Gson, Retrofit, Room) that are already covered by embedded library consumer rules, eliminating unnecessary bloat.
  • Rule Quality Analysis: Identifies overly broad package-wide keep rules, inversion operator misuse, and subsuming rules that prevent R8 from optimizing large swathes of code.
  • Reflection-Aligned Refinement: Suggests narrow, specific keep rules for code paths that rely on reflection, ensuring functionality is preserved while maximizing optimization potential.
  • Use Case: An Android developer with an oversized release APK can use this skill to audit their ProGuard configuration, remove redundant rules, and shrink their app size without breaking existing functionality.

Quick Start

Use the r8-analyzer skill to review your Android project's ProGuard keep rules and receive a prioritized list of changes to reduce your app's final size.

Frequently Asked Questions about r8-analyzer

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

FAQPage Schema
How do I identify redundant ProGuard keep rules that are increasing my Android app size?

To identify redundant ProGuard keep rules increasing Android app size, audit your build configuration against embedded library consumer rules. This process flags rules for common libraries like AndroidX and Gson that are already covered, allowing you to remove unnecessary bloat without breaking functionality.

Why does R8 code shrinking not reduce my Android app size as expected?

R8 code shrinking may not reduce Android app size effectively when overly broad package-wide keep rules or inversion operator misuse prevent optimization. Auditing your configuration for subsuming rules helps R8 shrink large swathes of previously blocked code.

How do I narrow keep rules for reflection-dependent code without breaking functionality?

To narrow keep rules for reflection-dependent code without breaking functionality, analyze your code reflection patterns against your current ProGuard configuration. This generates specific, narrow keep rules that preserve runtime behavior while maximizing R8 optimization potential.

Can I remove keep rules for common libraries like Retrofit and Room in my Android project?

You can remove keep rules for common libraries like Retrofit and Room if they duplicate embedded library consumer rules. Auditing your ProGuard configuration detects these redundant rules, allowing safe removal to reduce final app size without causing runtime errors.

What is the best way to audit an Android project's R8 configuration for release builds?

The best way to audit an Android project's R8 configuration for release builds is to review keep rule files against embedded library consumer rules and code reflection patterns. This generates a prioritized list of rule modifications to reduce final app size.

Does r8-analyzer work with Android projects using ProGuard for release builds?

Yes, r8-analyzer works with Android application projects using R8 or ProGuard for release builds. It audits your build configuration and keep rule files to generate a prioritized list of modifications that shrink app size without breaking reflection-dependent features.