guillemroca/agent-skills-android/android-ui-engineering
Claude Code and agent skill by guillemroca/agent-skills-android
- community
Checking that the SKILL.md file is still in the repository.
Use when building UI with Jetpack Compose. Covers component design, state hoisting, recomposition optimization, Material 3 theming, Navigation 3, adaptive layouts for large screens, previews, screenshot verification, and XML interop.
Install
npx vskill@latest install guillemroca/agent-skills-android/android-ui-engineeringSKILL.md
The same SKILL.md was published earlier as guillemroca/agent-skills-android/android-ui-engineering.
Android UI Engineering
Overview
Build production-quality Android UI with Jetpack Compose. This skill covers component architecture, state management, Material 3 theming, navigation, performance optimization (recomposition), accessibility, and interoperability with legacy XML views.
When to Use
- Building new screens or UI components with Compose
- Refactoring XML layouts to Compose
- Debugging recomposition or performance issues in Compose
- Implementing Material 3 design system
- Setting up navigation between screens
- Adapting layouts for tablets, foldables, and desktop windows
Skip when: Modifying non-UI code (repositories, use cases, data layer).
Core Process
Step 1: Component Architecture
- Stateless composables with state hoisting:
- Component rules:
- Single responsibility — one composable does one thing
- Accept `Modifier` parameter — always last with default
Modifier - Hoist state — push state up, push events down
- Stateless by default — only use
rememberwhen necessary - Composition over configuration — slots and lambdas over boolean flags
Step 2: State Management in Compose
- Collect state lifecycle-aware:
- Handle all states:
Step 3: Material 3 Theming
- Set up the theme:
- Use Material tokens, not hardcoded values:
Step 4: Navigation (Navigation 3)
Use Navigation 3 (androidx.navigation3:navigation3-runtime + navigation3-ui, stable) for new Compose apps. The back stack is state you own — no opaque NavController. For deep links, multiple back stacks, scenes, conditional flows, and Nav2→Nav3 migration, see android-skills:navigation-3 (optional Google companion plugin, see README).
- Navigation 3 setup:
- Navigation rules:
- The back stack (
rememberNavBackStack) lives in the navigation host; navigate by mutating it (add,removeLastOrNull) — it is aSnapshotStateList, soNavDisplayreacts automatically - Screens receive navigation callbacks (
onNavigateToDetail), never the back stack itself - Routes are
@Serializabletypes, not strings — arguments are constructor parameters - Multi-pane layouts use Nav3 Scenes via
androidx.compose.material3.adaptive:adaptive-navigation3(see Step 5) — two destinations can be visible at once, no dual-NavHost workarounds - Existing apps on Navigation 2: stay on type-safe routes (
@Serializabledestinations, Nav 2.8+) and migrate with the official Nav2→Nav3 guide (developer.android.com/guide/navigation/navigation-3/migration-guide) — seedeprecation-and-migration - Deep links: verify HTTPS App Links with
assetlinks.json+android:autoVerify="true"; validate every parameter of an inbound link before acting on it (seesecurity-and-hardening)
Step 5: Adaptive Layouts
- Drive layout off window size classes — never orientation or device type. Targeting API 37, this stops being optional:
screenOrientation/resizeableActivityrestrictions are ignored on displays ≥600dp, with no opt-out. Portrait-only apps get letterboxed into windows they never designed for.
- Adaptive rules:
- Compact (<600dp) and Medium: single pane; Expanded (≥840dp) and up: multi-pane via
ListDetailPaneScaffold/SupportingPaneScaffold - Edge-to-edge is the default (enforced targeting Android 15+): call
enableEdgeToEdge(), consumeWindowInsetsin scaffolds, never rely onstatusBarColor - Predictive back: use
PredictiveBackHandler/OnBackPressedDispatcher— never overrideonBackPressed()(default-on targeting 36+) - State survives size changes:
ViewModel+rememberSaveable, notconfigChangeshacks - Deeper guides:
android-skills:adaptive(pointer/keyboard input, Grid/FlexBox, Nav3 scenes) andandroid-skills:edge-to-edge(insets, IME, system bar legibility) (optional Google companion plugin, see README)
Step 6: Recomposition Optimization
- Avoid unnecessary recompositions:
- Recomposition debugging:
- Enable recomposition counts in Layout Inspector
- Use
@Stableannotation for classes that Compose should treat as stable - Use
ImmutableListfromkotlinx.collections.immutablefor list parameters
Step 7: Previews — and Verify Them
- Write previews for every screen and component:
- Previews are verifiable — look at what you built:
- Agent-side rendering:
android studio render-compose-preview --output-image-file=preview.png <file> <composable>renders a@Previewto PNG without a device, so you can inspect the UI you just wrote instead of assuming it looks right (requires a running Android Studio with Gemini; see../../references/android-cli-reference.md) - Screenshot tests: lock previews in with Compose Preview Screenshot Testing or Roborazzi so regressions fail CI — patterns in
../../references/testing-patterns.md, workflow inandroid-device-testing
Step 8: XML Interop (Legacy)
For a full screen-by-screen XML→Compose migration workflow, see android-skills:migrate-xml-views-to-jetpack-compose (optional Google companion plugin, see README).
- Compose in XML:
- XML in Compose:
Common Rationalizations
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/android-ui-engineering/SKILL.md
Popularity
- Repository stars
- 2
- 7-day trend score
- 5
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/guillemroca/agent-skills-android/android-ui-engineering)