agentleFS
kelvinkosbabkelvinkosbab/AppBootstrapAI/.claude/skills/android-compose-pro/SKILL.md

android-compose-pro

Skill8 starsChanged 12 days agoMITView on GitHub

Deep-reviews Jetpack Compose code for recomposition stability, side-effect correctness, lazy-list performance, and state modeling. Use when reading, writing, or reviewing non-trivial Compose UI — especially when chasing jank, runaway recomposition, or effect bugs.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

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

    Check state modeling and hoisting using references/state-modeling.md — where state lives, who owns it, how it flows.

    line 15
  2. Very specific:

    Check recomposition stability using references/stability.md — unstable parameters, lambda churn, skippability.

    line 16
  3. Very specific:

    Check lazy-layout performance using references/lazy-performance.md — keys, contentType, scroll-driven state.

    line 18
  4. Distinctive:

    If doing a partial review, load only the relevant reference files.

    line 21
  5. Very specific:

    Official companion: when Google's Android skills (android/skills, Apache-2.0) are installed, see jetpack-compose-performance, which …

    line 23
  6. Very specific:

    Side effects are guilty until proven keyed correctly: Every LaunchedEffect/DisposableEffect gets the question: what restarts you, and is …

    line 30
  7. Distinctive:

    Performance claims need a mechanism: When flagging a perf issue, name the mechanism (per-frame recomposition, missing keys forcing …

    line 32

≈ “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

Review Jetpack Compose code for correctness and performance. This is the deep-review companion to the always-on android-compose-best-practices.md rule — the rule steers while writing; this skill audits what was written. Report only genuine problems; don't nitpick or invent issues.

Review process:

  1. Check state modeling and hoisting using references/state-modeling.md — where state lives, who owns it, how it flows.
  2. Check recomposition stability using references/stability.md — unstable parameters, lambda churn, skippability.
  3. Audit every side effect using references/side-effects.md — keys, teardown, stale captures.
  4. Check lazy-layout performance using references/lazy-performance.md — keys, contentType, scroll-driven state.
  5. Spot-check semantics against the android-accessibility-best-practices.md rule (merged nodes, roles, contentDescription) — don't duplicate a full a11y audit here.

If doing a partial review, load only the relevant reference files.

Official companion: when Google's Android skills (android/skills, Apache-2.0) are installed, see jetpack-compose-performance, which measures recomposition and dropped frames. Use it to confirm a performance fix; use this skill for state, stability, and effect review.

Core Instructions

  • Target Kotlin 2.x with the Compose Compiler Gradle plugin; assume Material 3.
  • Recomposition is the lens. Most Compose bugs and jank reduce to "this runs more often than the author thinks" — composition, effect launch, or lambda allocation. Trace the actual invalidation, don't guess.
  • Don't recommend @Stable/@Immutable as a reflex. First check whether strong skipping (default under Kotlin 2.0.20+ Compose compilers) already covers the case; annotations are for genuine contracts, not cargo cult.
  • Side effects are guilty until proven keyed correctly. Every LaunchedEffect/DisposableEffect gets the question: what restarts you, and is that the author's intent?
  • Business state never lives in remember { }. ViewModel + StateFlow + collectAsStateWithLifecycle() is the boundary; flag exceptions.
  • Performance claims need a mechanism. When flagging a perf issue, name the mechanism (per-frame recomposition, missing keys forcing re-layout, unstable lambda defeating skipping) — not just "this could be slow."

Output Format

Organize findings by file. For each issue: state the file/line, name the violated principle, show a brief before/after. Skip files with no issues. End with a prioritized summary (correctness first, then performance, then style).

Example finding:

FeedScreen.kt

Line 41: LaunchedEffect(Unit) capturing state.selectedId — stale read after recomposition.

// Before — selectedId is captured once; later changes are invisible to the effect
LaunchedEffect(Unit) { analytics.logOpen(state.selectedId) }

// After — key the effect on what it reads
LaunchedEffect(state.selectedId) { analytics.logOpen(state.selectedId) }

References

  • references/state-modeling.md — hoisting review, ViewModel boundary, UiState shapes, rememberSaveable + custom Saver, unidirectional data flow smells.
  • references/stability.md — skippability diagnosis, strong skipping mode, @Stable/@Immutable contracts, unstable collections, lambda allocation, compiler reports.
  • references/side-effects.md — LaunchedEffect keys, rememberUpdatedState, DisposableEffect teardown pairing, SideEffect, produceState, snapshotFlow, rememberCoroutineScope.
  • references/lazy-performance.md — stable key + contentType, item-lambda hygiene, derivedStateOf for scroll-driven UI, nested-scroll traps, animateItem.

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.