# Android Jetpack Compose

> Standards for Declarative UI, State Hoisting, and Performance

- Skill: `majiayu000/android-jetpack-compose-2` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/android-jetpack-compose-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/android-jetpack-compose-2/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/android-jetpack-compose-2

---


# Jetpack Compose Standards

## **Priority: P0**

## Implementation Guidelines

### State Hoisting

- **Pattern**: `Screen` (Stateful) -> `Content` (Stateless).
- **Events**: Pass lambda callbacks down (`onItemClick: (Id) -> Unit`).
- **Dependencies**: NEVER pass ViewModel to stateless composables.

### Performance

- **Recomposition**: Use `@Stable` / `@Immutable` on UI Models.
- **Lists**: Always use `key` in `LazyColumn` / `LazyRow`.
- **Modifiers**: Reuse Modifier instances or extract to variables if stable.

### Theming (Material 3)

- **Tokens**: Use `MaterialTheme.colorScheme` and `MaterialTheme.typography`.
- **Hardcoding**: `**No Hardcoded Colors**: Use Theme.`

## Anti-Patterns

- **Side Effects**: `**No SideEffects in Composition**: Use LaunchedEffect.`
- **ViewModel pass-through**: `**No VM deep pass**: Hoist state.`

## References

- [Patterns & Optimization](references/implementation.md)

