Systematically convert Android XML layouts to idiomatic Jetpack Compose, preserving functionality while embracing Compose patterns. This skill covers layout mapping, state migration, and incremental adoption strategies.
Works with
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionxml-to-compose-migrationExecute the skills CLI command in your project's root directory to begin installation:
Fetches xml-to-compose-migration from new-silvermoon/awesome-android-agent-skills and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate xml-to-compose-migration. Access via /xml-to-compose-migration in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
0
total installs
0
this week
642
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
642
stars
Systematically convert Android XML layouts to idiomatic Jetpack Compose, preserving functionality while embracing Compose patterns. This skill covers layout mapping, state migration, and incremental adoption strategies.
ConstraintLayout, LinearLayout, FrameLayout, etc.).@{}) or view binding references.include, merge, or ViewStub usage.ComposeView/AndroidView).Apply the layout mapping table below to convert each View to its Compose equivalent.
LiveData observation to StateFlow collection or observeAsState().findViewById / ViewBinding with Compose state.| XML Layout | Compose Equivalent | Notes |
|---|---|---|
LinearLayout (vertical) |
Column |
Use Arrangement and Alignment |
LinearLayout (horizontal) |
Row |
Use Arrangement and Alignment |
FrameLayout |
Box |
Children stack on top of each other |
ConstraintLayout |
ConstraintLayout (Compose) |
Use createRefs() and constrainAs |
RelativeLayout |
Box or ConstraintLayout |
Prefer Box for simple overlap |
ScrollView |
Column + Modifier.verticalScroll() |
Or use LazyColumn for lists |
HorizontalScrollView |
Row + Modifier.horizontalScroll() |
Or use LazyRow for lists |
RecyclerView |
LazyColumn / LazyRow / LazyGrid |
Most common migration |
ViewPager2 |
HorizontalPager |
From accompanist or Compose Foundation |
CoordinatorLayout |
Custom + Scaffold |
Use TopAppBar with scroll behavior |
NestedScrollView |
Column + Modifier.verticalScroll() |
Prefer Lazy variants |
| XML Widget | Compose Equivalent | Notes |
|---|---|---|
TextView |
Text |
Use style → TextStyle |
EditText |
TextField / OutlinedTextField |
Requires state hoisting |
Button |
Button |
Use onClick lambda |
ImageView |
Image |
Use painterResource() or Coil |
ImageButton |
IconButton |
Use Icon inside |
CheckBox |
Checkbox |
Requires checked + onCheckedChange |
RadioButton |
RadioButton |
Use with Row for groups |
Switch |
Switch |
Requires state hoisting |
ProgressBar (circular) |
CircularProgressIndicator |
|
ProgressBar (horizontal) |
LinearProgressIndicator |
|
SeekBar |
Slider |
Requires state hoisting |
Spinner |
DropdownMenu + ExposedDropdownMenuBox |
More complex pattern |
CardView |
Card |
From Material 3 |
Toolbar |
TopAppBar |
Use inside Scaffold |
BottomNavigationView |
NavigationBar |
Material 3 |
FloatingActionButton |
FloatingActionButton |
Use inside Scaffold |
Divider |
HorizontalDivider / VerticalDivider |
|
Space |
Spacer |
Use Modifier.size() |
| XML Attribute | Compose Modifier/Property |
|---|---|
android:layout_width="match_parent" |
Modifier.fillMaxWidth() |
android:layout_height="match_parent" |
Modifier.fillMaxHeight() |
android:layout_width="wrap_content" |
Modifier.wrapContentWidth() (usually implicit) |
android:layout_weight |
Modifier.weight(1f) |
android:padding |
Modifier.padding() |
android:layout_margin |
Modifier.padding() on parent, or use Arrangement.spacedBy() |
android:background |
Modifier.background() |
android:visibility="gone" |
Conditional composition (don't emit) |
android:visibility="invisible" |
Modifier.alpha(0f) (keeps space) |
android:clickable |
Modifier.clickable { } |
android:contentDescription |
Modifier.semantics { contentDescription = "" } |
android:elevation |
Modifier.shadow() or component's elevation param |
android:alpha |
Modifier.alpha() |
android:rotation |
Modifier.rotate() |
android:scaleX/Y |
Modifier.scale() |
android:gravity |
Alignment parameter or Arrangement |
android:layout_gravity |
Modifier.align() |
<!-- XML -->
<LinearLayout android:orientation="horizontal">
<View android:layout_weight="1" />
<View android:layout_weight="2" />
</LinearLayout>
// Compose
Row(modifier = Modifier.fillMaxWidth()) {
Box(modifier = Modifier.weight(1f))
Box(modifier = Modifier.weight(2f))
}
<!-- XML -->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
// Compose
LazyColumn(modifier = Modifier.fillMaxSize()) {
items(items, key = { it.id }) { item ->
ItemRow(item = item, onClick = { onItemClick(item) })
}
}
<!-- XML with Data Binding -->
<EditText
android:text="@={viewModel.username}"
android:hint="@string/username_hint" />
// Compose
val username by viewModel.username.collectAsState()
OutlinedTextField(
value = username,
onValueChange = { viewModel.updateUsername(it) },
label = { Text(stringResource(R.string.username_hint)) },
modifier = Modifier.fillMaxWidth()
)
<!-- XML -->
<androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/title"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/subtitle"
app:layout_constraintTop_toBottomOf="@id/title"
app:layout_constraintStart_toStartOf="@id/title" />
</androidx.constraintlayout.widget.ConstraintLayout>
// Compose
ConstraintLayout(modifier = Modifier.fillMaxWidth()) {
val (title, subtitle) = createRefs()
Text(
text = "Title",
modifier = Modifier.constrainAs(title) {
top.linkTo(parent.top)
start.linkTo(parent.start)
}
)
Text(
text = "Subtitle",
modifier = Modifier.constrainAs(subtitle) {
top.linkTo(title.bottom)
start.Prerequisites
Time Estimate
15-45 minutes depending on use case complexity
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
davila7/claude-code-templates
intellectronica/agent-skills
am-will/codex-skills
sickn33/antigravity-awesome-skills
myzy-ai/dokie-ai-ppt
sickn33/antigravity-awesome-skills
xml-to-compose-migration is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
Solid pick for teams standardizing on skills: xml-to-compose-migration is focused, and the summary matches what you get after install.
Useful defaults in xml-to-compose-migration — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
Registry listing for xml-to-compose-migration matched our evaluation — installs cleanly and behaves as described in the markdown.
xml-to-compose-migration has been reliable in day-to-day use. Documentation quality is above average for community skills.
Keeps context tight: xml-to-compose-migration is the kind of skill you can hand to a new teammate without a long onboarding doc.
I recommend xml-to-compose-migration for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
We added xml-to-compose-migration from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
xml-to-compose-migration reduced setup friction for our internal harness; good balance of opinion and flexibility.
I recommend xml-to-compose-migration for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
showing 1-10 of 68