Skip to content
Back to search

android-development

SkillWorks with Claude CodeGitHub

Create production-quality Android applications following Google's official architecture guidance and NowInAndroid best practices. Use when building Android apps with Kotlin, Jetpack Compose, MVVM architecture, Hilt dependency injection, Room database, or multi-module projects. Triggers on requests to create Android projects, screens, ViewModels, repositories, feature modules, or when asked about Android architecture patterns.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/dpconde-claude-android-skill/badge.svg)](/listings/dpconde-claude-android-skill)

HTML

<a href="/listings/dpconde-claude-android-skill"><img src="/api/listings/dpconde-claude-android-skill/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

1. Clone this repository into your Claude Code skills directory:

   git clone https://github.com/dpconde/claude-android-skill.git

2. Claude Code will automatically detect and load the skill when you work on Android projects.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

SKILL.md · Manifest · 204 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. ---
  2. name: android-development
  3. description: Create production-quality Android applications following Google's official architecture guidance and NowInAndroid best practices. Use when building Android apps with Kotlin, Jetpack Compose, MVVM architecture, Hilt dependency injection, Room database, or multi-module projects. Triggers on requests to create Android projects, screens, ViewModels, repositories, feature modules, or when asked about Android architecture patterns.
  4. ---
  5. # Android Development
  6. Build Android applications following Google's official architecture guidance, as demonstrated in the NowInAndroid reference app.
  7. ## Quick Reference
  8. | Task | Reference File |
  9. |------|----------------|
  10. | Project structure & modules | [modularization.md](references/modularization.md) |
  11. | Architecture layers (UI, Domain, Data) | [architecture.md](references/architecture.md) |
  12. | Jetpack Compose patterns | [compose-patterns.md](references/compose-patterns.md) |
  13. | Gradle & build configuration | [gradle-setup.md](references/gradle-setup.md) |
  14. | Testing approach | [testing.md](references/testing.md) |
  15. ## Workflow Decision Tree
  16. **Creating a new project?**
  17. → Read [modularization.md](references/modularization.md) for project structure
  18. → Use templates in `assets/templates/`
  19. **Adding a new feature?**
  20. → Create feature module with `api` and `impl` submodules
  21. → Follow patterns in [architecture.md](references/architecture.md)
  22. **Building UI screens?**
  23. → Read [compose-patterns.md](references/compose-patterns.md)
  24. → Create Screen + ViewModel + UiState
  25. **Setting up data layer?**
  26. → Read data layer section in [architecture.md](references/architecture.md)
  27. → Create Repository + DataSource + DAO
  28. ## Core Principles
  29. 1. **Offline-first**: Local database is source of truth, sync with remote
  30. 2. **Unidirectional data flow**: Events flow down, data flows up
  31. 3. **Reactive streams**: Use Kotlin Flow for all data exposure
  32. 4. **Modular by feature**: Each feature is self-contained with clear boundaries
  33. 5. **Testable by design**: Use interfaces and test doubles, no mocking libraries
  34. ## Architecture Layers
  35. ```
  36. ┌─────────────────────────────────────────┐
  37. │ UI Layer │
  38. │ (Compose Screens + ViewModels) │
  39. ├─────────────────────────────────────────┤
  40. │ Domain Layer │
  41. │ (Use Cases - optional, for reuse) │
  42. ├─────────────────────────────────────────┤
  43. │ Data Layer │
  44. │ (Repositories + DataSources) │
  45. └─────────────────────────────────────────┘
  46. ```
  47. ## Module Types
  48. ```
  49. app/ # App module - navigation, scaffolding
  50. feature/
  51. ├── featurename/
  52. │ ├── api/ # Navigation keys (public)
  53. │ └── impl/ # Screen, ViewModel, DI (internal)
  54. core/
  55. ├── data/ # Repositories
  56. ├── database/ # Room DAOs, entities
  57. ├── network/ # Retrofit, API models
  58. ├── model/ # Domain models (pure Kotlin)
  59. ├── common/ # Shared utilities
  60. ├── ui/ # Reusable Compose components
  61. ├── designsystem/ # Theme, icons, base components
  62. ├── datastore/ # Preferences storage
  63. └── testing/ # Test utilities
  64. ```
  65. ## Creating a New Feature
  66. 1. Create `feature:myfeature:api` module with navigation key
  67. 2. Create `feature:myfeature:impl` module with:
  68. - `MyFeatureScreen.kt` - Composable UI
  69. - `MyFeatureViewModel.kt` - State holder
  70. - `MyFeatureUiState.kt` - Sealed interface for states
  71. - `MyFeatureNavigation.kt` - Navigation setup
  72. - `MyFeatureModule.kt` - Hilt DI module
  73. ## Standard File Patterns
  74. ### ViewModel Pattern
  75. ```kotlin
  76. @HiltViewModel
  77. class MyFeatureViewModel @Inject constructor(
  78. private val myRepository: MyRepository,
  79. ) : ViewModel() {
  80. val uiState: StateFlow<MyFeatureUiState> = myRepository
  81. .getData()
  82. .map { data -> MyFeatureUiState.Success(data) }
  83. .stateIn(
  84. scope = viewModelScope,
  85. started = SharingStarted.WhileSubscribed(5_000),
  86. initialValue = MyFeatureUiState.Loading,
  87. )
  88. fun onAction(action: MyFeatureAction) {
  89. when (action) {
  90. is MyFeatureAction.ItemClicked -> handleItemClick(action.id)
  91. }
  92. }
  93. }
  94. ```
  95. ### UiState Pattern
  96. ```kotlin
  97. sealed interface MyFeatureUiState {
  98. data object Loading : MyFeatureUiState
  99. data class Success(val items: List<Item>) : MyFeatureUiState
  100. data class Error(val message: String) : MyFeatureUiState
  101. }
  102. ```
  103. ### Screen Pattern
  104. ```kotlin
  105. @Composable
  106. internal fun MyFeatureRoute(
  107. onNavigateToDetail: (String) -> Unit,
  108. viewModel: MyFeatureViewModel = hiltViewModel(),
  109. ) {
  110. val uiState by viewModel.uiState.collectAsStateWithLifecycle()
  111. MyFeatureScreen(
  112. uiState = uiState,
  113. onAction = viewModel::onAction,
  114. onNavigateToDetail = onNavigateToDetail,
  115. )
  116. }
  117. @Composable
  118. internal fun MyFeatureScreen(
  119. uiState: MyFeatureUiState,
  120. onAction: (MyFeatureAction) -> Unit,
  121. onNavigateToDetail: (String) -> Unit,
  122. ) {
  123. when (uiState) {
  124. is MyFeatureUiState.Loading -> LoadingIndicator()
  125. is MyFeatureUiState.Success -> ContentList(uiState.items, onAction)
  126. is MyFeatureUiState.Error -> ErrorMessage(uiState.message)
  127. }
  128. }
  129. ```
  130. ### Repository Pattern
  131. ```kotlin
  132. interface MyRepository {
  133. fun getData(): Flow<List<MyModel>>
  134. suspend fun updateItem(id: String, data: MyModel)
  135. }
  136. internal class OfflineFirstMyRepository @Inject constructor(
  137. private val localDataSource: MyDao,
  138. private val networkDataSource: MyNetworkApi,
  139. ) : MyRepository {
  140. override fun getData(): Flow<List<MyModel>> =
  141. localDataSource.getAll().map { entities ->
  142. entities.map { it.toModel() }
  143. }
  144. override suspend fun updateItem(id: String, data: MyModel) {
  145. localDataSource.upsert(data.toEntity())
  146. }
  147. }
  148. ```
  149. ## Key Dependencies
  150. ```kotlin
  151. // Gradle version catalog (libs.versions.toml)
  152. [versions]
  153. kotlin = "1.9.x"
  154. compose-bom = "2024.x.x"
  155. hilt = "2.48"
  156. room = "2.6.x"
  157. coroutines = "1.7.x"
  158. [libraries]
  159. androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "compose-bom" }
  160. hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" }
  161. room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "room" }
  162. ```
  163. ## Build Configuration
  164. Use convention plugins in `build-logic/` for consistent configuration:
  165. - `AndroidApplicationConventionPlugin` - App modules
  166. - `AndroidLibraryConventionPlugin` - Library modules
  167. - `AndroidFeatureConventionPlugin` - Feature modules
  168. - `AndroidComposeConventionPlugin` - Compose setup
  169. - `AndroidHiltConventionPlugin` - Hilt setup
  170. See [gradle-setup.md](references/gradle-setup.md) for complete build configuration.
README.md · README · 210 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # [WIP] Android Development Skill for Claude Code
  2. A production-ready skill that enables Claude Code to build Android applications following Google's official architecture guidance and best practices from the [NowInAndroid](https://github.com/android/nowinandroid) reference app.
  3. ## Overview
  4. This skill provides Claude with comprehensive knowledge of modern Android development patterns, including:
  5. - **Clean Architecture** with UI, Domain, and Data layers
  6. - **Jetpack Compose** patterns and best practices
  7. - **Multi-module project structure** with convention plugins
  8. - **Offline-first architecture** with Room and reactive streams
  9. - **Dependency injection** with Hilt
  10. - **Comprehensive testing** strategies
  11. ## Installation
  12. 1. Clone this repository into your Claude Code skills directory:
  13. ```bash
  14. git clone https://github.com/dpconde/claude-android-skill.git
  15. ```
  16. 2. Claude Code will automatically detect and load the skill when you work on Android projects.
  17. ## Usage
  18. The skill automatically activates when you request Android-related tasks. Simply ask Claude to:
  19. - "Create a new Android feature module for user settings"
  20. - "Build a Compose screen with MVVM pattern"
  21. - "Set up a Repository with offline-first architecture"
  22. - "Add navigation to my Android app"
  23. - "Configure multi-module Gradle setup"
  24. Claude will follow the patterns and best practices defined in this skill.
  25. ## Project Structure
  26. ```
  27. claude-android-skill/
  28. ├── SKILL.md # Main skill definition and quick reference
  29. ├── references/ # Detailed documentation
  30. │ ├── architecture.md # UI, Domain, Data layers patterns
  31. │ ├── compose-patterns.md # Jetpack Compose best practices
  32. │ ├── gradle-setup.md # Build configuration & convention plugins
  33. │ ├── modularization.md # Multi-module project structure
  34. │ └── testing.md # Testing strategies and patterns
  35. ├── assets/
  36. │ └── templates/ # Project templates
  37. │ ├── libs.versions.toml.template
  38. │ └── settings.gradle.kts.template
  39. └── scripts/
  40. └── generate_feature.py # Feature module generator script
  41. ```
  42. ## Core Principles
  43. This skill teaches Claude to follow these key Android development principles:
  44. 1. **Offline-first**: Local database as source of truth, synchronized with remote data
  45. 2. **Unidirectional data flow**: Events flow down, data flows up (UDF pattern)
  46. 3. **Reactive streams**: Use Kotlin Flow for all data exposure
  47. 4. **Modular by feature**: Each feature is self-contained with clear API boundaries
  48. 5. **Testable by design**: Use interfaces and test doubles, avoid mocking frameworks
  49. ## Reference Documentation
  50. ### Quick Navigation
  51. | Topic | File | Description |
  52. |-------|------|-------------|
  53. | Architecture | [architecture.md](references/architecture.md) | MVVM pattern, layers, repositories, use cases |
  54. | Compose UI | [compose-patterns.md](references/compose-patterns.md) | Screens, state hoisting, side effects, theming |
  55. | Build Setup | [gradle-setup.md](references/gradle-setup.md) | Convention plugins, version catalogs, configuration |
  56. | Modularization | [modularization.md](references/modularization.md) | Module types, dependencies, feature structure |
  57. | Testing | [testing.md](references/testing.md) | Unit tests, UI tests, test doubles, strategies |
  58. ## Architecture Overview
  59. ```
  60. ┌─────────────────────────────────────────┐
  61. │ UI Layer │
  62. │ (Compose Screens + ViewModels) │
  63. ├─────────────────────────────────────────┤
  64. │ Domain Layer │
  65. │ (Use Cases - optional, for reuse) │
  66. ├─────────────────────────────────────────┤
  67. │ Data Layer │
  68. │ (Repositories + DataSources) │
  69. └─────────────────────────────────────────┘
  70. ```
  71. ### Module Types
  72. ```
  73. app/ # Application module
  74. feature/
  75. ├── featurename/
  76. │ ├── api/ # Public navigation contracts
  77. │ └── impl/ # Internal implementation
  78. core/
  79. ├── data/ # Repositories
  80. ├── database/ # Room DAOs & entities
  81. ├── network/ # Retrofit & API models
  82. ├── model/ # Domain models
  83. ├── ui/ # Reusable components
  84. ├── designsystem/ # Theme & design tokens
  85. └── testing/ # Test utilities
  86. ```
  87. ## Features
  88. ### Code Generation
  89. The skill includes a Python script to generate feature modules:
  90. ```bash
  91. python scripts/generate_feature.py settings \
  92. --package com.example.app \
  93. --path /path/to/project
  94. ```
  95. This creates a complete feature module with:
  96. - API module with navigation definitions
  97. - Implementation module with Screen, ViewModel, UiState
  98. - Gradle build files with proper dependencies
  99. - Hilt dependency injection setup
  100. ### Templates
  101. Pre-configured templates for common Android project files:
  102. - `libs.versions.toml.template` - Gradle version catalog
  103. - `settings.gradle.kts.template` - Project settings
  104. ## Standard Patterns
  105. ### ViewModel Pattern
  106. ```kotlin
  107. @HiltViewModel
  108. class MyFeatureViewModel @Inject constructor(
  109. private val repository: MyRepository,
  110. ) : ViewModel() {
  111. val uiState: StateFlow<MyFeatureUiState> = repository
  112. .getData()
  113. .map { MyFeatureUiState.Success(it) }
  114. .stateIn(
  115. scope = viewModelScope,
  116. started = SharingStarted.WhileSubscribed(5_000),
  117. initialValue = MyFeatureUiState.Loading,
  118. )
  119. }
  120. ```
  121. ### Screen Pattern
  122. ```kotlin
  123. @Composable
  124. internal fun MyFeatureRoute(
  125. viewModel: MyFeatureViewModel = hiltViewModel(),
  126. ) {
  127. val uiState by viewModel.uiState.collectAsStateWithLifecycle()
  128. MyFeatureScreen(uiState = uiState)
  129. }
  130. ```
  131. ### Repository Pattern
  132. ```kotlin
  133. interface MyRepository {
  134. fun getData(): Flow<List<MyModel>>
  135. }
  136. internal class OfflineFirstMyRepository @Inject constructor(
  137. private val dao: MyDao,
  138. private val api: MyNetworkApi,
  139. ) : MyRepository {
  140. override fun getData(): Flow<List<MyModel>> =
  141. dao.getAll().map { it.toModel() }
  142. }
  143. ```
  144. ## Technology Stack
  145. This skill configures projects with:
  146. - **Language**: Kotlin
  147. - **UI**: Jetpack Compose
  148. - **Architecture**: MVVM with UDF
  149. - **DI**: Hilt
  150. - **Database**: Room
  151. - **Network**: Retrofit + Kotlinx Serialization
  152. - **Async**: Kotlin Coroutines + Flow
  153. - **Testing**: JUnit, Turbine, Compose Testing
  154. - **Build**: Gradle with Convention Plugins
  155. ## License
  156. This project is licensed under the MIT License - see the LICENSE file for details.
  157. ## Acknowledgments
  158. Based on patterns and practices from:
  159. - [NowInAndroid](https://github.com/android/nowinandroid) by Google
  160. - [Android Architecture Guidelines](https://developer.android.com/topic/architecture)
  161. - [Jetpack Compose Best Practices](https://developer.android.com/jetpack/compose)
  162. ## Resources
  163. - [Android Developer Documentation](https://developer.android.com)
  164. - [NowInAndroid Repository](https://github.com/android/nowinandroid)
  165. - [Kotlin Documentation](https://kotlinlang.org/docs/home.html)
  166. - [Jetpack Compose Pathway](https://developer.android.com/courses/pathways/compose)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.