Agent skill · Android Skills
/migrate-xml-views-to-jetpack-compose Convert one XML layout to Compose with visual parity
This skill moves a single XML layout to Jetpack Compose through a fixed ten-step process. The agent picks or confirms a candidate, studies it, writes a plan, captures how the old screen looks, sets up only the Compose dependencies and theming it needs, rebuilds the layout with a preview, swaps call sites through interop APIs, compares against the baseline and then removes the unused XML.
Works with
- Android CLI
- Claude Code
- Codex
Used forAndroid, Expo and React Native
When to use it
- You are adopting Compose screen by screen in a View-based app.
- You want help choosing which XML layout to migrate first.
- You need the new composable to look the same as the old view.
How it works
- 1Pick and analyse
The agent uses the user's choice or finds the best candidate, then audits its hierarchy and project context.
- 2Plan and capture
It writes a plan for approval and gets a baseline image, either from the user or from a screenshot test run on an emulator.
- 3Set up minimally
Compose dependencies are added if missing, and only the theming this layout needs is ported, leaving XML themes in place.
- 4Rebuild and swap
The layout is rewritten in Compose with a preview, and call sites use Compose-in-Views or Views-in-Compose interop.
- 5Validate and clean up
The preview is compared with the baseline until they match, a Compose UI test is written and unreferenced XML is deleted.
What it steers the agent away from
- Migrating the whole app theme for one screen.
- Deleting resources that other parts of the project still use.
- Shipping a composable that has never been compared with the original.
Install this skill
It installs with the Android Skills pack.
Android CLI (detected agents)--all installs every skill for each detected agent (Gemini and Antigravity if none are found), while --project puts one skill in a given folder.
android skills add --all
android skills add r8-analyzer --project=.
android skills update --allClaude CodeInstalls the collection as a Claude Code plugin.
/plugin marketplace add android/skills
/plugin install android-skills@android-skillsCodexInstalls the collection as a Codex plugin.
codex plugin marketplace add android/skills
codex plugin add android-skills@android-skillsCommands come from the author’s README; check it for changes before you run them.
Questions
Does it migrate logic too?
No. The skill states it migrates the UI only, from XML to Compose.
Can it run without user interaction?
Yes. When interaction is not supported it follows its own plan and uses an emulator screenshot test for the baseline if it can run one.
More guides from Android Skills
/android-cliLet the agent drive Android devices with the android CLITeaches the agent the android command line for projects, SDK packages, emulators, UI dumps, screenshots, docs and journey tests.Read the guide →/jetpack-compose-performanceFind and fix the Compose code that drops framesAudits Compose code for recomposition, layout, lazy list, animation, effect and drawing costs that cause dropped frames.Read the guide →/r8-analyzerFind redundant and overly broad R8 keep rulesRuns R8 configuration analysis and reports redundant, overly broad or subsumed keep rules without editing the project.Read the guide →/play-billing-library-version-upgradeUpgrade Play Billing Library without missing breaking changesUpgrades Play Billing Library to the latest stable release, in two-version steps when the app is far behind.Read the guide →/edge-to-edgeMake a Compose app edge-to-edge without hidden buttonsMakes every Activity in a Compose app edge-to-edge and fixes insets, keyboard overlap and system bar legibility.Read the guide →/testing-setupSet up a complete testing strategy for an Android appAssesses an app's test setup, then adds dependency injection for tests, unit, UI, screenshot and end-to-end tests and coverage.Read the guide →
Also in this pack
/agp-9-upgradeMigrates an Android project to Android Gradle Plugin 9 after first checking the current version, excluding Kotlin Multiplatform projects.↗/cameraxGuides CameraX work such as preview, capture and recording lifecycles, Camera2 interop and ML Kit or Media3 effects.↗/android-for-cars-parked-appsAdapts video, game and browser apps to run while parked on Android Auto and Automotive OS within car app quality rules.↗/appfunctionsFinds app workflows worth exposing as AppFunctions and generates the Kotlin code and KDoc so agents and shortcuts can call them.↗/ml-kit-genai-prompt-apiAdds the ML Kit GenAI Prompt API for on-device Gemini Nano requests, with structured output and prefix caching.↗/mlkit-agent-apiBuilds on-device agent loops with the ML Kit GenAI Agent API, AgentSession chat and AppFunctions tool calling.↗/restore-credentialsImplements Restore Credentials with Credential Manager so users are signed back in silently on a new device.↗/verified-emailAdds OTP-free verified email retrieval through Credential Manager digital credentials during sign-up.↗/ink-app-builderAdds stylus and touch drawing with Jetpack Ink, including stock brushes, erasing, undo and redo and Room persistence.↗/ink-custom-brush-builderWrites custom Jetpack Ink BrushFamily definitions with tip shapes, input behaviours, layered coats and textures.↗/litert-lmBuilds an Android chat, summary or extraction feature on an on-device open LLM via LiteRT-LM, from model download to streamed Compose UI.↗/litert-runtimeSets up .tflite inference with the LiteRT CompiledModel API on CPU or GPU, including migration from the old Interpreter.↗
Summary by trendhub. The skill itself lives in android/skills/jetpack-compose/migration/migrate-xml-views-to-jetpack-compose by Android (Apache-2.0); read the full, current text there.