agentsclimarketplace

R8 proguard optimization

Skill GDvega/super-android-kotlin-firebase-skill/skills/r8-proguard-optimization

A modular Agent Skills repository for Android, Kotlin, Jetpack Compose and Firebase development.

Install
npx -y skills add GDvega/super-android-kotlin-firebase-skill --skill r8-proguard-optimization

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Use for Android release shrinking, R8 and ProGuard keep rules, minify release failures, resource shrinking and Crashlytics mapping uploads.

SKILL.md

3.2 KB, 697 tokens by cl100k_base, as published. Nobody here has run it

Purpose

Fix release-only failures and optimize shrinking without disabling R8 or adding broad unsafe keep rules.

When to use

  • App fails only in release builds.
  • minifyEnabled or shrinkResources causes crashes.
  • Retrofit, serialization, Hilt, Room or Firebase needs targeted keep rules.
  • Crashlytics mapping upload must be configured.

Inputs to inspect

  • app/build.gradle.kts release build type
  • proguard-rules.pro and consumer-rules.pro
  • Reflection, serialization and Retrofit converters
  • Room entities and Hilt modules
  • Firebase and Crashlytics Gradle setup

Required workflow

  1. Reproduce using release or minified build.
  2. Read R8 error output and mapping context.
  3. Add the narrowest keep rule possible.
  4. Verify release tests or smoke tests.
  5. Document mapping file handling for Crashlytics.

Rules

  • Do not disable R8 as a permanent fix.
  • Do not add -keep class ** { *; } except as a temporary diagnostic.
  • Prefer library-documented rules and narrow app rules.
  • Validate release behavior, not only debug.
  • Preserve obfuscation unless debugging requires a temporary change.

Related existing skills

Local skills to invoke

  • gradle-build
  • play-store-release
  • debugging
  • firebase-crashlytics-analytics

External companion skills to use when installed

Do not assume these companion skills are installed. Prefer the local skills above first, then consult Companion Skills for install and verification commands.

  • android/skills — use for official Android workflow alignment around edge-to-edge, adaptive UI, Navigation 3, R8, AGP or testing setup.

Files commonly touched

  • app/build.gradle.kts
  • proguard-rules.pro
  • consumer-rules.pro
  • crashlytics Gradle config
  • Serialization models
  • Network and DI setup

Commands to validate

./gradlew assembleRelease
./gradlew app:minifyReleaseWithR8
./gradlew testReleaseUnitTest

Common mistakes to avoid

  • Testing only debug after changing R8 rules.
  • Adding global keep rules that erase shrinking benefits.
  • Forgetting mapping upload for crash reports.
  • Ignoring consumer rules in library modules.

Checklist

  • Release failure reproduced.
  • Specific rule added.
  • Release build validated.
  • Mapping behavior documented.
  • Residual obfuscation risk mentioned.

Example prompts

  • Use $super-android-kotlin-firebase to fix this release-only R8 crash.
  • Use $super-android-kotlin-firebase to review my ProGuard rules before release.

Expected response style

Respond with: brief diagnosis, change plan, affected files, code or diff summary, validation commands, tests added or recommended, risks, and next step. For review tasks, lead with findings ordered by severity.

References

  • ../../docs/audits/FUENTES_LOCALES.md
  • references/r8-release-checklist.md
  • references/common-keep-rules.md
  • references/firebase-r8-notes.md
  • references/reflection-serialization-rules.md
  • templates/proguard-rules-template.pro
  • templates/release-buildtype-template.md
  • templates/crashlytics-mapping-upload-template.md

What ships with it: 7 files

1.2 KB alongside SKILL.md

Keep looking

Skills are one crate of 326,984. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.