Skip to content

inehemiasm/AiAssistant / skills/migrate-xml-views-to-jetpack-compose

migrate-xml-views-to-jetpack-compose

Verified

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.

references/identify-optimal-xml-candidate.md

View on GitHub
### 1. Analysis scope

**Action:** Use find files and examine all XML layout files within the project (typically located in `res`directories). 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.
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall