Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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.
.claude/skills/hoangnguyen0403-android-compose-migration/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | -32% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 32% | 0% |
| case-07 | ✓→✓ | = Same ✓ | 8% | 0% |
| case-21 | ✓→✓ | = Same ✓ | -12% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 31% | 0% |
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.| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-07 | pass→pass | 12,529 | 10,762 | -14% | 1 | 1 | 0% | 2,666 | 2,870 | +8% | 0 | 0 | — |
case-21 | pass→pass | 12,455 | 7,943 | -36% | 1 | 1 | 0% | 2,005 | 1,762 | -12% | 0 | 0 | — |
case-01 | fail→fail | 15,052 | 7,296 | -52% | 1 | 1 | 0% | 3,293 | 1,952 | -41% | 0 | 0 | — |
case-02 | fail→pass | 17,114 | 6,631 | -61% | 1 | 1 | 0% | 2,677 | 1,808 | -32% | 0 | 0 | — |
case-03 | fail→fail | 16,146 | 9,266 | -43% | 1 | 1 | 0% | 3,483 | 2,506 | -28% | 0 | 0 | — |
case-04 | pass→pass | 8,937 | 8,916 | -0% | 1 | 1 | 0% | 1,801 | 2,352 | +31% | 0 | 0 | — |
case-05 | pass→pass | 10,456 | 8,841 | -15% | 1 | 1 | 0% | 2,223 | 2,363 | +6% | 0 | 0 | — |
case-06 | pass→pass | 12,613 | 7,183 | -43% | 1 | 1 | 0% | 2,271 | 2,065 | -9% | 0 | 0 | — |
case-08 | pass→pass | 8,709 | 7,232 | -17% | 1 | 1 | 0% | 1,600 | 1,872 | +17% | 0 | 0 | — |
case-09 | fail→pass | 7,451 | 7,871 | +6% | 1 | 1 | 0% | 1,635 | 2,152 | +32% | 0 | 0 | — |
case-10 | pass→pass | 9,924 | 7,671 | -23% | 1 | 1 | 0% | 1,746 | 1,957 | +12% | 0 | 0 | — |
case-11 | pass→pass | 12,457 | 9,994 | -20% | 1 | 1 | 0% | 2,264 | 2,220 | -2% | 0 | 0 | — |
case-12 | pass→pass | 6,511 | 7,896 | +21% | 1 | 1 | 0% | 1,255 | 1,796 | +43% | 0 | 0 | — |
case-13 | pass→pass | 14,846 | 8,031 | -46% | 1 | 1 | 0% | 2,249 | 2,145 | -5% | 0 | 0 | — |
case-14 | pass→pass | 7,632 | 3,177 | -58% | 1 | 1 | 0% | 1,567 | 1,228 | -22% | 0 | 0 | — |
case-15 | pass→pass | 5,174 | 2,717 | -47% | 1 | 1 | 0% | 905 | 1,041 | +15% | 0 | 0 | — |
case-20 | fail→fail | 15,243 | 10,168 | -33% | 1 | 1 | 0% | 2,415 | 2,272 | -6% | 0 | 0 | — |
case-16 | pass→pass | 2,684 | 3,409 | +27% | 1 | 1 | 0% | 476 | 1,233 | +159% | 0 | 0 | — |
case-17 | pass→pass | 10,296 | 5,600 | -46% | 1 | 1 | 0% | 2,019 | 1,593 | -21% | 0 | 0 | — |
case-18 | pass→pass | 8,350 | 3,994 | -52% | 1 | 1 | 0% | 1,465 | 1,310 | -11% | 0 | 0 | — |
case-19 | pass→pass | 6,096 | 2,385 | -61% | 1 | 1 | 0% | 962 | 968 | +1% | 0 | 0 | — |
case-22 | pass→pass | 8,185 | 3,191 | -61% | 1 | 1 | 0% | 1,324 | 1,117 | -16% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +9 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.