agentleFS
adrigm06adrigm06/Android-Engineering-Skill/skills/android-performance/SKILL.md

android-performance

Skill3 starsChanged 7 months agoMITView on GitHub

Android performance engineering skill focused on startup, jank, memory, ANRs, battery, tracing, and baseline profiles. Use whenever users ask to diagnose or optimize app performance.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 9 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    remove/defers main-thread initialization

    line 45
  2. Distinctive:

    prefer low-blast-radius fixes with measurable gain

    line 58
  3. Distinctive:

    if fastest fix violates boundaries:

    line 64
  4. Distinctive:

    if request is broad/ambiguous (e.g., "optimize the whole app"):

    line 70
  5. Distinctive:

    keep each stage tied to measurable gates and rollback triggers

    line 72
  6. Distinctive:

    add regression alerts, ownership, and playbooks

    line 86
  7. Very specific:

    Use measurable gates and label each pass | at-risk | fail:

    line 91
  8. Distinctive:

    If no reliable baseline exists, return a measurement-first plan before committing deep optimizations.

    line 98
  9. Distinctive:

    Do not recommend optimization theater without measurable user impact.

    line 107
  10. Distinctive:

    If confidence is medium/low:

    line 117
  11. Very specific:

    Use the standard payload defined in ../../AGENTS.md (section: Cross-skill handoff contract).

    line 126
  12. Very specific:

    Follow global order from ../../AGENTS.md:

    line 131

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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

Purpose

Improve Android runtime performance through evidence-driven diagnosis, targeted optimizations, and regression-resistant controls.

Scope and authority

This skill is lead authority for runtime constraints:

  • startup and first-frame latency
  • frame-time stability and jank
  • memory pressure and ANR behavior
  • battery and thermal efficiency

Supporting interactions:

  • align structural changes with android-architecture
  • align Compose hot-path interventions with android-compose
  • align release risk and rollback gates with android-release-engineering

When to use

  • slow startup, jank, ANR, memory, battery concerns
  • optimization planning for critical user journeys
  • performance regression investigation and prevention

Decision engine workflow

  1. Define user-impact goals and performance envelopes.
  2. Capture baseline metrics and reproducible traces.
  3. Rank bottlenecks by impact vs fix cost.
  4. Choose intervention branch and expected gain.
  5. Validate with before/after evidence.
  6. Install guardrails against regression.

Branching decision tree

Branch A: bottleneck domain

  • startup-heavy:
    • remove/defers main-thread initialization
    • prioritize first-frame and fully-drawn improvements
  • jank-heavy:
    • isolate heavy UI/recomposition hotspots
    • reduce expensive work in frame-critical windows
  • memory/ANR-heavy:
    • identify leak/allocation spikes and blocked thread patterns
  • battery-heavy:
    • reduce unnecessary background work and polling

Branch B: intervention aggressiveness

  • near release:
    • prefer low-blast-radius fixes with measurable gain
  • post-release hardening window:
    • allow deeper refactors if validated by benchmark/regression coverage

Branch C: architecture tension

  • if fastest fix violates boundaries:
    • choose constrained temporary workaround only with expiry criteria
    • define path back to target architecture

Branch D: broad optimization scope

  • if request is broad/ambiguous (e.g., "optimize the whole app"):
    • return a staged 30/60/90-day plan instead of ad-hoc tips
    • keep each stage tied to measurable gates and rollback triggers

30/60/90 plan default

  • Day 0-30 (Baseline and containment):
    • establish startup/jank/memory/ANR/battery baselines
    • instrument top 3 user journeys
    • fix highest-severity regressions with low blast radius
  • Day 31-60 (Targeted optimization):
    • optimize top bottlenecks by measured impact
    • harden Compose hot paths and background work scheduling
    • validate before/after deltas against regression budgets
  • Day 61-90 (Scale and prevention):
    • codify performance gates in CI/release pipeline
    • add regression alerts, ownership, and playbooks
    • retire temporary workarounds and close debt with expiry criteria

Quantitative gates

Use measurable gates and label each pass | at-risk | fail:

  • startup regression budget gate (relative to baseline)
  • frame/jank regression budget gate (relative to baseline)
  • memory/ANR safety gate (absolute + trend checks)
  • battery/thermal regression gate (relative to baseline)

If no reliable baseline exists, return a measurement-first plan before committing deep optimizations.

Tradeoff realism

Allow context-justified choices:

  • a smaller guaranteed gain may beat risky large refactor near release
  • defer low-impact tuning when top bottlenecks remain unresolved

Do not recommend optimization theater without measurable user impact.

Uncertainty protocol

Always report confidence:

  • High (>= 0.80)
  • Medium (0.60-0.79)
  • Low (< 0.60)

If confidence is medium/low:

  • state instrumentation gaps and assumptions
  • provide at least one conservative fallback
  • request minimum additional traces/metrics to decide
  • escalate to android-architecture or android-compose for cross-layer conflicts

Cross-skill handoff payload

Use the standard payload defined in ../../AGENTS.md (section: Cross-skill handoff contract). Set requesting_skill to android-performance.

Output contract

Follow global order from ../../AGENTS.md:

  1. Context and constraints
  2. Decision and rationale
  3. Alternatives considered
  4. Tradeoffs
  5. Risks and mitigations
  6. Confidence and unknowns
  7. Cross-skill impacts
  8. Next implementation steps

Also include:

  • Symptoms and probable bottlenecks
  • Profiling/instrumentation plan
  • Priority optimization plan
  • Expected impact and tradeoffs
  • Verification metrics
  • Regression prevention controls

Anti-pattern detection

  • optimize without baseline evidence
  • broad refactor proposals for local bottlenecks
  • ignoring battery/thermal regressions
  • performance changes without guardrails or re-measurement

Related resources

  • references/profiling-playbook.md

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.