agentleFS
geevarghesekthomas84-sysgeevarghesekthomas84-sys/android-ai-engineering-system/skills/app-performance-engineer/SKILL.md

app-performance-engineer

Skill4 starsChanged 39 days agoMITView on GitHub

Android app performance optimization covering startup, Compose rendering, memory, network, battery, APK size, and benchmarking

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Write Macrobenchmark tests for startup and scroll, Microbenchmark tests for hot code paths, generate and install Baseline Profiles, read …

    line 49
  2. Distinctive:

    Use CPU Profiler for method traces, Memory Profiler for allocation tracking, Network Profiler for request timing, Energy Profiler for …

    line 52
  3. Distinctive:

    Every optimization follows this cycle:

    line 56
  4. Distinctive:

    Never ship a "performance improvement" without before-and-after numbers.

    line 76

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

App Performance Engineer

Trigger Conditions

Activate this skill when the user describes or asks about any of the following:

  • Slow app startup -- cold start exceeds 500ms, warm start exceeds 300ms, or splash screen lingers
  • UI jank -- dropped frames, stuttering scrolls, animation hitches, recomposition storms in Compose
  • Large APK -- release APK or AAB exceeds target size, user or Play Console flags download size
  • Memory issues -- OOM crashes, high memory warnings, suspected leaks, GC pressure
  • Battery drain -- background wake locks, excessive network polling, users reporting battery consumption
  • Startup time -- need to measure, profile, or reduce time-to-first-frame or time-to-interactive
  • Benchmark setup -- setting up Macrobenchmark, Microbenchmark, Baseline Profiles, or CI performance gates

Capabilities

1. Startup Optimization

Measure and reduce cold, warm, and hot start times using App Startup library, lazy initialization, background thread scheduling, Baseline Profiles, and splash screen API. Reference: references/startup-optimization.md

2. Compose Rendering Performance

Eliminate recomposition waste through stability annotations, derivedStateOf, correct remember usage, efficient LazyColumn configuration, and Compose compiler metrics. Reference: references/compose-performance.md

3. Memory Optimization

Detect and fix memory leaks with LeakCanary, optimize Bitmap handling with Coil, reduce allocation pressure, and respond to system trim callbacks. Reference: references/memory-optimization.md

4. Network and Battery Efficiency

Batch and compress network calls, configure Coil disk caching, schedule deferrable work with WorkManager, respect Doze mode, and minimize wake locks. Reference: references/network-battery.md

5. APK Size Reduction

Configure R8 for aggressive shrinking, enable resource shrinking, split by density, analyze with APK Analyzer, convert rasters to WebP and vector drawables, and trim unused Material Icons. Reference: references/apk-size.md

6. Benchmarking and Baseline Profiles

Write Macrobenchmark tests for startup and scroll, Microbenchmark tests for hot code paths, generate and install Baseline Profiles, read results, and integrate into CI. Reference: references/benchmarking.md

7. Profiling with Android Studio

Use CPU Profiler for method traces, Memory Profiler for allocation tracking, Network Profiler for request timing, Energy Profiler for battery impact, Layout Inspector for recomposition counts, and Perfetto for system traces.

Performance Workflow

Every optimization follows this cycle:

1. MEASURE BASELINE
   Capture current metric with a reproducible benchmark or profiler trace.

2. IDENTIFY BOTTLENECK
   Analyze traces (Perfetto, CPU Profiler) or metrics (Macrobenchmark JSON)
   to find the single largest contributor to the problem.

3. IMPLEMENT FIX
   Apply the targeted optimization. Change one thing at a time.

4. MEASURE AGAIN
   Re-run the exact same benchmark or trace under the same conditions.

5. COMPARE
   Confirm the metric improved. If not, revert and try another approach.

Never ship a "performance improvement" without before-and-after numbers.

Key Metrics and Targets

MetricGoodNeeds WorkPoor
Cold start (time-to-initial-display)< 500ms500ms - 1s> 1s
Warm start< 300ms300ms - 700ms> 700ms
Hot start< 150ms150ms - 300ms> 300ms
Frame render time< 16ms (60fps)16ms - 32ms> 32ms
Frame render time (90Hz)< 11ms11ms - 22ms> 22ms
Memory footprint (typical app)< 100MB100MB - 200MB> 200MB
APK size (single density)< 10MB10MB - 30MB> 30MB
AAB download size< 15MB15MB - 50MB> 50MB

Rule

Always measure before and after optimization. Intuition about performance is unreliable. Profile-driven optimization is the only kind that consistently delivers real improvements. A change that looks faster in code review but has no benchmark data is not a performance improvement -- it is a code change with unknown performance impact.

Tool Versions (Current Environment)

  • Android CLI: 1.0.16625370
  • JDK: 21
  • Kotlin: 2.3.20
  • Jetpack Compose BOM: 2026.03.01
  • Material 3
  • AGP: 9.0.1

Quick Reference: Common Commands

# Run Macrobenchmark tests
./gradlew :benchmark:connectedBenchmarkAndroidTest

# Generate Baseline Profiles
./gradlew :app:generateBaselineProfile

# Analyze APK size
# Use Android Studio > Build > Analyze APK, or:
./gradlew :app:assembleRelease
# Then open build/outputs/apk/release/*.apk in APK Analyzer

# Check Compose compiler stability reports
# After enabling reportsDestination in build.gradle.kts:
# Reports appear in build/compose_metrics/

# Run Microbenchmark tests
./gradlew :microbenchmark:connectedAndroidTest

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.