Claude Android Skill
Claude Code skill for building modern Android apps following best practices.
Ask AI about Claude Android Skill
Powered by Claude Β· Grounded in docs
I know everything about Claude Android Skill. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
[WIP] Android Development Skill for Claude Code
A production-ready skill that enables Claude Code to build Android applications following Google's official architecture guidance and best practices from the NowInAndroid reference app.
Overview
This skill provides Claude with comprehensive knowledge of modern Android development patterns, including:
- Clean Architecture with UI, Domain, and Data layers
- Jetpack Compose patterns and best practices
- Multi-module project structure with convention plugins
- Offline-first architecture with Room and reactive streams
- Dependency injection with Hilt
- Comprehensive testing strategies
Installation
-
Clone this repository into your Claude Code skills directory:
git clone https://github.com/dpconde/claude-android-skill.git -
Claude Code will automatically detect and load the skill when you work on Android projects.
Usage
The skill automatically activates when you request Android-related tasks. Simply ask Claude to:
- "Create a new Android feature module for user settings"
- "Build a Compose screen with MVVM pattern"
- "Set up a Repository with offline-first architecture"
- "Add navigation to my Android app"
- "Configure multi-module Gradle setup"
Claude will follow the patterns and best practices defined in this skill.
Project Structure
claude-android-skill/
βββ SKILL.md # Main skill definition and quick reference
βββ references/ # Detailed documentation
β βββ architecture.md # UI, Domain, Data layers patterns
β βββ compose-patterns.md # Jetpack Compose best practices
β βββ gradle-setup.md # Build configuration & convention plugins
β βββ modularization.md # Multi-module project structure
β βββ testing.md # Testing strategies and patterns
βββ assets/
β βββ templates/ # Project templates
β βββ libs.versions.toml.template
β βββ settings.gradle.kts.template
βββ scripts/
βββ generate_feature.py # Feature module generator script
Core Principles
This skill teaches Claude to follow these key Android development principles:
- Offline-first: Local database as source of truth, synchronized with remote data
- Unidirectional data flow: Events flow down, data flows up (UDF pattern)
- Reactive streams: Use Kotlin Flow for all data exposure
- Modular by feature: Each feature is self-contained with clear API boundaries
- Testable by design: Use interfaces and test doubles, avoid mocking frameworks
Reference Documentation
Quick Navigation
| Topic | File | Description |
|---|---|---|
| Architecture | architecture.md | MVVM pattern, layers, repositories, use cases |
| Compose UI | compose-patterns.md | Screens, state hoisting, side effects, theming |
| Build Setup | gradle-setup.md | Convention plugins, version catalogs, configuration |
| Modularization | modularization.md | Module types, dependencies, feature structure |
| Testing | testing.md | Unit tests, UI tests, test doubles, strategies |
Architecture Overview
βββββββββββββββββββββββββββββββββββββββββββ
β UI Layer β
β (Compose Screens + ViewModels) β
βββββββββββββββββββββββββββββββββββββββββββ€
β Domain Layer β
β (Use Cases - optional, for reuse) β
βββββββββββββββββββββββββββββββββββββββββββ€
β Data Layer β
β (Repositories + DataSources) β
βββββββββββββββββββββββββββββββββββββββββββ
Module Types
app/ # Application module
feature/
βββ featurename/
β βββ api/ # Public navigation contracts
β βββ impl/ # Internal implementation
core/
βββ data/ # Repositories
βββ database/ # Room DAOs & entities
βββ network/ # Retrofit & API models
βββ model/ # Domain models
βββ ui/ # Reusable components
βββ designsystem/ # Theme & design tokens
βββ testing/ # Test utilities
Features
Code Generation
The skill includes a Python script to generate feature modules:
python scripts/generate_feature.py settings \
--package com.example.app \
--path /path/to/project
This creates a complete feature module with:
- API module with navigation definitions
- Implementation module with Screen, ViewModel, UiState
- Gradle build files with proper dependencies
- Hilt dependency injection setup
Templates
Pre-configured templates for common Android project files:
libs.versions.toml.template- Gradle version catalogsettings.gradle.kts.template- Project settings
Standard Patterns
ViewModel Pattern
@HiltViewModel
class MyFeatureViewModel @Inject constructor(
private val repository: MyRepository,
) : ViewModel() {
val uiState: StateFlow<MyFeatureUiState> = repository
.getData()
.map { MyFeatureUiState.Success(it) }
.stateIn(
scope = viewModelScope,
started = SharingStarted.WhileSubscribed(5_000),
initialValue = MyFeatureUiState.Loading,
)
}
Screen Pattern
@Composable
internal fun MyFeatureRoute(
viewModel: MyFeatureViewModel = hiltViewModel(),
) {
val uiState by viewModel.uiState.collectAsStateWithLifecycle()
MyFeatureScreen(uiState = uiState)
}
Repository Pattern
interface MyRepository {
fun getData(): Flow<List<MyModel>>
}
internal class OfflineFirstMyRepository @Inject constructor(
private val dao: MyDao,
private val api: MyNetworkApi,
) : MyRepository {
override fun getData(): Flow<List<MyModel>> =
dao.getAll().map { it.toModel() }
}
Technology Stack
This skill configures projects with:
- Language: Kotlin
- UI: Jetpack Compose
- Architecture: MVVM with UDF
- DI: Hilt
- Database: Room
- Network: Retrofit + Kotlinx Serialization
- Async: Kotlin Coroutines + Flow
- Testing: JUnit, Turbine, Compose Testing
- Build: Gradle with Convention Plugins
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Based on patterns and practices from:
