compose-stability-diagnostics

compose-stability-diagnostics is a skill for Claude Code, Codex from ashtanko/compose-android-template. It costs 43 tokens per session (1,662 once invoked), scanned A, original, MIT.

A guide for finding why Jetpack Compose user interfaces redraw more often than expected. Jetpack Compose is Android’s system for building screens, and skipping means avoiding an unnecessary redraw.

In plain words
What is it for?
Diagnosing unstable UI state, collection parameters, compiler reports, and recomposition issues in Kotlin and Jetpack Compose projects.
Why use it?
It replaces guesswork with checks of compiler reports, parameter comparisons, object creation, and Kotlin’s strong-skipping behavior.

Skill for Claude CodeCodex

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/ashtanko/compose-android-template/compose-stability-diagnostics
Any agent
npx skills add ashtanko/compose-android-template --skill compose-stability-diagnostics
Clone the repo
git clone --depth 1 https://github.com/ashtanko/compose-android-template

Made for: Claude Code, Codex.

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 compose-stability-diagnostics

README.md
[![agentmods](https://agentmods.dev/badge/skills/ashtanko/compose-android-template/compose-stability-diagnostics.svg)](https://agentmods.dev/skills/ashtanko/compose-android-template/compose-stability-diagnostics)
Your own site
<a href="https://agentmods.dev/skills/ashtanko/compose-android-template/compose-stability-diagnostics"><img src="https://agentmods.dev/badge/skills/ashtanko/compose-android-template/compose-stability-diagnostics.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,662 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.01662
Opus 5 $0.00022 $0.00831
Sonnet 5 $0.00009 $0.00332
Haiku 4.5 $0.00004 $0.00166

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

Security

Grade A, and why

compose-stability-diagnostics 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 3d 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/skills/compose-stability-diagnostics/SKILL.md · 172 lines

How it starts

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

Compose stability diagnostics

Core principle

Compose parameter fixes start from evidence. First identify the compiler mode and the parameter comparison behavior, then change the model or call site that is actually defeating skipping.

With Kotlin 2.0.20+ strong skipping is enabled by default. Unstable parameters no longer automatically make restartable composables non-skippable, but unstable parameters compare by instance identity (===) while stable parameters compare by equality (equals). Churny unstable instances can still defeat skipping.

Diagnostic procedure

  1. Confirm the symptom: recomposition counts, compiler report output, or a suspected churny parameter.
  2. Identify compiler mode: Kotlin/Compose compiler version and whether strong skipping is enabled.
  3. Generate or read the Compose compiler reports for the shipped variant.
  4. For each suspicious parameter, decide whether the problem is stability semantics, instance churn, or a caller-created lambda/derived value.
  5. Apply the lightest fix that makes the type/call site truthful.
  6. Re-measure the same interaction or re-read the same report before claiming the issue is fixed.

1. Interpret strong skipping first

On Kotlin 2.0.20+, strong skipping is enabled by default. In that mode:

  • Restartable composables are skippable even when parameters are unstable, unless explicitly opted out.
  • Stable parameters compare with equals.
  • Unstable parameters compare with instance equality (===).
  • Lambdas inside composables are automatically remembered based on captures.

Ask: "will these parameters compare the way I expect, and are callers creating new unstable instances every frame?"

For older compiler setups or strong skipping disabled, the legacy rule still matters: a restartable composable with unstable parameters may be restartable but not skippable.

2. Generate compiler reports

With Kotlin 2.0+ the Compose Compiler is configured through the Kotlin Gradle plugin:

plugins {
    alias(libs.plugins.android.application) // or android.library / jvm
    alias(libs.plugins.kotlin.android)      // or kotlin.multiplatform / kotlin.jvm
    alias(libs.plugins.compose.compiler)
}

if (providers.gradleProperty("composeReports").orNull == "true") {
    composeCompiler {
        reportsDestination = layout.buildDirectory.dir("compose_compiler")
        metricsDestination = layout.buildDirectory.dir("compose_compiler")
    }
}

Read the full file on GitHub · 172 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. 3d ago First seen · 172 lines · 43 tokens per session scan A ba9e5581d70e

Subscribe to this mod's changes

compose-stability-diagnostics is a skill published in the GitHub repository ashtanko/compose-android-template (10 stars, last pushed 6d ago), licensed MIT. It adds 43 tokens to every session and 1,662 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

migrating-to-modifier-node

Use this skill to author new custom Jetpack Compose modifiers and migrate legacy ones from Modifier.composed { } to Modifier.Node + ModifierNodeElement . Covers the persistent-node lifecycle (onAttach, onDetach, onReset, coroutineScope), the specialized node interfaces (DrawModifierNode, LayoutModifierNode…

skydoves/compose-performance-skills · 183 tokens

setting-up-compose-hotswan

Use this skill to install and verify Compose HotSwan end to end so a developer goes from zero to working sub-second hot reload on a real device or emulator in one session. Covers the JetBrains IDE plugin install, the com.github.skydoves.compose.hotswan.compiler Gradle plugin wiring, the canonical hotSwanCompiler {…

skydoves/compose-performance-skills · 161 tokens

configuring-lazy-prefetch

Use this skill to tune Jetpack Compose lazy-layout prefetch with LazyLayoutCacheWindow (Compose Foundation 1.9+, @ExperimentalFoundationApi) and pausable composition in prefetch (Compose Foundation 1.10+, default on). Covers configurable Dp-based ahead/behind cache windows plumbed through…

skydoves/compose-performance-skills · 177 tokens

collecting-flows-safely

Use this skill to migrate Compose UI from collectAsState() to collectAsStateWithLifecycle(), hoist Flow parameters out of composables, and apply .conflate() / .distinctUntilChanged() / snapshotFlow so background CPU and battery stop draining and chatty flows stop invalidating the UI per emission. Covers ViewModel…

skydoves/compose-performance-skills · 166 tokens

using-efficient-effects

Use this skill to choose the cheapest correct effect API in Jetpack Compose — LaunchedEffect, DisposableEffect, SideEffect, rememberUpdatedState, and skydoves/compose-effects' RememberedEffect and ViewModelStoreScope. Covers stale-callback bugs in long-lived LaunchedEffect, setup/teardown for non-coroutine…

skydoves/compose-performance-skills · 145 tokens

iterating-with-ai-and-mcp

Use this skill to drive Compose HotSwan from an AI agent (Claude Code, Cursor, any MCP client) so the agent can edit a Kotlin file, trigger a hot reload, capture a device screenshot, evaluate the result against a design intent, and iterate without a human in the loop. Covers the seven HotSwan MCP tools…

skydoves/compose-performance-skills · 202 tokens