migrate-xml-views-to-jetpack-compose

Migrates Android XML View layouts to Jetpack Compose through a structured ten-step workflow.

1|Updated Jun 9, 2026
One-click install
npx skills add https://github.com/kariemSeiam/android-claw --skill migrate-xml-views-to-jetpack-compose-kariemseiam
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: migrate-xml-views-to-jetpack-compose
Source: https://github.com/kariemSeiam/android-claw/tree/main/skills/installed/migration-migrate-xml-views-to-jetpack-compose
Command: npx skills add https://github.com/kariemSeiam/android-claw --skill migrate-xml-views-to-jetpack-compose-kariemseiam

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Converting legacy Android XML layouts to Jetpack Compose by hand is error-prone and often breaks visual parity, theming, and interoperability. This Skill provides a structured, 10-step methodology that migrates a single XML View to declarative Compose UI while preserving pixel-perfect appearance and functional integrity. ## Core Features & Use Cases - Guided 10-Step Migration: Covers candidate selection, project analysis, planning, baseline screenshot capture, Compose dependency and compiler setup, theming migration, layout conversion, usage replacement, visual validation, and safe XML removal. - Theming & Interop Guidance: Migrates XML themes to Material 3 Compose theming and uses official interoperability APIs (ComposeView, AndroidView, AndroidViewBinding) for hybrid View/Compose projects. - Visual Validation: Compares baseline screenshots against Compose Previews and generates Compose UI tests to confirm parity before deleting legacy XML. - Use Case: An Android developer modernizing a legacy app selects a simple item layout, follows the workflow to produce an equivalent composable with a Preview, validates it against a screenshot, and safely removes the old XML file. ## Quick Start Migrate the XML layout res/layout/item_user_profile.xml to Jetpack Compose following the migration workflow.

Frequently Asked Questions about migrate-xml-views-to-jetpack-compose

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate an XML layout to Jetpack Compose?▼

Follow a structured process: analyze the XML hierarchy, set up Compose dependencies and the Compose Compiler Gradle plugin, migrate theming to Material 3, convert the layout to a composable with a Preview, then validate against a baseline screenshot before removing the XML.

Which XML layouts should I migrate to Compose first?▼

Start with leaf-node layouts that have minimal nesting, few state variables, low reuse across the project, and no complex external view dependencies. Stateless, self-contained components carry the lowest regression risk.

Can Compose and XML Views coexist in the same Android app?▼

Yes, interoperability APIs support hybrid apps. Use ComposeView to embed composables inside XML layouts or Fragments, and AndroidView or AndroidViewBinding to embed existing Views inside Compose UI during incremental migration.

How do I migrate XML themes to Compose Material 3?▼

Map XML color attributes to Material 3 semantic roles like primary, surface, and onSurface, then define ColorScheme, Typography, and Shapes objects for MaterialTheme. Reuse existing XML values as the source of truth and never hardcode new values.

What are the limitations of XML to Compose migration?▼

This workflow migrates UI only and does not change non-UI code such as ViewModels or dependency injection. Compose Previews and screenshot comparison are needed to verify visual parity, and only unreferenced resources should be deleted.