performance
Skill15 starsChanged 9 months agoMITView on GitHub
Android app performance for AI agents. Use this skill whenever optimizing app performance, reducing recomposition, Compose stability, @Stable, @Immutable, skippable composables, baseline profiles, R8 optimization, lazy loading, image memory, Coil caching, RecyclerView vs LazyList performance, memory leaks, LeakCanary, ANR prevention, background work, Trace API, systrace, profiling, overdraw, rendering performance, startup time optimization, or any Android performance concern. Apply whenever a screen feels slow or laggy.
45 other projects use a version of this.
Adopted by
Most recently taken up by
- diodeme/Gold-Bandtheir own version, first seen Sep 30, 2026
- Furkiozknn/Furkiozknntheir own version, first seen Sep 28, 2026
- rtk-ai/rtktheir own version, first seen Sep 22, 2026
- elfrost/ai-patchlabtheir own version, first seen Sep 22, 2026
- ilang-ai/autocodetheir own version, first seen Sep 20, 2026
- angelgabrieljacintohuayllasco/clipboard-skillstheir own version, first seen Sep 20, 2026
Used with
Projects with it also use web-quality-audit, core-web-vitals and 9 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
RodrigoTomeESSkillweb-quality-audit
Comprehensive web quality audit covering performance, accessibility, SEO, and best practices. Use when asked to "audit my site", "review web quality", "run lighthouse audit", "check page quality", or "optimize my website".
Also in 5 projects that use this
thisisAhsanIqbalSkillcore-web-vitals
Audits HTML patterns that affect Core Web Vitals (LCP, CLS, INP). Checks for layout shift causes, largest contentful paint blockers, and interaction responsiveness issues. Use when optimising page performance or fixing Google PageSpeed Insights warnings.
Also in 6 projects that use this
kpbraySkillbest-practices
Applies Power BI best practices, BPA rules, and enterprise standards. Use for quality validation, naming conventions, and performance optimization.
Also in 5 projects that use this
pproencaSkillrefactoring
Code refactoring best practices based on Martin Fowler's catalog and Clean Code principles. This skill should be used when refactoring existing code, improving code structure, reducing complexity, eliminating code smells, or reviewing code for maintainability. Triggers on tasks involving extract method, rename, decompose conditional, reduce coupling, or improve readability.
Also in 7 projects that use this
BlockSkilldebugging
Debugging guidelines and best practices
Also in 10 projects that use this
VercelSkillremotion
Remotion renderer for json-render that turns JSON timeline specs into videos. Use when working with @json-render/remotion, building video compositions from JSON, creating video catalogs, or rendering AI-generated video timelines.
Also in 3 projects that use this
Other versions45 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 45
- rtk-ai/rtk★ 82ksame name
- addyosmani/web-quality-skills★ 2.9ksame name
- plugin87/ux-ui-agent-skills★ 1.5ksame name
- rshankras/claude-code-apple-skills★ 777same name
- nth5693/gemini-kit★ 373same name
- theexperiencecompany/gaia★ 306same name
- Piebald-AI/splitrail★ 222same name
- diodeme/Gold-Band★ 143same name
- jvm-skills/jvm-skills★ 140same name
- TheBeardedBearSAS/claude-craft★ 106same name
35 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository27 other files it gives its agents.
- AGENTS.mdAGENTS.md
- accessibilitySkill
- adaptive-uiSkill
- android-architectureSkill
- android-setupSkill
- android-testingSkill
- biometricsSkill
- ci-cd-androidSkill
- compose-animationSkill
- compose-navigationSkill
- compose-uiSkill
- datastoreSkill
- design-systemSkill
- design-tokensSkill
- firebaseSkill
- gradleSkill
- hilt-diSkill
- kotlin-patternsSkill
- material3Skill
- notificationsSkill
- offline-firstSkill
- permissionsSkill
- play-store-releaseSkill
- retrofitSkill
- room-databaseSkill
- securitySkill
- supabase-androidSkill
The file
Files
Android Performance
Rule 1: Compose stability — stop unnecessary recomposition
// ✅ @Stable for classes Compose can't infer stability
@Stable
class ItemState(
val id: String,
val title: String,
var isExpanded: Boolean = false // mutable but tracked
)
// ✅ @Immutable for guaranteed-immutable data (faster than @Stable)
@Immutable
data class Item(
val id: String,
val title: String,
val tags: List<String> // List is not stable by default — @Immutable fixes it
)
// ✅ Use ImmutableList from kotlinx-collections-immutable for stable lists
implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.7")
@Composable
fun ItemList(items: ImmutableList<Item>) { // ImmutableList is stable, List is not
LazyColumn {
items(items, key = { it.id }) { item ->
ItemCard(item = item) // won't recompose unless item changes
}
}
}
// ❌ List<Item> parameter causes ItemList to recompose on every parent recomposition
@Composable
fun ItemList(items: List<Item>) { ... }Rule 2: derivedStateOf — compute only when dependencies change
// ✅ derivedStateOf — prevents recomposition when result doesn't change
@Composable
fun ItemList(items: List<Item>) {
val listState = rememberLazyListState()
// Only recomputes when scroll position crosses threshold
val showScrollToTop by remember {
derivedStateOf { listState.firstVisibleItemIndex > 3 }
}
// Only recomputes when filter changes, not on every recomposition
val activeItems by remember(items) {
derivedStateOf { items.filter { it.isActive } }
}
Box {
LazyColumn(state = listState) {
items(activeItems, key = { it.id }) { ItemCard(it) }
}
AnimatedVisibility(visible = showScrollToTop, modifier = Modifier.align(Alignment.BottomEnd)) {
ScrollToTopButton(onClick = { /* scroll to top */ })
}
}
}Rule 3: Baseline Profiles — fast startup
// ✅ Generate with Macrobenchmark — significant startup improvement
// benchmark/src/androidTest/java/BaselineProfileGenerator.kt
@RunWith(AndroidJUnit4::class)
class BaselineProfileGenerator {
@get:Rule
val rule = BaselineProfileRule()
@Test
fun generate() {
rule.collect(packageName = "com.company.app") {
pressHome()
startActivityAndWait()
// Navigate through main flows
device.findObject(By.text("Home")).click()
device.waitForIdle()
}
}
}
// app/build.gradle.kts
dependencies {
implementation(libs.profileinstaller)
}Rule 4: R8 — enable shrinking in release
// ✅ build.gradle.kts — release config
buildTypes {
release {
isMinifyEnabled = true // R8 removes unused code
isShrinkResources = true // removes unused resources
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}# proguard-rules.pro — keep what R8 would remove incorrectly
-keep class com.company.app.data.remote.dto.** { *; } # keep serialization DTOs
-keepclassmembers class * { @com.google.gson.annotations.SerializedName <fields>; }
# Kotlin
-keep class kotlin.** { *; }
-keepclassmembers class **$WhenMappings { *; }Rule 5: Image loading performance
// ✅ Coil — proper sizing and caching
AsyncImage(
model = ImageRequest.Builder(LocalContext.current)
.data(imageUrl)
.size(Size.ORIGINAL) // or explicit size: .size(400, 300)
.crossfade(true)
.memoryCachePolicy(CachePolicy.ENABLED)
.diskCachePolicy(CachePolicy.ENABLED)
.build(),
contentDescription = null,
contentScale = ContentScale.Crop,
modifier = Modifier
.fillMaxWidth()
.aspectRatio(16f / 9f)
)
// ✅ Preload images before they're needed
val imageLoader = LocalContext.current.imageLoader
LaunchedEffect(items) {
items.take(3).forEach { item ->
imageLoader.enqueue(
ImageRequest.Builder(context).data(item.imageUrl).build()
)
}
}Rule 6: Main thread protection
// ✅ Trace API — mark expensive operations for profiling
suspend fun processData(input: List<Item>): List<ProcessedItem> = withContext(Dispatchers.Default) {
trace("processData") { // visible in Android Studio profiler
input.map { processItem(it) }
}
}
// ✅ Never block main thread — even for "fast" operations
// ❌ This blocks main for DB read:
val item = runBlocking { itemDao.getById(id) }
// ✅ Suspend from coroutine:
val item = withContext(Dispatchers.IO) { itemDao.getById(id) }Common Mistakes
❌ Passing List<T> to Composable — use ImmutableList<T> or wrap in @Immutable class
❌ Computing in composition — move to remember {} or derivedStateOf {}
❌ isMinifyEnabled = false in release — leaves dead code in APK
❌ Loading full-resolution images — always size images to display size
❌ Running DB queries on Main thread — always withContext(Dispatchers.IO)
❌ No baseline profile — first launch is 40-60% slower without it
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
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.

