ordering-modifier-chains

ordering-modifier-chains is a skill for Claude Code, Codex from skydoves/compose-performance-skills. It costs 156 tokens per session (3,484 once invoked), scanned A, original, Apache-2.0.

A guide to ordering Jetpack Compose Modifier calls, which control how Android UI elements are drawn, measured, clipped, and made interactive. The order changes which area each operation affects.

In plain words
What is it for?
Use it to diagnose and fix Modifier chains involving padding, backgrounds, clicks, clipping, sizing, transparency, or graphics layers. It helps determine the correct order for the intended UI behavior.
Why use it?
It explains bugs such as backgrounds covering the wrong space, taps reaching outside a button, or clipping failing to hide child content.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to diagnose and fix Modifier chains involving padding, backgrounds, clicks, clipping, sizing, transparency, or graphics layers. It helps determine the correct order for the intended UI behavior.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/skydoves/compose-performance-skills/ordering-modifier-chains
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.

Any agent
npx skills add skydoves/compose-performance-skills --skill ordering-modifier-chains
Clone the repo
git clone --depth 1 https://github.com/skydoves/compose-performance-skills

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 ordering-modifier-chains

README.md
[![agentmods](https://agentmods.dev/badge/skills/skydoves/compose-performance-skills/ordering-modifier-chains/github.svg)](https://agentmods.dev/skills/skydoves/compose-performance-skills/ordering-modifier-chains)
Your own site
<a href="https://agentmods.dev/skills/skydoves/compose-performance-skills/ordering-modifier-chains"><img src="https://agentmods.dev/badge/skills/skydoves/compose-performance-skills/ordering-modifier-chains/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ordering-modifier-chains

Your own site · 80×15
<a href="https://agentmods.dev/skills/skydoves/compose-performance-skills/ordering-modifier-chains"><img src="https://agentmods.dev/badge/skills/skydoves/compose-performance-skills/ordering-modifier-chains.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 156 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,484 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00156 $0.03484
Opus 5.5 $0.00062 $0.01394
Sonnet 5.5 $0.00031 $0.00697
Haiku 4.5 $0.00016 $0.00348

Measured 1mo ago against content hash 57b72424fb4f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ordering-modifier-chains 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 1mo 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.

modifiers/ordering-modifier-chains/SKILL.md · 231 lines

How it starts

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

Ordering Modifier Chains — Why padding(8.dp).background(Red) ≠ background(Red).padding(8.dp)

Modifier order matters because each modifier wraps the next as a function. Modifier.padding(8.dp).background(Red) shrinks constraints first, so the background paints INSIDE the padded region — the surrounding 8 dp margin has no red. Conversely, Modifier.background(Red).padding(8.dp) paints red across the parent's full bounds before insetting the content. Wrong order is the most common Compose UI bug after missing keys. This skill teaches Claude how to read a chain top-to-bottom and reorder it correctly.

When to use this skill

  • The developer asks "why does the click area extend past the visible button?", "why is my ripple bouncing on the wrong shape?", "why is the background painted in the wrong area?", or "does Modifier order matter?".
  • A code review shows a chain like Modifier.padding(...).clickable { }, Modifier.background(...).clip(...), or Modifier.alpha(state.value).graphicsLayer { }.
  • A button's tap target leaks into the surrounding padding, or the corner radius is not honored on the background.
  • A clip on a parent is failing to mask a child draw, or graphicsLayer { alpha = 0.5f } is half-applying to siblings.
  • The developer is considering hoisting a Modifier chain via remember { Modifier.… } "for perf".

When NOT to use this skill

  • The chain order is correct and the symptom is elsewhere (state read in the wrong phase, missing keys in a lazy layout). Diagnose with ../../recomposition/deferring-state-reads/SKILL.md or ../../lists/optimizing-lazy-layouts/SKILL.md first.
  • The custom modifier itself is the problem (composed { } legacy, missing diff) → see ../migrating-to-modifier-node/SKILL.md.
  • The question is whether to make a custom modifier — this skill assumes you already have a chain of built-ins and need to order them right.

Prerequisites

  • Basic familiarity with Modifier composition vocabulary (padding, background, clip, clickable, graphicsLayer).
  • Compose UI any supported version — modifier ordering semantics have been stable since 1.0.
  • A real-device, release build for any final perf claim about hoisting (skydoves hot take #5: debug builds lie).

Read the full file on GitHub · 231 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. 1mo ago First seen · 231 lines · 156 tokens per session scan A 57b72424fb4f

Subscribe to this mod's changes

ordering-modifier-chains is a skill published in the GitHub repository skydoves/compose-performance-skills (518 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 156 tokens to every session and 3,484 once invoked, about $0.0006 per session on Opus 5.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-30.

Related

Other skills, from other repositories

compose-performance

Use when investigating Jetpack Compose recomposition cost, compiler stability reports, skippability, unstable parameters, frame-rate State reads, cross-phase snapshot back-writing, or @ReadOnlyComposable contracts.

chrisbanes/skills · 42 tokens

media-playback-footguns

Media player traps on Media3/ExoPlayer and desktop engines: crossfade, audio focus, fades, loudness, DSP, queues and shuffle, position restore, service lifecycle, group listening. Use when playback state, queue or audio levels go wrong.

maxrave-dev/kotlin-footguns · 58 tokens

claude-android-ninja

Build and migrate Android apps with Kotlin, Jetpack Compose, MVVM, Hilt, Room 3 (KSP, SQLiteDriver, Flow/suspend DAOs), Navigation3, and multi-module Gradle. Use for new projects or modules, Compose screens and ViewModels, Room 3 and RemoteMediator, API 37 / targetSdk migration, Play Integrity client wiring…

Drjacky/claude-android-ninja · 123 tokens

webview-footguns

WebView traps across device classes: startup that freezes low-RAM phones, a killed renderer that takes the app with it, devices with no usable provider, AndroidView lifecycle and cookies. Use when a web screen freezes, vanishes or crashes only on some devices.

maxrave-dev/kotlin-footguns · 58 tokens

compose-stability-diagnostics

Use when writing or reviewing Jetpack Compose parameter stability, compiler reports, skippability, unstable UI state classes, collection parameters, or Kotlin 2.0+ strong skipping behavior.

ashtanko/compose-android-template · 43 tokens

compose-recomposition-performance

Use when investigating Jetpack Compose recomposition performance, skippable/restartable composables, composables.txt or compiler reports, Layout Inspector recomposition counts, back-writing snapshot state across phases, or frame-rate State reads in composition vs layout/draw, and it is not yet clear whether the cause…

ashtanko/compose-android-template · 78 tokens