android-xml-to-compose

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

Updated Apr 21, 2026
One-click install
npx skills add https://github.com/Zeyad-37/tech-agency --skill android-xml-to-compose-zeyad-37
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: android-xml-to-compose
Source: https://github.com/Zeyad-37/tech-agency/tree/main/.claude/skills/android-xml-to-compose
Command: npx skills add https://github.com/Zeyad-37/tech-agency --skill android-xml-to-compose-zeyad-37

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: themes get duplicated, dependencies are misconfigured, and visual parity is lost. This Skill provides a disciplined, step-by-step migration process that preserves visual consistency and interoperability while incrementally modernizing an Android UI. ## Core Features & Use Cases - Candidate Selection & Analysis: Identifies the optimal XML layout to migrate based on hierarchy depth, complexity, state, and dependency footprint, then audits the project's existing Compose patterns and design system. - Guided 10-Step Migration: Covers dependency and compiler setup, Material 3 theme migration, layout conversion with Compose Previews, interoperability via ComposeView/AndroidView, screenshot-based validation, and safe XML cleanup. - Use Case: You have a legacy screen built with XML layouts and want to convert item_user_profile.xml into a reusable composable. The Skill analyzes the layout, sets up the Compose BOM and compiler, migrates colors and typography to MaterialTheme, generates the Kotlin composable with a Preview, and validates it against a baseline screenshot. ## Quick Start Migrate the XML layout res/layout/item_user_profile.xml to Jetpack Compose while keeping visual parity with the existing screen.

Frequently Asked Questions about android-xml-to-compose

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

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

Follow a structured process: analyze the XML layout and project conventions, set up Compose dependencies and the compiler 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 layout should I migrate to Compose first?▼

Start with leaf-node layouts that have minimal nested children, few state variables, and low reuse across the project. Self-contained components with an easily accessible entry point carry the lowest regression risk for an initial migration.

Can I use Compose inside an existing XML View hierarchy?▼

Yes. Add a ComposeView to your XML layout and call setContent() in the hosting Activity or Fragment, setting an appropriate ViewCompositionStrategy. Conversely, AndroidView and AndroidViewBinding let you embed legacy Views inside Compose UI.

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

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

Does the Compose compiler work with older Kotlin versions?▼

The Compose Compiler Gradle plugin requires Kotlin 2.0 or later. Projects on older Kotlin versions must use the previous compiler configuration approach or upgrade Kotlin before applying the org.jetbrains.kotlin.plugin.compose plugin.

When should I not migrate an XML layout to Compose?▼

Avoid migrating layouts with heavy reuse across the project, complex data binding, or deep external dependencies early on. Also skip migration when the project has pre-existing build or sync failures, since a stable baseline is required first.