xml-to-compose-migration

Installation
SKILL.md

XML to Compose Migration Expert

Expert guidance for systematically migrating Android XML-based layouts and View systems to Jetpack Compose. This skill covers layout translation, state hoisting, the removal of ViewBinding/DataBinding, and incremental adoption using ComposeView and AndroidView.

Instructions

1. Layout Translation

  • Map LinearLayout (vertical/horizontal) to Column or Row.
  • Map FrameLayout to Box.
  • Map ConstraintLayout (XML) to ConstraintLayout (Compose) or idiomatic nested Rows/Columns.
  • Replace RecyclerView with LazyColumn, LazyRow, or LazyVerticalGrid.
  • Replace TextView, Button, ImageView with their Compose equivalents (Text, Button, Image).

2. State Migration

  • Replace findViewById and ViewBinding references with Compose State or MutableState.
  • Convert LiveData or Observable subscriptions in Fragments/Activities to collectAsStateWithLifecycle() in Composable functions.
  • Hoist state to the ViewModel and use lambdas for event callbacks (e.g., onClicked: () -> Unit).
Installs
2
First Seen
May 21, 2026
xml-to-compose-migration — acumenrev/android-agent-skills