performance-optimization

performance-optimization is a skill for Claude Code, Codex from GuillemRoca/agent-skills-android. It costs 43 tokens per session (1,876 once invoked), scanned A, original, MIT.

An Android app performance guide for measuring startup time, dropped frames, unresponsive-app errors, app size, memory use, and Jetpack Compose recomposition. It covers Android Studio profiling and benchmarking tools.

In plain words
What is it for?
Use it to investigate slow startup, scrolling problems, ANRs, battery or memory concerns, oversized APKs, and performance regressions before release.
Why use it?
It replaces guesses about slowness with measurements, targeted fixes, and checks that confirm whether performance improved. Android Vitals are Google’s measures of app health, including startup, jank, and ANRs—errors where an app stops responding.

Skill for Claude CodeCodex

Part of the agent-skills-android plugin — 29 skills, 7 commands, 3 agents, 1 hook shipped together

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 skills/guillemroca/agent-skills-android/performance-optimization
Any agent
npx skills add GuillemRoca/agent-skills-android --skill performance-optimization
Clone the repo
git clone --depth 1 https://github.com/GuillemRoca/agent-skills-android

Made for: Claude Code, Codex.

Or install agent-skills-android, the plugin that ships this one along with the rest of its 29 skills, 7 commands, 3 agents, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for performance-optimization

README.md
[![agentmods](https://agentmods.dev/badge/skills/guillemroca/agent-skills-android/performance-optimization.svg)](https://agentmods.dev/skills/guillemroca/agent-skills-android/performance-optimization)
Your own site
<a href="https://agentmods.dev/skills/guillemroca/agent-skills-android/performance-optimization"><img src="https://agentmods.dev/badge/skills/guillemroca/agent-skills-android/performance-optimization.svg" alt="Measured on agentmods" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,876 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.00043 $0.01876
Opus 5 $0.00022 $0.00938
Sonnet 5 $0.00009 $0.00375
Haiku 4.5 $0.00004 $0.00188

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

Security

Grade A, and why

performance-optimization 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 4d 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.

skills/performance-optimization/SKILL.md · 263 lines

How it starts

The opening of the file, as written. The whole thing — 263 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Performance Optimization

Overview

"Performance optimization without measurement is guessing." Measure first, identify bottlenecks with data, fix with targeted changes, verify the improvement, and guard against regressions. Never optimize based on assumptions.

When to Use

  • App startup exceeds 500ms (cold) or 200ms (warm)
  • UI jank (dropped frames, janky scrolling)
  • ANR (Application Not Responding) reports
  • APK/AAB size exceeds budget
  • Before a release (performance regression check)
  • Users report slowness or battery drain

Skip when: No performance issue is observed or measured.

Android Vitals Targets

Metric Target Critical
Cold startup < 500ms > 1s
Warm startup < 200ms > 500ms
Frame rendering (jank) < 5% slow frames > 10% slow frames
ANR rate < 0.47% > 1%
APK size (compressed) < 10MB > 50MB
Memory usage < 150MB typical > 256MB

Core Process

Step 1: Measure

  1. Baseline Profiles (startup and scrolling):
// benchmark/src/main/java/BaselineProfileGenerator.kt
@RunWith(AndroidJUnit4::class)
class BaselineProfileGenerator {
    @get:Rule
    val rule = BaselineProfileRule()

    @Test
    fun generateBaselineProfile() {
        rule.collect(packageName = "com.example.app") {
            // Cold start
            pressHome()
            startActivityAndWait()

            // Critical user journeys
            device.findObject(By.text("Tasks")).click()
            device.waitForIdle()

            // Scroll the list
            val list = device.findObject(By.res("task_list"))
            list.setGestureMargin(device.displayWidth / 5)
            list.fling(Direction.DOWN)
            device.waitForIdle()
        }
    }
}
  1. Macrobenchmark (startup timing):
@RunWith(AndroidJUnit4::class)
class StartupBenchmark {
    @get:Rule
    val rule = MacrobenchmarkRule()

    @Test
    fun coldStartup() {
        rule.measureRepeated(
            packageName = "com.example.app",
            metrics = listOf(StartupTimingMetric()),
            startupMode = StartupMode.COLD,
            iterations = 5,
        ) {
            pressHome()
            startActivityAndWait()
        }
    }
}

Read the full file on GitHub · 263 lines

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. 4d ago First seen · 263 lines · 43 tokens per session scan A c32530bdc8dd

Subscribe to this mod's changes

performance-optimization is a skill published in the GitHub repository GuillemRoca/agent-skills-android (2 stars, last pushed 2mo ago), licensed MIT. It adds 43 tokens to every session and 1,876 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.

Related

Other skills, from other repositories

spec-kitty-runtime-next

Drive the canonical spec-kitty next --mission control loop for mission advancement. Load agent profiles at init, apply action-scoped doctrine context at each step boundary, and pull specific tactics/directives on demand. Triggers: "run the next step", "what should runtime do next", "advance the mission", "what is the…

Priivacy-ai/spec-kitty · 110 tokens

spec-kitty-mission-system

Understand how Spec Kitty missions work: the 4 built-in mission types, how they define workflows via step contracts and action indices, how missions and work packages relate, how templates are resolved through the 6-tier chain, and how doctrine artifacts (procedures, tactics, directives) compose mission behavior.…

Priivacy-ai/spec-kitty · 160 tokens

spec-kitty-git-workflow

Understand how Spec Kitty manages git: what git operations Python handles automatically, what agents must do manually, worktree lifecycle, auto-commit behavior, merge execution, and the safe-commit pattern. Triggers: "how does spec-kitty use git", "worktree management", "auto-commit", "who commits what", "git…

Priivacy-ai/spec-kitty · 125 tokens

spec-kitty-spdd-reasons

Drive REASONS Canvas authoring and review for Spec Kitty missions that opted in to Structured-Prompt-Driven Development (SPDD) via charter selection. Triggers: "use SPDD", "use REASONS", "generate a REASONS canvas", "apply structured prompt driven development", "make this mission SPDD". Does NOT handle: enforcing SPDD…

Priivacy-ai/spec-kitty · 118 tokens

spec-kitty-runtime-review

Review runtime-owned outputs using the Spec Kitty review workflow surface, then direct approval or rejection with structured feedback. Triggers: "review this work package", "check runtime output", "approve this step", "review WP", "is this WP ready to approve", "check this implementation". Does NOT handle: setup-only…

Priivacy-ai/spec-kitty · 85 tokens

spk-doctrine-show-me

Explain Spec Kitty work with compact, checkable visuals. Use for specs, plans, architecture, control flow, diffs, status boards, or whenever prose obscures structure.

Priivacy-ai/spec-kitty · 42 tokens