Android Development Skill
This skill configures Claude Code to generate production-quality Android applications following Google's official architecture guidance and the NowInAndroid reference implementation.
Technology Stack
- Language: Kotlin
- UI: Jetpack Compose
- Architecture: MVVM with Unidirectional Data Flow (UDF)
- DI: Hilt
- Database: Room
- Network: Retrofit + Kotlinx Serialization
- Async: Kotlin Coroutines + Flow
- Testing: JUnit, Turbine, Compose Testing
- Build: Gradle with Convention Plugins
Architecture Principles
Layer Structure
feature/
├── ui/ ← Composables, ViewModels
├── domain/ ← Use cases, domain models
└── data/ ← Repositories, data sources, Room entities
ViewModel Pattern (UDF)
@HiltViewModel
class MyFeatureViewModel @Inject constructor(
private val myRepository: MyRepository
) : ViewModel() {
private val _uiState = MutableStateFlow(MyFeatureUiState())
val uiState: StateFlow<MyFeatureUiState> = _uiState.asStateFlow()
fun onAction(action: MyFeatureAction) {
when (action) {
is MyFeatureAction.UpdateItem -> updateItem(action.id)
}
}
private fun updateItem(id: String) {
viewModelScope.launch {
myRepository.getItem(id)
.catch { _uiState.update { it.copy(error = "Failed") } }
.collect { item -> _uiState.update { it.copy(item = item) } }
}
}
}
Composable Pattern
@Composable
fun MyFeatureScreen(
onNavigateToDetail: (String) -> Unit,
viewModel: MyFeatureViewModel = hiltViewModel()
) {
val uiState by viewModel.uiState.collectAsStateWithLifecycle()
MyFeatureContent(uiState = uiState,
}
Dependency Versions (version catalog)
[libraries]
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "compose-bom" }
hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" }
room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "room" }
Modularization
Follow NowInAndroid modularization: feature:, core:data, core:domain, core:ui, core:network. Each feature module is a self-contained vertical slice.
Testing
- Unit tests: JUnit + Turbine for Flow testing
- UI tests: Compose Testing
- Fakes over mocks: Prefer fake implementations for repositories in tests