/ 目录 / 演练场 / claude-android-skill
● 社区 dpconde ⚡ 即开即用

claude-android-skill

作者 dpconde · dpconde/claude-android-skill

Teaches Claude Code to build modern Android apps the Google way — Clean Architecture, Compose, Hilt, Room, Flow, offline-first, multi-module by feature.

A skill that encodes modern Android best practices (mirroring the NowInAndroid reference) into Claude Code: Clean Architecture with UI/Domain/Data layers, MVVM + UDF, Jetpack Compose for UI, Hilt for DI, Room for persistence, Kotlin Flow for reactive streams, Retrofit for networking, and a multi-module feature-first project structure.

为什么要用

核心特性

实时演示

实际使用效果

claude-android-skill.replay ▶ 就绪
0/0

安装

选择你的客户端

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

打开 Claude Desktop → Settings → Developer → Edit Config。保存后重启应用。

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

Cursor 使用与 Claude Desktop 相同的 mcpServers 格式。项目级配置优先于全局。

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

点击 Cline 侧栏中的 MCP Servers 图标,然后选 "Edit Configuration"。

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

格式与 Claude Desktop 相同。重启 Windsurf 生效。

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

Continue 使用服务器对象数组,而非映射。

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

加入 context_servers。Zed 保存后热重载。

claude mcp add claude-android-skill -- git clone https://github.com/dpconde/claude-android-skill ~/.claude/skills/claude-android-skill

一行命令搞定。用 claude mcp list 验证,claude mcp remove 卸载。

使用场景

实战用法: claude-android-skill

Scaffold a new Android app with modern architecture

👤 Android developers starting a greenfield project ⏱ ~60 min intermediate

何时使用: You're starting a new app and don't want to make architectural mistakes you'll fix in 6 months.

前置条件
  • Skill cloned — git clone https://github.com/dpconde/claude-android-skill ~/.claude/skills/claude-android-skill
  • Android Studio + JDK 17 — Install latest stable Android Studio
步骤
  1. Ask Claude to scaffold the module structure
    Use claude-android-skill. Scaffold a multi-module Android app called 'HabitTracker' with features: home, tracking, settings. Compose UI, Hilt DI, Room DB, offline-first.✓ 已复制
    → Modules :app, :core:database, :core:ui, :feature:home… generated
  2. Add first feature end-to-end
    Implement the tracking feature: data layer with Room entity, domain layer with use cases, UI with Compose and ViewModel. Include unit tests.✓ 已复制
    → Files across 3 layers + tests all compile

结果: A running app that follows NowInAndroid-style patterns.

注意事项
  • Over-engineering a tiny app into 8 modules — Tell the skill explicitly: 'single-module is fine here' for simple projects
搭配使用: filesystem · github

Migrate a Fragment/XML screen to Compose

👤 Android teams modernizing legacy screens ⏱ ~45 min intermediate

何时使用: You have an XML screen and want Compose without rewriting everything in one go.

步骤
  1. Analyze the existing screen
    Here's the Fragment + XML for SettingsScreen. Plan a Compose migration keeping the ViewModel intact.✓ 已复制
    → Step plan: wrap in ComposeView, port Views, clean XML
  2. Apply the migration
    Implement step 1 — add ComposeView and move the header to Compose.✓ 已复制
    → Hybrid screen works; subsequent steps staged

结果: A Compose screen with ViewModel contract preserved.

注意事项
  • State lost during migration — Keep the same ViewModel; only the UI layer changes
搭配使用: github

Add offline-first support to an online-only feature

👤 Developers whose app breaks without network ⏱ ~90 min advanced

何时使用: You have a Retrofit-only feature and want cached / queued behavior.

步骤
  1. Introduce Room + repository
    Use claude-android-skill to convert the profile feature to offline-first. Add Room entity, repository returning Flow, and a sync worker.✓ 已复制
    → Data layer restructured, repository is the single source of truth
  2. Wire UI to the Flow
    Update ViewModel to collect from the repository Flow; handle loading/empty/error states in Compose.✓ 已复制
    → UI works offline on first launch after sync

结果: A feature that works in airplane mode.

注意事项
  • Conflict resolution forgotten — Decide the strategy up front: LWW, server-wins, or merged — the skill will prompt you

组合

与其他 MCP 搭配,撬动十倍杠杆

claude-android-skill + github

Open a PR per feature to keep the scaffold reviewable

Generate the home feature and open a GitHub PR with just those files.✓ 已复制
claude-android-skill + filesystem

Edit across many modules in one session

Apply the Hilt migration across every :feature:* module.✓ 已复制

工具

此 MCP 暴露的能力

工具输入参数何时调用成本
scaffold_module_tree app name, feature list Greenfield start 0
generate_feature feature name, data model Adding a new feature 0
migrate_to_compose fragment/xml path Legacy screen modernization 0

成本与限制

运行它的成本

API 配额
None from the skill; Android SDK is free
每次调用 Token 数
Large — scaffold + tests can run 20k+ tokens
费用
Free
提示
Scaffold once, then iterate feature-by-feature — avoid 'generate the whole app' prompts

安全

权限、密钥、影响范围

凭据存储: API keys go in local.properties + BuildConfig, never committed
数据出站: None from the skill itself

故障排查

常见错误与修复

Hilt compile error: missing @HiltAndroidApp

Ensure the Application class is annotated and declared in manifest

验证: grep -r '@HiltAndroidApp' app/src/
Room schema mismatch on migration

Either provide a Migration, or set fallbackToDestructiveMigration in dev

Compose preview won't render

Add the Compose preview dependency and annotate @Preview correctly

替代方案

claude-android-skill 对比其他方案

替代方案何时用它替代权衡
Google's NowInAndroid repoYou just want a reference project to copy fromStatic — doesn't generate code for you

更多

资源

📖 阅读 GitHub 上的官方 README

🐙 查看未解决的 issue

🔍 浏览全部 400+ MCP 服务器和 Skills