Index of every page on this site: llms.txt
All skills
android avatar

/migrate-xml-views-to-jetpack-compose

@7f7b217
by androidandroid/skills11k stars
703
Run it yourself

Provides a structured workflow for migrating an Android XML View to Jetpack Compose. This skill details the step-by-step process, from planning and dependency setup, to theming and layout migration, validation and XML cleanup. Use this skill when you need to migrate an XML View to Jetpack Compose in an Android project. It solves the problem of converting the UI of a legacy XML View into modern, declarative Compose components while maintaining interoperability.

Use this Skill: https://skilld.dev/gh/android/skills/migrate-xml-views-to-jetpack-compose

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesidentify-optimal-xml-candidate.md

≈417 tokens on demand. Your agent reads this file only when SKILL.md points to it.

1. Analysis scope

Action: Use find files and examine all XML layout files within the project (typically located in resdirectories). For each file, parse the view hierarchy and metadata.

2. Selection criteria

Prioritize layouts that meet the following criteria:

  • Hierarchy depth: Target leaf nodes or components at the bottom of the UI tree.
  • Complexity: Select layouts with the smallest number of nested children and minimal logic.
  • State management: Prioritize stateless components or those with the fewest UI state variables.
  • Dependency footprint: Identify layouts with zero to minimal external UI dependencies.
  • Isolation: Focus on self-contained components that do not rely heavily on parent context or complex data binding.

3. Risk assessment

Evaluate the migration risk based on: * Reusability: Find layouts with minimum reuse across the project to limit regression impact. * Accessibility: Ensure the layout has an easily accessible entry point (e.g., used in a simple Activity, Fragment, or as a standalone include).


Output requirements

Provide a ranked list of the top 3-5 candidates. For each candidate, include:

  1. File path: (e.g., res/layout/item_user_profile.xml)
  2. Rationale: Why this is a good candidate based on the provided criteria.
  3. Complexity score: A rating from 1-5 (1 being simplest).
  4. Dependency count: List of custom/external views found within.

Action: If you support user interaction, ask the user to choose which XML to proceed with. Else proceed with the best option, based on the previous criteria.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts7d4 checks · Risk SAFE
  • Gen Agent Trust Hub7d

    The skill provides a legitimate technical workflow for migrating Android XML layouts to Jetpack Compose using official Google dependencies and standard Android development tools. No malicious behavior was detected.

  • Socket7d

    No alerts

  • Snyk7d

    Risk: LOW · No issues

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 7f7b217. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 33 minutes ago.

Activeupdated last week
Other metadata
metadata
{
  "author": "Google LLC",
  "last-updated": "2026-11-12",
  "keywords": [
    "Jetpack Compose",
    "migration",
    "XML",
    "Views",
    "interoperability",
    "incremental adoption",
    "UI development"
  ]
}

README badge

README badge for android/skills/migrate-xml-views-to-jetpack-compose