amethyst: Skill for Claude Code

.claude/skills/compose-side-effects/SKILL.md

compose-side-effects is a skill for Claude Code from vitorpamplona/amethyst. It costs 62 tokens per session (1,585 once invoked), scanned A, original, MIT.

Guidance for handling work that affects the outside world in Jetpack Compose, Android's toolkit for building screens. It explains when to use Compose effect APIs, which run work alongside the screen's lifecycle.

In plain words
What is it for?
Use it when writing or reviewing Compose code involving delayed work, event streams, listeners, snackbars, focus, navigation, analytics, or cleanup.
Why use it?
It prevents network requests, listeners, analytics, navigation, and similar work from running incorrectly when Compose redraws a screen.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is vitorpamplona/amethyst's own configuration. It tells Claude Code how to work on amethyst itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything amethyst configures →

About the project

Amethyst is an Android client for Nostr, a social network protocol that lets people control their own social activity and connections. People use it to read and publish Nostr content, follow accounts, and exchange encrypted direct messages from Android and other supported platforms. The catalogue add-ons support workflows for developing or operating the client.

vitorpamplona/amethyst · 1,595 stars · on GitHub · amethyst.social

Reuse

Borrowing it

Nothing to install: this file belongs to vitorpamplona/amethyst. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/vitorpamplona/amethyst/main/.claude/skills/compose-side-effects/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/vitorpamplona/amethyst

Made for: Claude Code.

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-side-effects

README.md
[![agentmods](https://agentmods.dev/badge/skills/vitorpamplona/amethyst/compose-side-effects.svg)](https://agentmods.dev/skills/vitorpamplona/amethyst/compose-side-effects)
Your own site
<a href="https://agentmods.dev/skills/vitorpamplona/amethyst/compose-side-effects"><img src="https://agentmods.dev/badge/skills/vitorpamplona/amethyst/compose-side-effects.svg" alt="Measured on agentmods" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,585 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.00062 $0.01585
Opus 5 $0.00031 $0.00792
Sonnet 5 $0.00012 $0.00317
Haiku 4.5 $0.00006 $0.00159

Measured 8d ago against content hash 6d55e6388518, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

compose-side-effects 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 8d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.claude/skills/compose-side-effects/SKILL.md · 174 lines

How it starts

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

Compose: side effects

Core principle

Composable bodies describe UI. They can be recomposed, skipped, or abandoned. Work that changes the outside world belongs in an effect API whose lifecycle matches the work.

Pick the smallest effect

Need API
Publish Compose state to non-Compose code after every successful recomposition SideEffect
Register/unregister a listener, callback, observer, or resource DisposableEffect(keys...)
Run suspending, deferred, or keyed one-shot work LaunchedEffect(keys...)
Launch suspending work from a user event callback rememberCoroutineScope()
Convert Compose snapshot reads into a Flow inside a coroutine snapshotFlow { ... } inside LaunchedEffect

Effect keys

Keys define restart identity. When any key changes, the old effect is cancelled/disposed and a new one starts.

// ✅ Restart collection when userId changes
LaunchedEffect(userId) {
    repository.events(userId).collect { event -> handle(event) }
}

// ❌ Unit hides a changing input; collection keeps using the first userId
LaunchedEffect(Unit) {
    repository.events(userId).collect { event -> handle(event) }
}

Use stable, semantic keys:

  • Use the thing whose lifecycle the effect follows: userId, screenId, lifecycleOwner, focusRequester.
  • Do not use broad objects (state, viewModel) when only one property matters.
  • Do not add changing lambdas as keys unless you really want restarts on every lambda change.

Avoid stale captures

For long-running effects that should not restart but need the latest callback or value, use rememberUpdatedState.

@Composable
fun Timeout(onTimeout: () -> Unit) {
    val latestOnTimeout by rememberUpdatedState(onTimeout)

    LaunchedEffect(Unit) {
        delay(1_000)
        latestOnTimeout()
    }
}

Use this when the lifecycle is "start once" but the invoked lambda should stay fresh. Common cases:

  • A timeout or splash effect should not restart when onTimeout changes, but it should call the latest callback.
  • A lifecycle observer should stay registered to the same owner, but invoke the latest onStart / onStop lambdas.
  • A long-running collector should keep its collection lifecycle, but call the latest event handler.

Read the full file on GitHub · 174 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. 8d ago First seen · 174 lines · 62 tokens per session scan A 6d55e6388518

Subscribe to this mod's changes

compose-side-effects is a skill published in the GitHub repository vitorpamplona/amethyst (1,595 stars, last pushed today), licensed MIT. It adds 62 tokens to every session and 1,585 once invoked, about $0.0003 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-30.

Related

Other skills, from other repositories

compose-animations

Use when writing or reviewing Jetpack Compose motion: visibility enter/exit, animating one property toward a target, color or size transitions, multiple properties from one state, switching composable content, or choosing between AnimatedVisibility, animateAsState, rememberTransition, AnimatedContent, and Crossfade.

chrisbanes/skills · 64 tokens

compose-focus-navigation

Use when writing or reviewing Jetpack Compose UI for TV, keyboard, desktop, accessibility focus, D-pad navigation, FocusRequester, focusProperties, key events, or initial focus behavior.

chrisbanes/skills · 41 tokens

kmp-lsp

Kotlin/Java/Swift LSP server for code navigation in Android and iOS codebases. Use when navigating Kotlin, Java, or Swift source files: finding class definitions, listing symbols, jumping to implementations, finding all usages, checking type signatures, or switching workspace between projects. Triggers for: "find this…

Hessesian/kmp-lsp · 114 tokens

compose-multiplatform

Use when building one shared Compose UI in Kotlin across Android, iOS, and desktop — commonMain @Composables, expect/actual, source-set placement, native interop, multiplatform ViewModel/navigation/Koin. NOT a single-platform native build (that is kotlin-android / swift-ios), and NOT Dart/Flutter cross-platform UI…

ericrisco/rsc-harness · 80 tokens

kotlin-android

Use when building or fixing a native Android app in Kotlin and Jetpack Compose on the UDF layered architecture — ViewModel/StateFlow, Hilt, Room, Retrofit, coroutines, type-safe Navigation, and the Gradle/AGP surface. NOT shared Android and iOS UI from one Kotlin codebase (that is compose-multiplatform).

ericrisco/rsc-harness · 78 tokens

kotlin-expert

Expert-level Kotlin development, Android, coroutines, and multiplatform. Use when the user mentions Android, coroutines, multiplatform, or JVM, or when the task involves Kotlin Fundamentals, Android Development, Kotlin Multiplatform, or Kotlin Style.

personamanagmentlayer/pcl · 55 tokens