Try migrating XML View to Jetpack Compose using Android CLI skills
This page has been translated by machine translation. View original
Since Android declared Compose First, I thought we might need to consider migrating to Jetpack Compose.
There's a skill called /migrate-xml-views-to-jetpack-compose that supports migration from XML Views to Jetpack Compose, so let me try it out.
Android CLI
To run the skill, I first needed to install the skill itself from the Android CLI, so I tried running it.
Since I'm using Claude Code, I specified --agent=claude-code.
android skills add migrate-xml-views-to-jetpack-compose --agent=claude-code
When executed, the /migrate-xml-views-to-jetpack-compose skill is added to ~/.claude/skills.
What's Inside the Skill
Reading the contents written in SKILL.md, there are instructions to execute the following steps:
- Identifying the best XML candidates for migration
- Analyzing the project and layouts
- Creating a plan
- Capturing XML View UI (screenshot)
- Setting up Compose dependencies and compiler
- Setting up Compose theme
- Migrating XML layouts to Compose
- Replacing usages
- Verifying the migration (screenshot comparison)
- Deleting XML code
Details were written here:
It seems to take screenshots before migration and compare them with Compose previews after migration to verify visual consistency (Amazing).
Running the Skill
Here are the results after creating an app, implementing several Views with XML, and launching the skill:
| before | after |
|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
So close...!!
Summary
- I think it worked roughly as described in the skill documentation
- I was asked which screens to migrate at the start, and when I answered "all of them," migrating 5 screens took
35m 31s. (Ran with Sonnet 5) - The iterative adjustments using screenshot comparisons were less precise than expected
- Screen transitions, taps, and display toggles were able to function the same as before migration
- For production-level apps, doing everything at once doesn't seem realistic, so it seems best to do one screen at a time
- It's not perfect, but I felt it was useful enough as a starting point for the work










