Skip to content

Migrate XML Views to Compose

Guides an agent through migrating one Android XML layout to Jetpack Compose step by step.

Repository
android/skills
Stars
10,278
Licence
Apache-2.0
Files
8 files

What it does

When installed, the agent follows a 10-step checklist for moving a single legacy Android XML screen or layout into Jetpack Compose, Google's modern UI toolkit. It helps pick a good candidate, audit the layout, set up Compose dependencies and theming, write the Compose code with a preview, compare it visually against a screenshot of the original, wire up interoperability between Views and Compose, and finally remove the old XML. The skill covers UI only, not business logic.

Great for

  • Android developers maintaining an app built with XML layouts who want to adopt Compose gradually
  • Teams that want a consistent, reviewable process for converting one screen at a time
  • Developers who want an agent to draft Compose code and tests while they review each step

Skip it if

  • Projects that are already fully Compose, since there is nothing to migrate (the skill only covers XML to Compose UI)
  • Migrating business logic, data layers or non-UI code, which the skill explicitly excludes
  • Unattended runs that delete XML files without review: step 10 removes legacy files and tests, so the agent should be checked before cleanup is accepted

Try asking

  • “Migrate the activity_profile.xml layout to Jetpack Compose and keep the existing theme intact”
  • “Find the best XML screen in this app to migrate to Compose first and explain why”
  • “Analyze the layout hierarchy of item_news_card.xml and produce a migration plan for my approval”
  • “Replace the XML checkout fragment with a Compose component and add interoperability wrappers”
Step-by-step guide: how to use Migrate XML Views to ComposeInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 8 original files, the Apache-2.0 licence and an attribution note.

    migrate-xml-views-to-jetpack-compose.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip migrate-xml-views-to-jetpack-compose.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip migrate-xml-views-to-jetpack-compose.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Give the agent a specific XML layout name so it skips candidate selection and starts with analysis
  • Provide a screenshot of the current screen in step 4; this gives a clearer visual target for parity checks
  • Review the plan in step 3 before letting the agent edit code, and check the XML deletion in step 10 before committing

What's inside

  • references/analysis-of-the-project-and-layout.md
  • references/android/develop/ui/compose/designsystems/migrate-xml-theme-to-compose.md
  • references/android/develop/ui/compose/migrate/interoperability-apis/compose-in-views.md
  • references/android/develop/ui/compose/migrate/interoperability-apis/views-in-compose.md
  • references/android/develop/ui/compose/setup-compose-dependencies-and-compiler.md
  • references/identify-optimal-xml-candidate.md
  • references/xml-layout-migration.md
  • SKILL.md

Redistributed unmodified from android/skills under the Apache-2.0 licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.