Creator · new-silvermoon
Last updated · Sep 2, 2026
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.
Sandbox only
Install targets
Codex install prompt
Install the "xml-to-compose-migration" agent skill from https://github.com/new-silvermoon/awesome-android-agent-skills/tree/main/.github/skills/migration/xml-to-compose-migration. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: 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. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"new-silvermoon-xml-to-compose-migration","task":"Install xml-to-compose-migration","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Deep research, source comparison, literature review, RAG, knowledge search, and reports.
Scenario
RAG and knowledge
I need my agent to build a RAG workflow over documents and retrieve reliable context.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add new-silvermoon/awesome-android-agent-skills --skill xml-to-compose-migration
Maintenance
active
1mo since push
Risk
Needs review
Quality score needs review
GitHub quality
948
70/100 Quality · 80/100 Trust
Coverage tags
Review notes
Quality score needs review · Needs review
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
StrongSolid option that is likely worth shortlisting for production workflows.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
948 GitHub stars
Repo activity
948 stars, 94 forks
Maintenance
1mo since push
License
Apache-2.0
Install
npx skills add new-silvermoon/awesome-android-agent-skills --skill xml-to-compose-migration
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add new-silvermoon/awesome-android-agent-skills --skill xml-to-compose-migrationDo not use when
Alternative
175.1K Stars
npx skills add anthropics/skills --skill frontend-design
Alternative
85.2K Stars
npx skills add Leonxlnx/taste-skill --skill design-taste-frontend
Alternative
1.8K Stars
npx skills add Alisa0808/vox-director --skill vox-director
Alternative
175.1K Stars
npx skills add anthropics/skills --skill canvas-design
Agent safety v2
Usable candidate, but the agent should surface permission and audit notes before installation.
Require human approval before installing into a real workspace.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
medium
Skill may inspect schemas, query databases, or work with persistent stores.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20xml-to-compose-migration%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20xml-to-compose-migration%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/new-silvermoon-xml-to-compose-migration/install
Agent should check
Copy prompt
Task: Use xml-to-compose-migration in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20xml-to-compose-migration%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/new-silvermoon-xml-to-compose-migration/install
Install command: npx skills add new-silvermoon/awesome-android-agent-skills --skill xml-to-compose-migration
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/new-silvermoon-xml-to-compose-migration/install
LLM text format
/api/skills/new-silvermoon-xml-to-compose-migration/install?format=text
Find alternatives
/api/skills/search?q=xml-to-compose-migration&limit=3
Agent prompt
Use xml-to-compose-migration for this task. Review https://www.openagentskill.com/api/skills/new-silvermoon-xml-to-compose-migration/install, then install with: npx skills add new-silvermoon/awesome-android-agent-skills --skill xml-to-compose-migrationRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/new-silvermoon-xml-to-compose-migration
LLM text
/api/registry/manifest/new-silvermoon-xml-to-compose-migration?format=text
Install alias
/api/registry/install/new-silvermoon-xml-to-compose-migration
Recommend
/api/registry/recommend?task=Use%20xml-to-compose-migration%20in%20an%20agent%20workflow&limit=3
Agent fit
RAG and knowledge
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Shortlist this skill and compare it with close alternatives before production adoption.
Role in stack
Companion skill
Primary fit
RAG and knowledge
Trust label
Strong shortlist
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
INFO948 GitHub stars
Stars/forks activity
INFO948 stars, 94 forks; issue activity unavailable in current metadata
Recent maintenance
PASS1mo since push
License clarity
PASSApache-2.0
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Solid option that is likely worth shortlisting for production workflows.
Workflow fit
Search private knowledge
I need my agent to build a RAG workflow over documents and retrieve reliable context.
Operate web apps
I need my agent to control a browser, fill forms, and verify web app workflows.
Automate repeated work
I need my agent to automate a repeated workflow across tools and files.
Workflow fit
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Turn skills into distribution
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
Alternative shortlist
Similar skills that may fit this task.
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
--- 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 Layout | Compose Equivalent | Notes | |------------|-------------------|-------| | `LinearLayout (vertical)` | `Column` | Use `Arrangement` and `Alignment` | | `LinearLayout (horizontal)` | `Row` | Use `Arrangement` and `Alignment` | | `FrameLayout` | `Box` | Children stack on top of each other | | `ConstraintLayout` | `ConstraintLayout` (Compose) | Use `createRefs()` and `constrainAs` | | `RelativeLayout` | `Box` or `ConstraintLayout` | Prefer Box for simple overlap | | `ScrollView` | `Column` + `Modifier.verticalScroll()` | Or use `LazyColumn` for lists | | `HorizontalScrollView` | `Row` + `Modifier.horizontalScroll()` | Or use `LazyRow` for lists | | `RecyclerView` | `LazyColumn` / `LazyRow` / `LazyGrid` | Most common migration | | `ViewPager2` | `HorizontalPager` | From accompanist or Compose Foundation | | `CoordinatorLayout` | Custom + `Scaffold` | Use `TopAppBar` with scroll behavior | | `NestedScrollView` | `Column` + `Modifier.verticalScroll()` | Prefer Lazy variants |
### Common Widgets
| XML Widget | Compose Equivalent | Notes | |------------|-------------------|-------| | `TextView` | `Text` | Use `style` → `TextStyle` | | `EditText` | `TextField` / `OutlinedTextField` | Requires state hoisting | | `Button` | `Button` | Use `onClick` lambda | | `ImageView` | `Image` | Use `painterResource()` or Coil | | `ImageButton` | `IconButton` | Use `Icon` inside | | `CheckBox` | `Checkbox` | Requires `checked` + `onCheckedChange` | | `RadioButton` | `RadioButton` | Use with `Row` for groups | | `Switch` | `Switch` | Requires state hoisting | | `ProgressBar (circular)` | `CircularProgressIndicator` | | | `ProgressBar (horizontal)` | `LinearProgressIndicator` | | | `SeekBar` | `Slider` | Requires state hoisting | | `Spinner` | `DropdownMenu` + `ExposedDropdownMenuBox` | More complex pattern | | `CardView` | `Card` | From Material 3 | | `Toolbar` | `TopAppBar` | Use inside `Scaffold` | | `BottomNavigationView` | `NavigationBar` | Material 3 | | `FloatingActionButton` | `FloatingActionButton` | Use inside `Scaffold` | | `Divider` | `HorizontalDivider` / `VerticalDivider` | | | `Space` | `Spacer` | Use `Modifier.size()` |
### Attribute Mapping
| XML Attribute | Compose 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_weight` | `Modifier.weight(1f)` | | `android:padding` | `Modifier.padding()` | | `android:layout_margin` | `Modifier.padding()` on parent, or use `Arrangement.spacedBy()` | | `android:background` | `Modifier.background()` | | `android:visibility="gone"` | Conditional composition (don't emit) | | `android:visibility="invisible"` | `Modifier.alpha(0f)` (keeps space) | | `android:clickable` | `Modifier.clickable { }` | | `android:contentDescription` | `Modifier.semantics { contentDescription = "" }` | | `android:elevation` | `Modifier.shadow()` or component's `elevation` param | | `android:alpha` | `Modifier.alpha()` | | `android:rotation` | `Modifier.rotate()` | | `android:scaleX/Y` | `Modifier.scale()` | | `android:gravity` | `Alignment` parameter or `Arrangement` | | `android:layout_gravity` | `Modifier.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
- [Interoperability APIs](https://developer.android.com/develop/ui/compose/migrate/interoperability-apis) - [Migration Strategy](https://developer.android.com/develop/ui/compose/migrate/strategy) - [Compose and Views side by side](https://developer.android.com/develop/ui/compose/migrate)
Source provenance
Decision snapshot
948 GitHub stars
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for xml-to-compose-migration, ready for a manual X post.
xml-to-compose-migration: Convert Android XML layouts to Jetpack Compose. Use when asked to migrate Views to Compose, c... 948 stars https://www.openagentskill.com/skills/new-silvermoon-xml-to-compose-migration?ref=x
Listing + install path for xml-to-compose-migration: https://www.openagentskill.com/skills/new-silvermoon-xml-to-compose-migration?ref=x Install: npx skills add new-silvermoon/awesome-android-agent-skills --skill xml-to-compose...
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to new-silvermoon but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/new-silvermoon-xml-to-compose-migration?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/new-silvermoon-xml-to-compose-migration?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/new-silvermoon-xml-to-compose-migration/audit)
[](https://www.openagentskill.com/skills/new-silvermoon-xml-to-compose-migration?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)new-silvermoon
@new-silvermoon
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Frontend Design
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
175.1K StarsTaste Skill: Anti-Slop Frontend
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
85.2K StarsVox Director
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
1.8K StarsCanvas Design
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
175.1K StarsPermission surface
database access
Agent outcomes
No agent outcome data yet
Docs
Strong README/SKILL.md context
Risk summary
Install readiness