migrate-xml-views-to-jetpack-compose

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

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/RavitejaKarra24/dotfiles --skill migrate-xml-views-to-jetpack-compose-ravitejakarra24
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/RavitejaKarra24/dotfiles/tree/main/pi/.pi/agent/skills/migrate-xml-views-to-jetpack-compose
Command: npx skills add https://github.com/RavitejaKarra24/dotfiles --skill migrate-xml-views-to-jetpack-compose-ravitejakarra24

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Converting legacy Android XML View layouts to Jetpack Compose is error-prone: developers must preserve visual parity, set up Compose dependencies and theming correctly, and handle View/Compose interoperability without breaking existing screens. This Skill provides a structured, validated migration path. ## Core Features & Use Cases - Candidate Selection & Analysis: Identifies the optimal XML layout to migrate based on complexity, state, and dependency footprint, then audits the project's build health, design system, and architecture. - Guided 10-Step Migration: Covers dependency and compiler setup, Material 3 theming migration, layout conversion with Compose Previews, interoperability via ComposeView/AndroidView, screenshot-based visual validation, and safe XML cleanup. - Use Case: An Android team incrementally adopting Compose selects a simple item layout, follows the workflow to produce a pixel-matched composable with a preview and UI test, replaces usages in Fragments, and removes the legacy XML. ## Quick Start Ask the agent to migrate a specific XML layout file in your Android project to Jetpack Compose using this skill.

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 Android XML layout to Jetpack Compose?

Follow a structured process: analyze the layout and project, set up Compose dependencies and theming, convert the XML hierarchy to composables with matching modifiers, add a Compose Preview, validate against a baseline screenshot, replace usages, then delete the XML. This skill automates that ten-step workflow.

How do I add Compose to an existing View-based Android app?

Use ComposeView inside your XML layout or Fragment and call setContent with your composable, setting an appropriate ViewCompositionStrategy. For full screens, call setContent directly in a ComponentActivity with the activity-compose dependency.

Can I use Android Views inside Jetpack Compose?

Yes, use the AndroidView composable to embed Views not yet available in Compose, or AndroidViewBinding to inflate XML layouts with view binding. For lazy lists, use the AndroidView overload with onReset to enable View reuse.

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

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

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 dependencies. These self-contained components carry the lowest regression risk during incremental adoption.