Install
$ agentstack add skill-liuyi0808-android-review-compose-ui ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Compose UI Best Practices
Provide guidance and review for Jetpack Compose UI code following Material 3 design patterns and modern Android conventions.
Review Process
Evaluate Compose code against ALL categories. Output findings as:
[COMPOSE-XXXXX] severity: CRITICAL | HIGH | MEDIUM | LOW
Finding:
Location:
Fix:
Reference Guide — Load on Demand
Each reference file contains full code examples and patterns. Read the relevant file when reviewing that area.
| # | Reference File | Content | When to Load | |---|---------------|---------|-------------| | 1 | [references/state-and-effects.md](references/state-and-effects.md) | State hoisting, rememberSaveable, collectAsStateWithLifecycle, LaunchedEffect, DisposableEffect, SideEffect | Reviewing state management or side effects | | 2 | [references/navigation.md](references/navigation.md) | Type-safe navigation, back stack, navigation events | Reviewing navigation setup | | 3 | [references/theming.md](references/theming.md) | Material 3 tokens, dynamic colors, custom extensions | Reviewing theme or color usage | | 4 | [references/accessibility.md](references/accessibility.md) | Content descriptions, touch targets, semantics merging | Reviewing accessibility compliance | | 5 | [references/layout-and-animation.md](references/layout-and-animation.md) | WindowSizeClass, responsive layout, AnimatedVisibility, animateXAsState | Reviewing layout or animation code |
Rules Summary
State Management
- State ownership: state hoisted to the lowest common ancestor.
- Use
rememberSaveablefor state that survives configuration changes. - Complex state belongs in ViewModel, exposed as
StateFlow. See architecture skill for ViewModel implementation patterns. - ALWAYS use
collectAsStateWithLifecycle()(NOTcollectAsState()). - Use sealed interface for UI state.
Side Effects
LaunchedEffectfor coroutine-based side effects.DisposableEffectfor cleanup-requiring side effects.SideEffectfor non-suspend side effects on every successful recomposition.rememberCoroutineScopefor event-triggered coroutines.- NEVER launch coroutines directly in Composable body.
Navigation
- Use type-safe navigation (Navigation Compose 2.8+).
- Navigate with
popUpToto avoid back stack buildup. - NEVER pass complex objects as navigation arguments. Pass IDs, fetch in destination.
- One-time navigation events via Channel/SharedFlow. See architecture skill for event channel pattern.
Theming & Material 3
- Use Material 3 tokens, NEVER hardcoded colors.
- Support dynamic colors (Android 12+).
- Define custom theme extensions via
CompositionLocal. - Use
MaterialTheme.typographyfor text styles, NEVER hardcoded sizes.
Accessibility
- ALL interactive elements MUST have content descriptions.
- Decorative elements use
nullcontentDescription. - Minimum touch target: 48dp x 48dp.
- Merge semantics for grouped content.
- Use
Modifier.clearAndSetSemanticsfor custom announcements. - State descriptions for toggles.
Responsive Layout
- Use
WindowSizeClassfor adaptive layouts. - Use
Modifier.fillMaxWidth()with constraints, not fixed widths. - Use
BoxWithConstraintsfor constraint-dependent layouts.
Animation
- Use
animateXAsStatefor simple value animations. - Use
AnimatedVisibilityfor enter/exit. - Use
AnimatedContentfor content transitions. - ALWAYS provide
labelparameter for animations. - Use
Modifier.graphicsLayerfor GPU-accelerated transforms.
Checklists
State Management
- [ ] UI state exposed as StateFlow from ViewModel
- [ ] collectAsStateWithLifecycle used (not collectAsState)
- [ ] Composable parameters are stable/immutable
- [ ] State hoisted to appropriate level
- [ ] rememberSaveable for user input that survives rotation
- [ ] Sealed interface for screen state
Side Effects
- [ ] No coroutine launches outside side effect handlers
- [ ] LaunchedEffect keys match the data they depend on
- [ ] DisposableEffect used when cleanup is needed
- [ ] rememberCoroutineScope for user-triggered actions
Navigation
- [ ] Type-safe navigation routes (Serializable objects)
- [ ] No complex objects passed as arguments
- [ ] Back stack managed properly (popUpTo where needed)
- [ ] One-time events use Channel, not StateFlow
Theming & Material 3
- [ ] No hardcoded colors (use colorScheme tokens)
- [ ] No hardcoded text sizes (use typography tokens)
- [ ] Dark theme supported
- [ ] Dynamic colors supported (Android 12+)
- [ ] Custom tokens use CompositionLocal
Accessibility
- [ ] All clickable elements have contentDescription
- [ ] Touch targets >= 48dp
- [ ] Semantics merged for logical groups
- [ ] Screen reader tested (TalkBack)
- [ ] Sufficient color contrast (4.5:1 for text)
Animation
- [ ] Animations use appropriate API (animateXAsState, AnimatedVisibility, etc.)
- [ ] All animations have label parameter
- [ ] No infinite animations without user control
- [ ] Animations respect
prefers-reduced-motionaccessibility setting - [ ] Complex animations use
Transitionfor coordination
Component Design Principles
Composable Function Signature Convention
@Composable
fun MyComponent(
// 1. Required data parameters
title: String,
items: ImmutableList,
// 2. Optional data parameters with defaults
subtitle: String = "",
// 3. Event callbacks
onClick: () -> Unit,
onItemSelected: (Item) -> Unit,
// 4. Modifier (always last with default)
modifier: Modifier = Modifier
) {
// Implementation
}
Preview
@Preview(showBackground = true)
@Preview(showBackground = true, uiMode = UI_MODE_NIGHT_YES)
@Preview(showBackground = true, device = Devices.TABLET)
@Composable
private fun MyComponentPreview() {
AppTheme {
MyComponent(
title = "Preview Title",
items = persistentListOf(Item("1", "Sample")),
onClick = {},
onItemSelected = {}
)
}
}
Component Checklist
- [ ] Modifier is last parameter with default
- [ ] Previews for light/dark/tablet
- [ ] Stateless where possible (state hoisted)
- [ ] Parameters are stable types
For ViewModel implementation patterns, see the architecture skill. For performance optimization of Compose recomposition, see the performance skill.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: liuyi0808
- Source: liuyi0808/android-review
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.