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 collecting-flows-safelygit 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/collecting-flows-safely)<a href="https://agentmods.dev/skills/skydoves/compose-performance-skills/collecting-flows-safely"><img src="https://agentmods.dev/badge/skills/skydoves/compose-performance-skills/collecting-flows-safely/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/collecting-flows-safely"><img src="https://agentmods.dev/badge/skills/skydoves/compose-performance-skills/collecting-flows-safely.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.00166 | $0.02907 |
| Opus 5 | $0.00083 | $0.01453 |
| Sonnet 5 | $0.00033 | $0.00581 |
| Haiku 4.5 | $0.00017 | $0.00291 |
Grade A, and why
collecting-flows-safely 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 10d 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 — 215 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Collecting Flows Safely — keep upstream work tied to the UI lifecycle
collectAsState() keeps collecting whenever the composable is in composition, including while the app is backgrounded — that wastes CPU and battery. collectAsStateWithLifecycle() ties collection to a Lifecycle.State (default STARTED) so backgrounding pauses upstream work. For chatty flows, pair the consumer with .conflate() and .distinctUntilChanged() so Compose only sees meaningful changes. Skydoves hot take #4: a Flow<T> parameter on a composable is unstable and blocks skipping for the whole composable — collect at the caller and pass the resolved value.
When to use this skill
- A
ViewModelorRepositoryexposesStateFlow<T>,SharedFlow<T>, or a coldFlow<T>to a Compose screen. - The user reports background battery drain, "the screen keeps working when the app is in the recents tray", or wakelock noise on logcat.
- A composable consumes sensor data, location, GPS, websocket, or animation frames coming from outside Compose.
- A composable's signature is
fun MyScreen(state: Flow<State>)(Flow-as-parameter antipattern). - The user asks about
collectAsStatevscollectAsStateWithLifecycle, or aboutLifecycle.State.STARTED/RESUMEDsemantics. - The user wants Compose state to drive a non-Compose subscriber (analytics on visible item index, etc.) — that is the State→Flow direction served by
snapshotFlow.
When NOT to use this skill
- The flow is constructed and consumed entirely inside one composable's
remember { ... }block — that is composition-internal state, prefermutableStateOfdirectly. See../using-efficient-effects/SKILL.mdfor choosing the right effect API. - The data source is already
State<T>(e.g.mutableStateOf,Animatable.asState()) — do not wrap it in a flow just to callcollectAsStateWithLifecycle(). - A truly always-on background listener that must run while the Activity is
STOPPED. Move that work to aService/WorkManager/repeatOnLifecyclein the Activity, not into Compose.
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.
- 10d ago First seen · 215 lines · 166 tokens per session scan A 8a90d3f8c95e
collecting-flows-safely is a skill published in the GitHub repository skydoves/compose-performance-skills (499 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 166 tokens to every session and 2,907 once invoked, about $0.0008 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.
Other skills, from other repositories
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…
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.
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.
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).
compose-side-effects
Use when writing or reviewing Jetpack Compose code with LaunchedEffect, DisposableEffect, SideEffect, rememberCoroutineScope, rememberUpdatedState, snapshotFlow, snackbar, navigation, focus requests, analytics, or event Flow collection.
deliver-android-feature
Implement an Android feature from a specification or acceptance criteria through architecture, production code, formatting, unit tests, JVM integration tests, local Compose behavior tests, screenshot matrices, managed-device integration tests, end-to-end coverage, and final verification. Use when adding or…