xml-to-compose-migration

Convert Android XML layouts to Jetpack Compose composables.

Updated Dec 4, 2025
One-click install
npx skills add https://github.com/thinhtt264/Snaplet-App --skill xml-to-compose-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: xml-to-compose-migration
Source: https://github.com/thinhtt264/Snaplet-App/tree/main/.cursor/skills/xml-to-compose-migration
Command: npx skills add https://github.com/thinhtt264/Snaplet-App --skill xml-to-compose-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Android apps often maintain UI in XML layouts which makes modernization to Jetpack Compose slow and error-prone. This Skill provides a structured approach to migrate or incrementally adopt Compose while preserving behavior and user experience.

Core Features & Use Cases

  • Layout mapping from common XML constructs (LinearLayout, ConstraintLayout) to Compose equivalents.
  • State migration guidance to move from LiveData/ViewModel patterns to State/StateFlow in Compose.
  • Incremental migration strategies using ComposeView or AndroidView to embed Compose in existing layouts or vice versa.
  • Use Case: migrate a single screen to Compose, then progressively replace screens across the app, maintaining navigation and accessibility.

Quick Start

Use the xml-to-compose-migration skill to start converting an Android XML layout file to a Jetpack Compose layout. Provide the root layout file and any related state definitions to begin the transformation.

Frequently Asked Questions about xml-to-compose-migration

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

FAQPage Schema
How do I migrate Android XML layouts to Jetpack Compose?

Migrate Android XML layouts to Jetpack Compose by mapping views like LinearLayout and ConstraintLayout to composables while preserving behavior and user experience.

What is the best way to incrementally adopt Compose in an existing Android app?

Incrementally adopt Compose using ComposeView to embed Compose in existing XML layouts or AndroidView for legacy views in Compose, enabling progressive screen replacements.

How do I migrate LiveData and ViewModel state to Jetpack Compose?

Migrate LiveData and ViewModel patterns to Compose by transitioning to State and StateFlow, ensuring proper state loading and observation within composables.

Can I use AndroidView to embed XML views in a Compose layout?

Yes, use AndroidView to embed existing XML views within a Compose layout, enabling incremental migration and interoperability while progressively replacing screens across the app.

Do I need Android Studio to migrate layouts to Jetpack Compose?

Yes, Android Studio and standard Compose APIs are required to operate the migration process, mapping views to composables while maintaining navigation and accessibility.