/ ディレクトリ / プレイグラウンド / jetpack-compose-skills
● コミュニティ anhvt52 ⚡ 即起動

jetpack-compose-skills

作者 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.

なぜ使うのか

主な機能

ライブデモ

実際の動作

jetpack-compose-skill.replay ▶ 準備完了
0/0

インストール

クライアントを選択

~/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
    }
  }
}

Claude Desktop → Settings → Developer → Edit Config を開く。保存後、アプリを再起動。

~/.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 は Claude Desktop と同じ mcpServers スキーマを使用。プロジェクト設定はグローバルより優先。

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
    }
  }
}

Cline サイドバーの MCP Servers アイコンをクリックし、"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
    }
  }
}

Claude Desktop と同じ形式。Windsurf を再起動して反映。

~/.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 はマップではなくサーバーオブジェクトの配列を使用。

~/.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"
        ]
      }
    }
  }
}

context_servers に追加。保存時に Zed がホットリロード。

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

ワンライナー。claude mcp list で確認、claude mcp remove で削除。

ユースケース

実用的な使い方: jetpack-compose-skills

How to build a new Compose screen with state hoisting

👤 Android developers writing Compose UI ⏱ ~30 min intermediate

使うタイミング: New screen in a Compose app — get it right the first time rather than refactoring later.

前提条件
  • 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
フロー
  1. Describe the screen
    Build a Profile screen: avatar, name, bio, follow button. State comes from a ProfileViewModel.✓ コピーしました
    → Stateless composable + stateful wrapper + preview
  2. Wire the ViewModel
    Hook up the ViewModel using collectAsStateWithLifecycle.✓ コピーしました
    → Lifecycle-aware state collection
  3. Add a preview
    Add @Preview variants for empty, loaded, and error states.✓ コピーしました
    → Three previews rendering without a live ViewModel

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

注意点
  • 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.
組み合わせ: filesystem

Migrate a Views-based screen to Compose

👤 Teams converting legacy Android screens ⏱ ~90 min advanced

使うタイミング: You want to convert one screen at a time without rewriting the whole app.

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

結果: One screen cleanly ported without destabilizing the rest.

注意点
  • Observer leaks when mixing with Fragment lifecycle — Use viewLifecycleOwner with ComposeView; release on destroy
組み合わせ: android

組み合わせ

他のMCPと組み合わせて10倍の力を

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.✓ コピーしました
jetpack-compose-skill + filesystem

Work across modules in a Compose project

Read feature/profile/ and add a Profile screen in ui/.✓ コピーしました

ツール

このMCPが提供する機能

ツール入力呼び出すタイミングコスト
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

コストと制限

運用コスト

APIクォータ
none
呼び出しあたりのトークン
3–15k per screen
金額
free
ヒント
Scope to one screen + its ViewModel at a time

セキュリティ

権限、シークレット、影響範囲

認証情報の保管: none at skill level
データ送信先: none

トラブルシューティング

よくあるエラーと対処法

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.

代替案

jetpack-compose-skills 他との比較

代替案代わりに使う場面トレードオフ
apple-hig-designer-skillYou're on iOS SwiftUI instead of Android ComposeDifferent platform
claude-android-skillYou need broader Android help beyond UILess Compose-specific

その他

リソース

📖 GitHub の公式 README を読む

🐙 オープンな issue を見る

🔍 400以上のMCPサーバーとSkillsを見る