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 agentmods add rules/roninforge/roninforge-kotlin-compose/compose-performancegit clone --depth 1 https://github.com/RoninForge/roninforge-kotlin-composeWhat 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 | $0.00000 | $0.01091 |
| Opus 5 | $0.00000 | $0.00545 |
| Sonnet 5 | $0.00000 | $0.00218 |
| Haiku 4.5 | $0.00000 | $0.00109 |
Grade A, and why
compose-performance 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 2d 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 — 152 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Compose Performance
Strong skipping (Kotlin 2.x default)
Since Compose Compiler ships with Kotlin 2.0+, strong-skipping is on by default. Most composables skip recomposition for unstable parameters automatically. Stability annotations matter less than they did, but still help in two cases:
- Data classes the compiler cannot prove immutable (because a parameter is from another module).
- Collections (
List<T>,Map<K, V>) which are unstable even when contents are immutable - mark wrappers with@Immutable.
@Immutable
data class UserCard(
val id: String,
val name: String,
val tags: List<String>,
)
@Stable says: "I will notify Compose when I mutate." @Immutable says: "I never mutate."
Recomposition keys
The key list of LaunchedEffect, remember, produceState, DisposableEffect controls when the block re-runs. Always pass the actual dependencies; never true or Unit as a shortcut.
// BAD - never re-runs even when userId changes
LaunchedEffect(true) { vm.load(userId) }
// CORRECT
LaunchedEffect(userId) { vm.load(userId) }
remember with multiple keys
// Re-compute only when input or filter changes
val filtered = remember(items, filter) {
items.filter { it.matches(filter) }
}
derivedStateOf for cheap reads on expensive state
val showFab by remember {
derivedStateOf { listState.firstVisibleItemIndex > 0 }
}
derivedStateOf reduces recomposition triggers by deriving a smaller surface from a larger state. Use when many composables read a coarse state but most do not care about every change.
Deferred reads with lambda parameters
// BAD - reads state at the calling composable's recomposition scope
@Composable
fun BadList(items: List<Item>) {
items.forEach { Row(item = it) }
}
// CORRECT - lambda defers the read into Row's scope
@Composable
fun GoodList(itemsProvider: () -> List<Item>) {
val items = itemsProvider()
LazyColumn { items(items, key = { it.id }) { Row(item = it) } }
}
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.
- 2d ago First seen · 152 lines · 0 tokens per session scan A a2fdadfddaef
compose-performance is a cursor rule published in the GitHub repository RoninForge/roninforge-kotlin-compose (1 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,091 tokens. 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.
Other cursor rules, from other repositories
tailwind-v4-anti-patterns
Tailwind CSS v4 anti-pattern detection. Prevents the most common AI-generated mistakes: version mixing, deprecated config patterns, and removed utilities.
tailwind-v4-config
Tailwind CSS v4 configuration rules for CSS and build tool files. Covers @theme, @source, @import, PostCSS, and Vite plugin setup.
tailwind-v4-core
Core Tailwind CSS v4 rules. Enforces correct v4 syntax and prevents common v3 fallbacks. Attach to all conversations involving Tailwind CSS.
tailwind-v4-migration
Tailwind CSS v3-to-v4 migration rules. Activated when the agent determines migration work is needed. Covers step-by-step upgrade process, common pitfalls, and automated migration tooling.
tailwind-v4-utilities
Tailwind CSS v4 utility class rules for template and markup files. Covers renamed classes, new utilities, container queries, gradients, and accessibility patterns.
android-project
Core behavior rules for AI agents working on this Android project.