Agent skill

XML To Compose Migration

by Moustachauve in Moustachauve/WLED-Android

Convert Android XML layouts to Jetpack Compose. An agent skill from Moustachauve/WLED-Android.

Apache-2.0Auto-check passedMobile

Install XML To Compose Migration

skills CLI
$ npx skills add Moustachauve/WLED-Android --skill xml-to-compose-migration -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Moustachauve/WLED-Android xml-to-compose-migration --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Moustachauve/WLED-Android.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/xml-to-compose-migration .claude/skills/xml-to-compose-migration && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
xml-to-compose-migration
GitHub stars
169
Used in
2 other repos
Token cost
~2.6k tokens
SKILL.md length
522 words
Files
1
Skills in repo
17
Repo updated
First seen
Licence
Apache-2.0

At a glance

Convert Android XML layouts to Jetpack Compose. An agent skill from Moustachauve/WLED-Android.

  • Works in 5 steps: Analyze the XML Layout → Plan the Migration → Convert Layouts → …
  • Asked to migrate Views to Compose
  • SKILL.md covers Overview, Workflow, Layout Mapping Reference and Common Patterns, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

XML To Compose Migration is an agent skill from Moustachauve/WLED-Android. Convert Android XML layouts to Jetpack Compose. Use when asked to migrate Views to Compose, convert XML to Composables, or modernize UI from View system to Compose.

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Mobile, covering Android development. It works with Jetpack Compose and Android. The repository describes itself as: Native Android application for WLED. The licence is Apache-2.0.

When your agent uses it

  • Asked to migrate Views to Compose
  • Convert XML to Composables
  • Modernize UI from View system to Compose

Example prompts

  • “/xml-to-compose-migration”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Analyze the XML Layout
  2. Plan the Migration
  3. Convert Layouts
  4. Migrate State
  5. Test and Verify

What it can do on your machine

Read from SKILL.md and the folder at commit 7e164a8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are kotlin and xml).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • developer.android.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

XML To Compose Migration loads about 2.6k tokens when it runs. Until then it costs about 47 tokens; SKILL.md has 522 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~47
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Moustachauve/WLED-Android at commit 7e164a8, republished under its Apache-2.0 licence (© Moustachauve). 522 words, ~2,553 tokens.

Download SKILL.mdSave it as .claude/skills/xml-to-compose-migration/SKILL.md (or your agent's skills folder).
name
xml-to-compose-migration
description
Convert Android XML layouts to Jetpack Compose. Use when asked to migrate Views to Compose, convert XML to Composables, or modernize UI from View system to Compose.

XML to Compose Migration

Overview

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.

Workflow

1. Analyze the XML Layout
  • Identify the root layout type (ConstraintLayout, LinearLayout, FrameLayout, etc.).
  • List all View widgets and their key attributes.
  • Map data binding expressions (@{}) or view binding references.
  • Identify custom views that need special handling.
  • Note any include, merge, or ViewStub usage.
2. Plan the Migration
  • Decide: Full rewrite or incremental migration (using ComposeView/AndroidView).
  • Identify state sources (ViewModel, LiveData, savedInstanceState).
  • List reusable components to extract as separate Composables.
  • Plan navigation integration if using Navigation component.
3. Convert Layouts

Apply the layout mapping table below to convert each View to its Compose equivalent.

4. Migrate State
  • Convert LiveData observation to StateFlow collection or observeAsState().
  • Replace findViewById / ViewBinding with Compose state.
  • Convert click listeners to lambda parameters.
5. Test and Verify
  • Compare visual output between XML and Compose versions.
  • Test accessibility (content descriptions, touch targets).
  • Verify state preservation across configuration changes.

Layout Mapping Reference

Container Layouts
XML LayoutCompose EquivalentNotes
LinearLayout (vertical)ColumnUse Arrangement and Alignment
LinearLayout (horizontal)RowUse Arrangement and Alignment
FrameLayoutBoxChildren stack on top of each other
ConstraintLayoutConstraintLayout (Compose)Use createRefs() and constrainAs
RelativeLayoutBox or ConstraintLayoutPrefer Box for simple overlap
ScrollViewColumn + Modifier.verticalScroll()Or use LazyColumn for lists
HorizontalScrollViewRow + Modifier.horizontalScroll()Or use LazyRow for lists
RecyclerViewLazyColumn / LazyRow / LazyGridMost common migration
ViewPager2HorizontalPagerFrom accompanist or Compose Foundation
CoordinatorLayoutCustom + ScaffoldUse TopAppBar with scroll behavior
NestedScrollViewColumn + Modifier.verticalScroll()Prefer Lazy variants
Common Widgets
XML WidgetCompose EquivalentNotes
TextViewTextUse style → TextStyle
EditTextTextField / OutlinedTextFieldRequires state hoisting
ButtonButtonUse onClick lambda
ImageViewImageUse painterResource() or Coil
ImageButtonIconButtonUse Icon inside
CheckBoxCheckboxRequires checked + onCheckedChange
RadioButtonRadioButtonUse with Row for groups
SwitchSwitchRequires state hoisting
ProgressBar (circular)CircularProgressIndicator
ProgressBar (horizontal)LinearProgressIndicator
SeekBarSliderRequires state hoisting
SpinnerDropdownMenu + ExposedDropdownMenuBoxMore complex pattern
CardViewCardFrom Material 3
ToolbarTopAppBarUse inside Scaffold
BottomNavigationViewNavigationBarMaterial 3
FloatingActionButtonFloatingActionButtonUse inside Scaffold
DividerHorizontalDivider / VerticalDivider
SpaceSpacerUse Modifier.size()
Show full SKILL.md (162 more words)Show less
Attribute Mapping
XML AttributeCompose 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_weightModifier.weight(1f)
android:paddingModifier.padding()
android:layout_marginModifier.padding() on parent, or use Arrangement.spacedBy()
android:backgroundModifier.background()
android:visibility="gone"Conditional composition (don't emit)
android:visibility="invisible"Modifier.alpha(0f) (keeps space)
android:clickableModifier.clickable { }
android:contentDescriptionModifier.semantics { contentDescription = "" }
android:elevationModifier.shadow() or component's elevation param
android:alphaModifier.alpha()
android:rotationModifier.rotate()
android:scaleX/YModifier.scale()
android:gravityAlignment parameter or Arrangement
android:layout_gravityModifier.align()

Common Patterns

LinearLayout with Weights
xml
<!-- XML -->
<LinearLayout android:orientation="horizontal">
    <View android:layout_weight="1" />
    <View android:layout_weight="2" />
</LinearLayout>
kotlin
// Compose
Row(modifier = Modifier.fillMaxWidth()) {
    Box(modifier = Modifier.weight(1f))
    Box(modifier = Modifier.weight(2f))
}
RecyclerView to LazyColumn
xml
<!-- XML -->
<androidx.recyclerview.widget.RecyclerView
    android:id="@+id/recyclerView"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />
kotlin
// Compose
LazyColumn(modifier = Modifier.fillMaxSize()) {
    items(items, key = { it.id }) { item ->
        ItemRow(item = item, onClick = { onItemClick(item) })
    }
}
EditText with Two-Way Binding
xml
<!-- XML with Data Binding -->
<EditText
    android:text="@={viewModel.username}"
    android:hint="@string/username_hint" />
kotlin
// Compose
val username by viewModel.username.collectAsState()

OutlinedTextField(
    value = username,
    onValueChange = { viewModel.updateUsername(it) },
    label = { Text(stringResource(R.string.username_hint)) },
    modifier = Modifier.fillMaxWidth()
)
ConstraintLayout Migration
xml
<!-- 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>
kotlin
// 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.linkTo(title.start)
        }
    )
}
Include / Merge → Extract Composable
xml
<!-- XML: layout_header.xml -->
<merge>
    <ImageView android:id="@+id/avatar" />
    <TextView android:id="@+id/name" />
</merge>

<!-- Usage -->
<include layout="@layout/layout_header" />
kotlin
// Compose: Extract as a reusable Composable
@Composable
fun HeaderSection(
    avatarUrl: String,
    name: String,
    modifier: Modifier = Modifier
) {
    Row(modifier = modifier) {
        AsyncImage(model = avatarUrl, contentDescription = null)
        Text(text = name)
    }
}

// Usage
HeaderSection(avatarUrl = user.avatar, name = user.name)

Incremental Migration (Interop)

Embedding Compose in XML
xml
<!-- In your XML layout -->
<androidx.compose.ui.platform.ComposeView
    android:id="@+id/compose_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />
kotlin
// In Fragment/Activity
binding.composeView.setContent {
    MaterialTheme {
        MyComposable()
    }
}
Embedding XML Views in Compose
kotlin
// Use AndroidView for Views that don't have Compose equivalents
@Composable
fun MapViewComposable(modifier: Modifier = Modifier) {
    AndroidView(
        factory = { context ->
            MapView(context).apply {
                // Initialize the view
            }
        },
        update = { mapView ->
            // Update the view when state changes
        },
        modifier = modifier
    )
}

State Migration

LiveData to Compose
kotlin
// Before: Observing in Fragment
viewModel.uiState.observe(viewLifecycleOwner) { state ->
    binding.title.text = state.title
}

// After: Collecting in Compose
@Composable
fun MyScreen(viewModel: MyViewModel = hiltViewModel()) {
    val uiState by viewModel.uiState.collectAsStateWithLifecycle()
    
    Text(text = uiState.title)
}
Click Listeners
kotlin
// Before: XML + setOnClickListener
binding.submitButton.setOnClickListener {
    viewModel.submit()
}

// After: Lambda in Compose
Button(onClick = { viewModel.submit() }) {
    Text("Submit")
}

Checklist

  • All layouts converted (no include or merge left)
  • State hoisted properly (no internal mutable state for user input)
  • Click handlers converted to lambdas
  • RecyclerView adapters removed (using LazyColumn/LazyRow)
  • ViewBinding/DataBinding removed
  • Navigation integrated (NavHost or interop)
  • Theming applied (MaterialTheme)
  • Accessibility preserved (content descriptions, touch targets)
  • Preview annotations added for development
  • Old XML files deleted

References

© Moustachauve, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .github/skills/xml-to-compose-migration of Moustachauve/WLED-Android.

Open the folder on GitHubat commit 7e164a8

Used in 2 other repositories

We found 3 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in Moustachauve/WLED-Android, which our catalogue first saw on October 7, 2026.

Compare with similar skills

XML To Compose Migration next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

XML To Compose Migration compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
XML To Compose Migration this skillMoustachauve/WLED-Android1692 repos~2.6kAutomated safety check: PassApache-2.0
Compose Multiplatform Patternsmonta-app/ocpp-emulator1805 repos~2kAutomated safety check: PassApache-2.0
Android Developmentdpconde/claude-android-skill337—~1.7kAutomated safety check: PassMIT
Stylesarindamxd/camerax-android1324 repos~2.3kAutomated safety check: PassApache-2.0
Benchmarkandroidx/androidx6.1k—~1.1kAutomated safety check: PassApache-2.0
Mobile Android Designopenvetta/open-vetta2913 repos~950Automated safety check: PassApache-2.0

Similar skills

  • Compose Multiplatform Patterns

    monta-app/ocpp-emulator

    Compose Multiplatform and Jetpack Compose patterns for KMP projects — state management, navigation, theming, performance, and platform-specific UI.

    180 GitHub starsUsed in 5 repos~2k tokens
    MobileAuto-check passed
  • Android Development

    dpconde/claude-android-skill

    Create production-quality Android applications following Google's official architecture guidance and NowInAndroid best practices.

    337 GitHub stars~1.7k tokensUpdated 10 mo ago
    MobileAuto-check passed
  • Styles

    arindamxd/camerax-android

    A skill your agent uses to integrate the Jetpack Compose Styles API into an Android project.

    132 GitHub starsUsed in 4 repos~2.3k tokens
    MobileAuto-check passed
  • Benchmark

    androidx/androidx

    Benchmarking and improving the performance of Jetpack Compose.

    6.1k GitHub stars~1.1k tokensUpdated today
    MobileAuto-check passed
  • Mobile Android Design

    openvetta/open-vetta

    Master Material Design 3 and Jetpack Compose patterns for building native Android apps.

    291 GitHub starsUsed in 3 repos~950 tokens
    MobileAuto-check passed
  • Generating Baseline Profiles

    rosuH/EasyWatermark

    A skill your agent uses to generate and measure Jetpack Compose Baseline Profiles end-to-end with the AGP 8.2+ Baseline Profile Generator module and the Macrobenchmark harness.

    1.9k GitHub starsUsed in 1 repo~5k tokens
    MobileAuto-check passed

More from Moustachauve/WLED-Android

All 17 skills in this repo
  • Compose Performance Audit

    Moustachauve/WLED-Android

    Audit and improve Jetpack Compose runtime performance from code review and architecture.

    169 GitHub starsUsed in 3 repos~1.7k tokens
    Auto-check passed
  • Compose UI

    Moustachauve/WLED-Android

    Best practices for building UI with Jetpack Compose, focusing on state hoisting, detailed performance optimizations, and theming.

    169 GitHub starsUsed in 3 repos~676 tokens
    Auto-check passed
  • Gradle Build Performance

    Moustachauve/WLED-Android

    Debug and optimize Android/Gradle build performance. An agent skill from Moustachauve/WLED-Android.

    169 GitHub starsUsed in 3 repos~2k tokens
    Auto-check passed
  • Kotlin Concurrency Expert

    Moustachauve/WLED-Android

    Kotlin Coroutines review and remediation for Android. An agent skill from Moustachauve/WLED-Android.

    169 GitHub starsUsed in 3 repos~1.4k tokens
    Auto-check passed
  • Coil Compose

    Moustachauve/WLED-Android

    Expert guidance on using Coil for image loading in Jetpack Compose.

    169 GitHub starsUsed in 2 repos~789 tokens
    Auto-check passed
  • Android Emulator Skill

    Moustachauve/WLED-Android

    Production-ready scripts for Android app testing, building, and automation.

    169 GitHub starsUsed in 1 repo~911 tokens
    Auto-check passed

Categories

Questions about XML To Compose Migration

What does XML To Compose Migration do?

Convert Android XML layouts to Jetpack Compose. An agent skill from Moustachauve/WLED-Android. XML To Compose Migration is an agent skill from Moustachauve/WLED-Android. Convert Android XML layouts to Jetpack Compose.

When should I use XML To Compose Migration?

XML To Compose Migration fits situations like: asked to migrate Views to Compose; convert XML to Composables; modernize UI from View system to Compose.

How do I install XML To Compose Migration in Claude Code?

Run `npx skills add Moustachauve/WLED-Android --skill xml-to-compose-migration -a claude-code`. Or copy the skill folder (.github/skills/xml-to-compose-migration in Moustachauve/WLED-Android) into .claude/skills/xml-to-compose-migration in your project. Claude Code loads it when a task matches its description.

How do I install XML To Compose Migration in Codex?

Run `npx skills add Moustachauve/WLED-Android --skill xml-to-compose-migration -a codex`. Or copy the skill folder (.github/skills/xml-to-compose-migration in Moustachauve/WLED-Android) into .agents/skills/xml-to-compose-migration in your project. Codex loads it when a task matches its description.

Can I use XML To Compose Migration in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Moustachauve/WLED-Android --skill xml-to-compose-migration -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/xml-to-compose-migration, .gemini/skills/xml-to-compose-migration, .github/skills/xml-to-compose-migration and .opencode/skills/xml-to-compose-migration in your project.

What does XML To Compose Migration need to run?

SKILL.md names no scripts, command-line tools or credentials: XML To Compose Migration is instructions for the agent only.

Does XML To Compose Migration access the network?

SKILL.md names 1 domain. As links in the text: developer.android.com. This is read from the text; nothing was executed.

Is XML To Compose Migration safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does XML To Compose Migration use?

XML To Compose Migration is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does XML To Compose Migration use?

About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to XML To Compose Migration?

Skills that share tags, products or a category with XML To Compose Migration: Compose Multiplatform Patterns (monta-app/ocpp-emulator, 180 stars), Android Development (dpconde/claude-android-skill, 337 stars), Styles (arindamxd/camerax-android, 132 stars) and Benchmark (androidx/androidx, 6.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains XML To Compose Migration?

Moustachauve (a GitHub user) maintains it in Moustachauve/WLED-Android, which has 169 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on October 9, 2026.

Source: Moustachauve/WLED-Android on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.