Skip to content

Xml To Compose Skill

Claude skill for converting Android XML layouts to Jetpack Compose

Install: git clone https://github.com/singhsume123/xml-to-compose-skill

Install

$git clone https://github.com/singhsume123/xml-to-compose-skill

Install command taken from the project's README or registry entry. Always review code before running it.

XML to Compose Converter Skill

A Claude skill that converts Android XML layouts to idiomatic Jetpack Compose code.

Features

  • Layout conversions — LinearLayout, ConstraintLayout, FrameLayout, RecyclerView, ViewPager2
  • Widget mappings — TextView, EditText, ImageView, Button, CardView, and 20+ more
  • Attribute translations — Dimensions, padding, backgrounds, shapes, visibility
  • Material 3 output — Uses latest Material Design components
  • Best practices — Proper modifier ordering, state hoisting, preview functions

Installation

Installation

Global (all projects)

  1. Clone the skill:
   git clone https://github.com/singhsume123/xml-to-compose-skill.git ~/.claude/skills/xml-to-compose-skill
  1. Verify:
   ls ~/.claude/skills/xml-to-compose-skill/SKILL.md

Project-level (single project)

  1. Navigate to your project:
   cd /path/to/your/project
  1. Clone the skill:
   git clone https://github.com/singhsume123/xml-to-compose-skill.git .claude/skills/xml-to-compose-skill

Updating

cd ~/.claude/skills/xml-to-compose-skill
git pull

Usage

Ask Claude:

  • "Convert this XML layout to Compose"
  • "Migrate my login screen from XML to Compose"
  • "What's the Compose equivalent of RecyclerView?"
  • "Help me convert this ConstraintLayout to Compose"

Example

Input XML:

<LinearLayout
    android:orientation="vertical"
    android:padding="16dp">
    <TextView android:text="Hello" android:textStyle="bold"/>
    <Button android:text="Click me"/>
</LinearLayout>

Output Compose:

@Composable
fun MyScreen(
    onButtonClick: () -> Unit,
    modifier: Modifier = Modifier
) {
    Column(modifier = modifier.padding(16.dp)) {
        Text(
            text = "Hello",
            fontWeight = FontWeight.Bold
        )
        Button(onClick = onButtonClick) {
            Text("Click me")
        }
    }
}

File Structure

xml-to-compose/
├── SKILL.md              # Core conversion rules
├── references/
│   ├── layouts.md        # Layout mappings (Column, Row, Box, LazyColumn...)
│   ├── widgets.md        # Widget mappings (Text, TextField, Image...)
│   └── attributes.md     # Attribute → Modifier mappings
└── assets/
    └── examples/         # Test XML files

Supported Conversions

Layouts

XML Compose
LinearLayout (vertical) Column
LinearLayout (horizontal) Row
FrameLayout Box
ConstraintLayout Column/Row or ConstraintLayout
ScrollView Column + verticalScroll()
RecyclerView LazyColumn / LazyRow
ViewPager2 HorizontalPager

Widgets

XML Compose
TextView Text
EditText TextField / OutlinedTextField
Button Button / OutlinedButton / TextButton
ImageView Image / AsyncImage
CheckBox Checkbox
Switch Switch
ProgressBar CircularProgressIndicator
CardView Card
RecyclerView LazyColumn

Contributing

Found a missing conversion pattern? Open an issue or PR!

License

MIT

Similar plugs

The 1st Collaborative AI Design Agent Workspace. Local-first and open source. Create prototypes, websites, apps, dashboards, presentations, images, and videos with your team…

Run and supervise teams of coding agents from planning to merge. Any harness (Claude code, codex, +25 more). Desktop, web, mobile, and cloud agents.

Agent skillDev tools+336 this week

Free, open-source AI Office suite: Docs, Sheets, Slides, PDF, Markdown and HTML editors with a built-in AI agent, plus a `genoffice` CLI and agent skill so Claude Code, Codex…

Claude-first paid-media operations skill for Claude Code across 12 ad platforms (Google, Meta, YouTube, LinkedIn, TikTok, Microsoft, Apple, Amazon, Reddit, Pinterest, Snapchat…

Explore related