/ Directory / Playground / jetpack-compose-skills
● Community anhvt52 ⚡ Instant

jetpack-compose-skills

by anhvt52 · anhvt52/jetpack-compose-skills

Make Claude an Android Compose dev — idiomatic @Composable, state hoisting, Material 3, proper previews.

jetpack-compose-skills encodes modern Android development patterns for Jetpack Compose: state hoisting, @Composable scoping, Modifier order rules, Material 3 theming, ViewModel + StateFlow wiring, navigation-compose, and Compose-compliant testing. Good for both greenfield Compose projects and migrating Views-based screens.

Why use it

Key features

Live Demo

What it looks like in practice

jetpack-compose-skill.replay ▶ ready
0/0

Install

Pick your client

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "jetpack-compose-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/anhvt52/jetpack-compose-skills",
        "~/.claude/skills/jetpack-compose-skills"
      ],
      "_inferred": true
    }
  }
}

Open Claude Desktop → Settings → Developer → Edit Config. Restart after saving.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "jetpack-compose-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/anhvt52/jetpack-compose-skills",
        "~/.claude/skills/jetpack-compose-skills"
      ],
      "_inferred": true
    }
  }
}

Cursor uses the same mcpServers schema as Claude Desktop. Project config wins over global.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "jetpack-compose-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/anhvt52/jetpack-compose-skills",
        "~/.claude/skills/jetpack-compose-skills"
      ],
      "_inferred": true
    }
  }
}

Click the MCP Servers icon in the Cline sidebar, then "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "jetpack-compose-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/anhvt52/jetpack-compose-skills",
        "~/.claude/skills/jetpack-compose-skills"
      ],
      "_inferred": true
    }
  }
}

Same shape as Claude Desktop. Restart Windsurf to pick up changes.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "jetpack-compose-skill",
      "command": "git",
      "args": [
        "clone",
        "https://github.com/anhvt52/jetpack-compose-skills",
        "~/.claude/skills/jetpack-compose-skills"
      ]
    }
  ]
}

Continue uses an array of server objects rather than a map.

~/.config/zed/settings.json
{
  "context_servers": {
    "jetpack-compose-skill": {
      "command": {
        "path": "git",
        "args": [
          "clone",
          "https://github.com/anhvt52/jetpack-compose-skills",
          "~/.claude/skills/jetpack-compose-skills"
        ]
      }
    }
  }
}

Add to context_servers. Zed hot-reloads on save.

claude mcp add jetpack-compose-skill -- git clone https://github.com/anhvt52/jetpack-compose-skills ~/.claude/skills/jetpack-compose-skills

One-liner. Verify with claude mcp list. Remove with claude mcp remove.

Use Cases

Real-world ways to use jetpack-compose-skills

How to build a new Compose screen with state hoisting

👤 Android developers writing Compose UI ⏱ ~30 min intermediate

When to use: New screen in a Compose app — get it right the first time rather than refactoring later.

Prerequisites
  • Android Studio with a recent Compose BOM — Use the latest stable Compose BOM in your build
  • Skill cloned — git clone https://github.com/anhvt52/jetpack-compose-skills ~/.claude/skills/jetpack-compose-skills
Flow
  1. Describe the screen
    Build a Profile screen: avatar, name, bio, follow button. State comes from a ProfileViewModel.✓ Copied
    → Stateless composable + stateful wrapper + preview
  2. Wire the ViewModel
    Hook up the ViewModel using collectAsStateWithLifecycle.✓ Copied
    → Lifecycle-aware state collection
  3. Add a preview
    Add @Preview variants for empty, loaded, and error states.✓ Copied
    → Three previews rendering without a live ViewModel

Outcome: A clean Compose screen with previews and a testable structure.

Pitfalls
  • Stateful composables you can't preview — Keep the composable stateless; hoist state to a wrapper
  • Wrong Modifier order — Skill prompts the order rule — padding before background for a padded background, etc.
Combine with: filesystem

Migrate a Views-based screen to Compose

👤 Teams converting legacy Android screens ⏱ ~90 min advanced

When to use: You want to convert one screen at a time without rewriting the whole app.

Flow
  1. Map the XML
    Here's fragment_profile.xml. Map each widget to a Compose equivalent with notes on behaviors to preserve.✓ Copied
    → XML → Compose mapping with behavior notes
  2. Rewrite
    Produce the Compose screen. Keep state + actions identical to the Fragment.✓ Copied
    → Composable file + ViewModel untouched
  3. Keep the navigation hybrid if needed
    Swap only this screen, leave the rest on Fragments using ComposeView.✓ Copied
    → Hybrid navigation continues to work

Outcome: One screen cleanly ported without destabilizing the rest.

Pitfalls
  • Observer leaks when mixing with Fragment lifecycle — Use viewLifecycleOwner with ComposeView; release on destroy
Combine with: android

Combinations

Pair with other MCPs for X10 leverage

jetpack-compose-skill + android

Run the resulting screen in an emulator and iterate

Build the app, launch in the emulator, and show me the Profile screen.✓ Copied
jetpack-compose-skill + filesystem

Work across modules in a Compose project

Read feature/profile/ and add a Profile screen in ui/.✓ Copied

Tools

What this MCP exposes

ToolInputsWhen to callCost
compose-authoring screen intent + state Any new Compose UI 0
state-hoisting-review existing composable When a composable is hard to preview 0
view-to-compose-migration XML + behaviors Screen-by-screen migrations 0

Cost & Limits

What this costs to run

API quota
none
Tokens per call
3–15k per screen
Monetary
free
Tip
Scope to one screen + its ViewModel at a time

Security

Permissions, secrets, blast radius

Credential storage: none at skill level
Data egress: none

Troubleshooting

Common errors and fixes

Preview fails to render

Make composables stateless; drop the ViewModel from the preview path.

StateFlow not collecting on background

Use collectAsStateWithLifecycle, not collectAsState, on screens that may be backgrounded.

Alternatives

jetpack-compose-skills vs others

AlternativeWhen to use it insteadTradeoff
apple-hig-designer-skillYou're on iOS SwiftUI instead of Android ComposeDifferent platform
claude-android-skillYou need broader Android help beyond UILess Compose-specific

More

Resources

📖 Read the official README on GitHub

🐙 Browse open issues

🔍 Browse all 400+ MCP servers and Skills