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.
npx skills add skydoves/compose-performance-skills --skill choosing-derivedstateofgit clone --depth 1 https://github.com/skydoves/compose-performance-skillsWrote 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.
[](https://agentmods.dev/skills/skydoves/compose-performance-skills/choosing-derivedstateof)<a href="https://agentmods.dev/skills/skydoves/compose-performance-skills/choosing-derivedstateof"><img src="https://agentmods.dev/badge/skills/skydoves/compose-performance-skills/choosing-derivedstateof/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.
<a href="https://agentmods.dev/skills/skydoves/compose-performance-skills/choosing-derivedstateof"><img src="https://agentmods.dev/badge/skills/skydoves/compose-performance-skills/choosing-derivedstateof.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00144 | $0.02775 |
| Opus 5.5 | $0.00058 | $0.01110 |
| Sonnet 5.5 | $0.00029 | $0.00555 |
| Haiku 4.5 | $0.00014 | $0.00278 |
Grade A, and why
choosing-derivedstateof 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 3mo 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.
How it starts
The opening of the file, as written. The whole thing — 194 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Choosing derivedStateOf — Filter Hot Inputs into Cold Outputs
derivedStateOf produces a State whose readers only invalidate when the derived result changes, even if the input states change far more often. Use it when input frequency exceeds output frequency. Use it for any other shape and it is pure overhead — an extra snapshot subscription with no filtering benefit. This skill teaches Claude when to reach for it, when to refuse, and how to avoid the canonical capture-by-initial-value pitfall.
When to use this skill
- The developer asks whether a value should be wrapped in
derivedStateOf. - A scroll position drives a boolean (
firstVisibleItemIndex == 0,scrollState.value > threshold, "show FAB on scroll"). - A high-frequency input (drag delta, animation progress) feeds a low-frequency output (boolean threshold, bucketed integer).
- A
derivedStateOfexists in the code but recomposition counts didn't drop, or the value never updates after the first composition (the capture-by-initial-value bug). - The developer wants a one-shot side effect (analytics, logging, snackbar) when a derived value flips.
When NOT to use this skill
- The state read is in the wrong phase (e.g.
Modifier.alpha(state.value)). Fix that with../deferring-state-reads/SKILL.mdfirst —derivedStateOfdoes not address phase issues. - Diagnosing whether a parameter is unstable. That is
../../stability/diagnosing-compose-stability/SKILL.md. - Input frequency equals output frequency (e.g.
"$first $last"from two name states).derivedStateOfis pure overhead in that case — use a direct read or a plainremember.
Prerequisites
- Familiarity with state-read-driven recomposition: a snapshot read inside a restartable composable subscribes that composable's restart scope to the state.
- Compose runtime ≥ 1.0 (the API is foundational; behavior described here is stable).
- Ability to confirm recomposition counts via Layout Inspector or
@TraceRecompositionfrom skydoves/compose-stability-analyzer.
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.
- 3mo ago First seen · 194 lines · 144 tokens per session scan A 9c54c81c0e1e
choosing-derivedstateof is a skill published in the GitHub repository skydoves/compose-performance-skills (536 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 144 tokens to every session and 2,775 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.
choosing-derivedstateof compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| choosing-derivedstateofskydoves/compose-performance-skills | Skill | 536 | 5mo ago | Apache-2.0 | A | 144 | Claude Code, Codex |
| claude-android-ninjaDrjacky/claude-android-ninja | Skill | 143 | 2mo ago | Apache-2.0 | A | 123 | Claude Code, Codex |
| rebrandmykola-kichatov/android-clean-template | Skill | 54 | 1mo ago | none | C | 89 | Claude Code |
| sceneviewsceneview/sceneview | Skill | 1.4k | today | Apache-2.0 | A | 71 | Claude Code, Codex |
| sceneview-iossceneview/sceneview | Skill | 1.4k | today | Apache-2.0 | A | 71 | Claude Code, Codex |
| compose-animationschrisbanes/skills | Skill | 1.2k | 2d ago | Apache-2.0 | A | 67 | Claude Code |
| compose-focus-navigationchrisbanes/skills | Skill | 1.2k | 2d ago | Apache-2.0 | A | 41 | Claude Code |