compose-side-effects

Audit Jetpack Compose side effects for correct lifecycle semantics and keying.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/soygabimoreno/Los-ANDROIDES --skill compose-side-effects
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compose-side-effects
Source: https://github.com/soygabimoreno/Los-ANDROIDES/tree/main/.agents/skills/compose-side-effects
Command: npx skills add https://github.com/soygabimoreno/Los-ANDROIDES --skill compose-side-effects

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you write Jetpack Compose code that triggers imperative work (events, subscriptions, navigation, analytics, focus actions) at the right time without causing extra work, stale callbacks, or bugs from incorrect effect keying.

Core Features & Use Cases

  • Correct effect selection: Use SideEffect, DisposableEffect, LaunchedEffect, rememberCoroutineScope, rememberUpdatedState, and snapshotFlow for the appropriate lifecycle and work type.
  • Lifecycle-accurate keys: Choose keys that represent when the work should restart, preventing LaunchedEffect(Unit) capture bugs and collection restarts at unintended times.
  • Stale capture prevention: Keep long-running effects stable while still calling the latest callbacks through rememberUpdatedState.

Quick Start

Use the compose-side-effects skill to audit your screen’s event Flow collection, focus/analytics triggers, and listener registration so each effect uses the smallest appropriate API and stable, semantic keys.

Frequently Asked Questions about compose-side-effects

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent stale callbacks in Jetpack Compose LaunchedEffect?

To prevent stale callbacks in Jetpack Compose LaunchedEffect, use `rememberUpdatedState` to keep long-running effects stable while still calling the latest callbacks without restarting the effect's lifecycle.

When should I use DisposableEffect vs LaunchedEffect for side effects?

Use `DisposableEffect` for side effects requiring proper cleanup, like listener registration, and `LaunchedEffect` for coroutine-based work like Flow collection. Both ensure imperative Compose work runs with correct lifecycle semantics.

Why does my Jetpack Compose event Flow collection restart unintentionally?

Jetpack Compose event Flow collection restarts unintentionally when using unstable or incorrect effect keys. Choose lifecycle-accurate keys that represent when the work should restart to prevent unintended collection triggers and duplicate execution.

How do I sample Compose snapshot state changes into a Flow?

To sample Compose snapshot state changes into a Flow, use the `snapshotFlow` API inside your composable. This converts snapshot reads into a Flow, allowing you to react to UI state changes with proper lifecycle management.

Can I trigger navigation or snackbar events correctly inside a composable?

Yes, you can trigger navigation or snackbar events correctly inside a composable by selecting the appropriate effect API. This ensures imperative UI triggers run accurately without causing extra work or lifecycle bugs.

What is the best way to run analytics logging in Jetpack Compose?

The best way to run analytics logging in Jetpack Compose is by using the correct effect API with stable, semantic keys. This ensures logging work executes at the right time without duplicate execution or stale callback bugs.