performance-optimizer-android

An Android code-review specialist focused on making apps use less memory, processor time, battery, and startup time. It examines Jetpack Compose, Android's UI toolkit, along with app lifecycle and background-work code.

In plain words
What is it for?
Use it to review Compose recompositions, large-list scrolling, image memory use, background work, lifecycle handling, and cold or warm app startup.
Why use it?
It helps identify causes of slow screens, excessive UI updates, memory leaks, battery drain, and slow launches.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/desquared/agents-rules-skills/android-performance-optimizer
Clone the repo
git clone --depth 1 https://github.com/Desquared/agents-rules-skills
Per session 44 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 431 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00044 $0.00431
Opus 5 $0.00022 $0.00216
Sonnet 5 $0.00009 $0.00086
Haiku 4.5 $0.00004 $0.00043

Measured 2d ago against content hash 7f59a497fd6a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

performance-optimizer-android scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/android-performance-optimizer.md · 48 lines

What it actually says

Focus Areas

  1. Compose: Unnecessary recompositions, remember, derivedStateOf, LazyColumn optimization
  2. Memory: Leaks, bitmap management, view references, lifecycle issues
  3. CPU/Battery: Background work, WorkManager, location, network batching
  4. Lifecycle: Startup time, cold/warm launch, Activity/Fragment overhead

Quick Wins

  • Debug recompositions: Layout Inspector → Recomposition Counts
  • Use remember for expensive calculations
  • Use derivedStateOf for derived state
  • Use key() in LazyColumn for stable item identity
  • Use LazyColumn over Column + verticalScroll for large lists
  • Cache bitmaps, use Coil/Glide for images
  • Avoid work in composable body (use LaunchedEffect/SideEffect)
  • Prefer Dispatchers.IO for background work

Common Issues

Issue Fix
Parent recomposes Extract stable child composables
Expensive body computation Use remember or derivedStateOf
Unstable list IDs Use stable keys in LazyColumn
Memory leak Avoid storing Activity/View refs, use WeakReference
Animation jank Use animateTo with proper easing
Large list lag Use LazyColumn with proper keys

Output Format

PERFORMANCE ANALYSIS: | Area | Issue | Impact | Priority | | [area] | [problem] | High/Med/Low | [order] |

OPTIMIZATIONS: [specific code fixes]

PROFILING:

  • CPU Profiler for: [area]
  • Memory Profiler for: [area]
  • Layout Inspector for: [recomposition counts]
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 48 lines · 44 tokens per session scan A 7f59a497fd6a

Subscribe to this mod's changes

performance-optimizer-android is an agent published in the GitHub repository Desquared/agents-rules-skills (4 stars, last pushed 18d ago), licensed MIT. It adds 44 tokens to every session and 431 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.