hoangnguyen0403/android-compose-migration
Migrate an Android XML View to Jetpack Compose following a structured 10-step workflow. Use when converting XML layouts to Compose, setting up Compose in an existing View-based project, or incrementally adopting Compose.
npx skills add https://github.com/HoangNguyen0403/agent-skills-standard --skill android-compose-migration
Structured 10-step workflow for migrating XML layouts to Compose.
If the user specified a target XML layout, proceed to Step 2. Otherwise, pick the best candidate:
Examine the XML structure: list all Views, data bindings, click listeners, style references, and custom Views needing AndroidView wrappers.
Generate a checklist of every View → Composable mapping. Present to user for approval.
Ask the user for a screenshot, or take one via emulator for visual comparison.
Check build.gradle.kts or libs.versions.toml for Compose BOM and compiler. If missing, add them. See dependency setup.
If missing, initialize minimum required theme — map XML colors/styles to Compose. Do NOT migrate the entire theme.
Convert each View to its Compose equivalent. See interop patterns for the View→Composable mapping table, ComposeView, and AndroidView usage. Include a @Preview for every new Composable.
Use LazyColumn or LazyRow for list-heavy screens instead of flattening them into one large static composable.
Use ComposeView to host Compose in Views, or AndroidView for Views in Compose. See interop patterns.
Compare baseline screenshot with Compose Preview. Focus on layout and styling. Iterate until visual parity.
Delete the migrated XML file and legacy tests. Only remove code not referenced elsewhere.
./gradlew build succeeds.Take hoangnguyen0403/android-compose-migration from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.