Skip to content

Guide · Agent skill

How to use the Migrate XML Views to Compose agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

This guide explains how to install and use the migrate-xml-views-to-jetpack-compose agent skill, which gives an AI agent a structured 10-step workflow for converting one legacy Android XML screen or layout into Jetpack Compose. It is written for Android developers who maintain an app built with XML layouts and want to adopt Compose gradually. By the end you will know what the skill does, how to install it, how to phrase a request that triggers it, and what to review before accepting its changes.

Migrate XML Views to Composeandroid/skills · Apache-2.0

Quick start

  1. 1Unzip the skill. Download the ZIP from this page and unzip it so SKILL.md sits at the top of the skill folder.
  2. 2Place it where your agent looks. Move the folder into ~/.claude/skills/ for personal use or into your project's .claude/skills/ folder, or upload it under Settings → Capabilities → Skills in the Claude apps.
  3. 3Prepare your Android project. Make sure the project syncs in Gradle and builds without errors, since the skill stops to fix build failures first.
  4. 4Ask for a specific migration. Name the XML layout you want to migrate, or ask the agent to find a good candidate and propose a plan.
  5. 5Review the plan and capture a baseline. Approve the plan, then provide a screenshot of the original screen or let the agent capture one with an emulator test.
  6. 6Check the Compose result. Compare the Compose Preview with the baseline screenshot and ask the agent to iterate until layout and styling match.
  7. 7Review the cleanup before accepting it. Check what the agent proposes to delete in step 10 and confirm no other code references those files.

What does the migrate XML views to Compose skill make the agent do?

An agent skill is a folder of instructions (a SKILL.md file plus reference documents) that an AI agent loads when a task matches its description. This skill provides a structured workflow for migrating a single Android XML View to Jetpack Compose, Google's modern UI toolkit. It covers planning, dependency setup, theming, layout migration, validation and XML cleanup.

The skill covers UI only. It converts the layout to Compose but does not migrate business logic, data layers or other non-UI code.

  • Identify a good candidate screen or layout (or use the one you name).
  • Audit the layout and surrounding project context.
  • Set up Compose dependencies and theming with minimal changes.
  • Write the Compose code with a Compose Preview.
  • Compare the result visually with a baseline screenshot of the original.
  • Wire up interoperability between Views and Compose.
  • Remove the old XML file and its legacy tests, after checking nothing else references them.

How do you install the migrate XML views to Compose skill?

Download the ZIP for this skill from this page and unzip it. The skill folder must contain SKILL.md at its top level. Then put it in one of these locations:

For a personal install available across your projects, unzip it into ~/.claude/skills/. For a single project, unzip it into the project's .claude/skills/ folder so it applies only there.

Alternatively, in the Claude apps you can upload the skill under Settings → Capabilities → Skills.

  • Personal: ~/.claude/skills/
  • Project only: .claude/skills/ inside your Android project
  • Claude apps: Settings → Capabilities → Skills (upload)

How do you trigger the skill with a natural request?

You do not need a special command. Describe the migration in plain language, and name the XML layout if you know which one you want. The skill's description tells the agent to use it when you need to migrate an XML View to Jetpack Compose in an Android project.

If you do not name a layout, the agent is directed to analyse the codebase and pick the best candidate. If you name one, it moves straight to the audit.

  • "Migrate res/layout/activity_settings.xml to Jetpack Compose, one step at a time."
  • "Find a good XML screen to move to Compose and propose a plan before changing anything."
  • "Migrate the XML view for the profile header to Compose and compare it with a screenshot of the original."

What does the project need before you start?

The skill expects an Android project with Gradle build files, specifically build.gradle or libs.versions.toml. You also need the Android SDK and either Android Studio or Gradle tooling, so the agent can sync the project and run previews and tests.

  • Required: Android project with build.gradle or libs.versions.toml
  • Required: Android SDK and Android Studio or Gradle tooling
  • Optional: Android emulator, for capturing a baseline screenshot
  • Optional: UI Automator or Espresso, for screenshot tests

What are the safety notes for scripts and network use?

According to the skill's listing, it does not run scripts and does not use the network. Its instructions are in Markdown reference files.

The main risk is at step 10, where legacy XML files and tests are deleted. Review the agent's work before you accept cleanup. The skill itself warns to delete only code and resources that are not referenced by other parts of the project. It is not suited to unattended runs that delete files without review.

  • Runs scripts: no
  • Uses network: no
  • Review every deletion in step 10 before accepting it.
  • Commit or back up your work before starting so changes are easy to revert.

What does the 10-step process look like in practice?

The skill follows the same ten steps every time, which makes the result easier to review. Step 4 is the one that depends on your setup: with user interaction, the agent asks you for a screenshot; if it can run an emulator, it creates a baseline screenshot test; otherwise it moves on. Step 9 compares the original screenshot with the Compose Preview and iterates until the layout and styling match, ignoring string content.

  • 1. Identify the optimal XML candidate
  • 2. Analyze the project and layout
  • 3. Create a plan (asks for approval if interaction is supported)
  • 4. Capture the XML View UI
  • 5. Set up Compose dependencies and compiler
  • 6. Set up Compose theming
  • 7. Migrate the XML layout to Compose
  • 8. Replace usages
  • 9. Validate the migration
  • 10. XML code removal

What people use it for

  • Moving one screen at a time in an XML-based app while the rest stays in Views.
  • Drafting a Compose version of a settings or form layout for a developer to review.
  • Creating a Compose UI test for a converted composable after visual parity is reached.
  • Setting up Material 3 Compose theming minimally for a single migrated screen.
  • Adding Compose inside an existing View-based Activity or Fragment through the interoperability references.

Frequently asked questions

How do I install the migrate XML views to Compose agent skill?

Download the ZIP from this page and unzip it. Put the folder in ~/.claude/skills/ for personal use or in your project's .claude/skills/ folder for one project. In the Claude apps, you can also upload it under Settings → Capabilities → Skills.

What does an Android project need to use this skill?

The project needs Gradle build files, either build.gradle or libs.versions.toml. You also need the Android SDK and Android Studio or Gradle tooling so the agent can sync and run previews and tests. An emulator and UI Automator or Espresso are optional, for baseline screenshots and screenshot tests.

Is the skill free to use and what is its licence?

The skill is listed under the Apache-2.0 licence. The SKILL.md file refers to a LICENSE.txt file for the complete terms, so read that file for the exact conditions.

Does the skill migrate business logic or data layers too?

No. The skill migrates UI only, converting XML layouts to Jetpack Compose. It explicitly excludes business logic, data layers and other non-UI code.

Does this skill work on a project that is already fully Compose?

No. If the project is already fully Compose there is nothing to migrate, because the skill only covers XML to Compose UI.

Can the skill delete my XML files automatically?

Step 10 deletes the migrated XML file and its legacy tests, so you should review that step before accepting it. The skill says to remove only code and resources not referenced elsewhere in the project. Do not run it unattended without checking the deletions.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill suits Android teams with XML-based apps who want to adopt Compose one screen at a time and want a consistent, reviewable process with an agent drafting the code. It is not useful for fully Compose projects, for business logic migration, or for unattended runs that delete files without human review. If you need a tool that migrates a whole app or non-UI code, pick something else or do that work manually.

Download the skill