skills/mobile/android-compose/SKILL.md
Jetpack Compose: @Composable, state hoisting, LazyColumn, Material 3, CompositionLocal, navigation-compose
npx skillsauth add alphaonedev/openclaw-graph android-composeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill equips the AI to generate and manipulate Android UI code using Jetpack Compose, focusing on declarative syntax for efficient, reactive interfaces. Use it to handle UI components, state management, and navigation in Android apps.
Apply this skill when building or refactoring Android apps that require modern UI patterns, such as dynamic lists, theme-aware designs, or screen navigation. Use it for new projects with Material 3 or to migrate from XML layouts to Compose for better performance and code simplicity.
To build a UI, start by creating a top-level @Composable function in your Activity or Fragment. Always hoist state to parent composables to enable proper recomposition. For lists, wrap items in LazyColumn to lazy-load content. Use MaterialTheme for styling and CompositionLocalProvider to inject values. When navigating, set up a NavHost with composable destinations.
Integrate Compose into an Android project by adding the Compose BOM in build.gradle: dependencies { implementation platform('androidx.compose:compose-bom:2023.10.01') implementation 'androidx.compose.ui:ui' implementation 'androidx.compose.material3:material3' }. Enable Compose in the module's build.gradle with composeOptions { kotlinCompilerExtensionVersion '1.4.7' }. For navigation, combine with ViewModel by injecting it via hilt or manual dependency. Use $ANDROID_HOME environment for SDK paths if needed, and set $COMPOSE_VERSION for custom versions in scripts.
Handle recomposition errors by ensuring state is hoisted; for example, if a composable crashes due to stale state, wrap it in a function that passes state as parameters. Common issues: Invalid changes during composition—use rememberUpdatedState for callbacks. For LazyColumn errors like IndexOutOfBounds, ensure data is loaded before rendering. Log errors with Log.e("ComposeError", "Message") and use try-catch in non-UI code. If navigation fails, check navController setup and routes; debug with Android Studio's Compose preview.
tools
Root web development: project structure, tooling selection, deployment decisions
development
WebAssembly: Rust/Go/C to WASM, wasm-bindgen, Emscripten, WASM Component Model
development
Vue 3: Composition API script setup, Pinia, Vue Router 4, SFCs, Vite, Nuxt 3
tools
Tailwind CSS 4: utility classes, config, JIT, arbitrary values, darkMode, plugins, shadcn/ui