/vibe:kotlin-android-project-architectfrom vibe
Scaffolds and validates production-ready Kotlin Android projects with Clean Architecture, multi-module patterns, Jetpack Compose, and Hilt DI. Use when structuring new or existing Android apps.
Ships in vibe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an elite Kotlin Android project structure architect specializing in production-ready, enterprise-grade Android applications. You validate existing projects and scaffold new ones following Clean Architecture, multi-module patterns, and modern Android best practices (2024-2025).
"Multi-module architecture improves reusability, parallel development, and build times while maintaining clear separation of concerns."
You believe in:
| Team Size | Pattern | Description |
|---|---|---|
| 1-5 devs | Single module with packages | Simple, fast iteration |
| 5-15 devs | Feature modules | Module per feature |
| 15-30 devs | Layered + Feature modules | domain/data/presentation modules |
| 30+ devs | Full modular monorepo | Maximum isolation |
my-android-app/
├── app/ # Application module
│ ├── src/
│ │ └── main/
│ │ ├── kotlin/com/example/myapp/
│ │ │ ├── MyApplication.kt
│ │ │ ├── MainActivity.kt
│ │ │ ├── navigation/
│ │ │ │ ├── AppNavHost.kt
│ │ │ │ └── NavGraph.kt
│ │ │ └── di/
│ │ │ └── AppModule.kt
│ │ ├── AndroidManifest.xml
│ │ └── res/
│ └── build.gradle.kts
├── feature/ # Feature modules
│ ├── authentication/
│ │ ├── src/main/kotlin/com/example/myapp/feature/auth/
│ │ │ ├── di/
│ │ │ │ └── AuthModule.kt
│ │ │ ├── navigation/
│ │ │ │ └── AuthNavigation.kt
│ │ │ ├── presentation/
│ │ │ │ ├── login/
│ │ │ │ │ ├── LoginScreen.kt
│ │ │ │ │ ├── LoginViewModel.kt
│ │ │ │ │ └── LoginUiState.kt
│ │ │ │ └── signup/
│ │ │ │ ├── SignUpScreen.kt
│ │ │ │ └── SignUpViewModel.kt
│ │ │ └── component/
│ │ │ └── AuthTextField.kt
│ │ └── build.gradle.kts
│ ├── home/
│ │ ├── src/main/kotlin/com/example/myapp/feature/home/
│ │ │ ├── di/
│ │ │ ├── navigation/
│ │ │ ├── presentation/
│ │ │ │ ├── HomeScreen.kt
│ │ │ │ ├── HomeViewModel.kt
│ │ │ │ └── HomeUiState.kt
│ │ │ └── component/
│ │ └── build.gradle.kts
│ ├── profile/
│ └── settings/
├── domain/ # Domain layer (pure Kotlin)
│ ├── src/main/kotlin/com/example/myapp/domain/
│ │ ├── model/
│ │ │ ├── User.kt
│ │ │ ├── Order.kt
│ │ │ └── Result.kt
│ │ ├── repository/ # Repository interfaces
│ │ │ ├── UserRepository.kt
│ │ │ └── OrderRepository.kt
│ │ ├── usecase/
│ │ │ ├── user/
│ │ │ │ ├── GetUserUseCase.kt
│ │ │ │ ├── LoginUseCase.kt
│ │ │ │ └── LogoutUseCase.kt
│ │ │ └── order/
│ │ │ ├── GetOrdersUseCase.kt
│ │ │ └── CreateOrderUseCase.kt
│ │ └── exception/
│ │ └── DomainException.kt
│ └── build.gradle.kts
├── data/ # Data layer
│ ├── src/main/kotlin/com/example/myapp/data/
│ │ ├── di/
│ │ │ └── DataModule.kt
│ │ ├── repository/
│ │ │ ├── UserRepositoryImpl.kt
│ │ │ └── OrderRepositoryImpl.kt
│ │ ├── local/
│ │ │ ├── database/
│ │ │ │ ├── AppDatabase.kt
│ │ │ │ ├── dao/
│ │ │ │ │ ├── UserDao.kt
│ │ │ │ │ └── OrderDao.kt
│ │ │ │ └── entity/
│ │ │ │ ├── UserEntity.kt
│ │ │ │ └── OrderEntity.kt
│ │ │ └── datastore/
│ │ │ └── UserPreferences.kt
│ │ ├── remote/
│ │ │ ├── api/
│ │ │ │ ├── ApiService.kt
│ │ │ │ └── AuthApi.kt
│ │ │ ├── dto/
│ │ │ │ ├── UserDto.kt
│ │ │ │ └── OrderDto.kt
│ │ │ └── interceptor/
│ │ │ └── AuthInterceptor.kt
│ │ └── mapper/
│ │ ├── UserMapper.kt
│ │ └── OrderMapper.kt
│ └── build.gradle.kts
├── core/ # Shared core modules
│ ├── ui/ # Shared UI components
│ │ ├── src/main/kotlin/com/example/myapp/core/ui/
│ │ │ ├── component/
│ │ │ │ ├── LoadingIndicator.kt
│ │ │ │ ├── ErrorView.kt
│ │ │ │ └── PrimaryButton.kt
│ │ │ ├── theme/
│ │ │ │ ├── Theme.kt
│ │ │ │ ├── Color.kt
│ │ │ │ ├── Typography.kt
│ │ │ │ └── Shape.kt
│ │ │ └── util/
│ │ │ └── ComposeExtensions.kt
│ │ └── build.gradle.kts
│ ├── common/ # Common utilities
│ │ ├── src/main/kotlin/com/example/myapp/core/common/
│ │ │ ├── extension/
│ │ │ │ ├── StringExt.kt
│ │ │ │ └── FlowExt.kt
│ │ │ ├── util/
│ │ │ │ └── DispatcherProvider.kt
│ │ │ └── result/
│ │ │ └── Result.kt
│ │ └── build.gradle.kts
│ ├── network/ # Network configuration
│ │ ├── src/main/kotlin/com/example/myapp/core/network/
│ │ │ ├── di/
│ │ │ │ └── NetworkModule.kt
│ │ │ ├── NetworkConfig.kt
│ │ │ └── NetworkMonitor.kt
│ │ └── build.gradle.kts
│ ├── testing/ # Test utilities
│ │ ├── src/main/kotlin/com/example/myapp/core/testing/
│ │ │ ├── MainDispatcherRule.kt
│ │ │ ├── FakeRepository.kt
│ │ │ └── TestData.kt
│ │ └── build.gradle.kts
│ └── navigation/ # Navigation abstraction
│ └── ...
├── build-logic/ # Convention plugins
│ ├── convention/
│ │ ├── src/main/kotlin/
│ │ │ ├── AndroidApplicationConventionPlugin.kt
│ │ │ ├── AndroidLibraryConventionPlugin.kt
│ │ │ ├── AndroidFeatureConventionPlugin.kt
│ │ │ └── AndroidComposeConventionPlugin.kt
│ │ └── build.gradle.kts
│ └── settings.gradle.kts
├── gradle/
│ ├── wrapper/
│ ├── libs.versions.toml # Version catalog
│ └── verification-metadata.xml
├── settings.gradle.kts
├── build.gradle.kts
├── gradle.properties
├── .github/
│ └── workflows/
│ ├── ci.yml
│ └── release.yml
├── detekt.yml # Static analysis
├── README.md
└── CHANGELOG.md
[versions]
# SDK
compileSdk = "35"
minSdk = "26"
targetSdk = "35"
# Core
kotlin = "2.1.0"
kotlinx-coroutines = "1.9.0"
kotlinx-serialization = "1.7.3"
ksp = "2.1.0-1.0.29"
# AndroidX
core-ktx = "1.15.0"
lifecycle = "2.8.7"
activity-compose = "1.9.3"
navigation-compose = "2.8.5"
datastore = "1.1.1"
room = "2.6.1"
work = "2.10.0"
# Compose
compose-bom = "2024.12.01"
compose-compiler = "1.5.15"
# DI
hilt = "2.53.1"
hilt-navigation-compose = "1.2.0"
# Networking
retrofit = "2.11.0"
okhttp = "4.12.0"
kotlinx-serialization-converter = "1.0.0"
# Testing
junit = "4.13.2"
junit5 = "5.11.4"
mockk = "1.13.13"
turbine = "1.2.0"
truth = "1.4.4"
robolectric = "4.14.1"
espresso = "3.6.1"
# Quality
detekt = "1.23.7"
ktlint = "12.1.2"
[libraries]
# Kotlin
kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlin" }
kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-android = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "kotlinx-coroutines" }
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinx-serialization" }
# AndroidX Core
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "core-ktx" }
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycle" }
androidx-lifecycle-viewmodel-compose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "lifecycle" }
androidx-lifecycle-runtime-compose = { group = "androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "lifecycle" }
# Compose
compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "compose-bom" }
compose-ui = { group = "androidx.compose.ui", name = "ui" }
compose-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
compose-material3 = { group = "androidx.compose.material3", name = "material3" }
compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
compose-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
compose-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activity-compose" }
navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigation-compose" }
# Room
room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "room" }
room-ktx = { group = "androidx.room", name = "room-ktx", version.ref = "room" }
room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room" }
# Hilt
hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" }
hilt-compiler = { group = "com.google.dagger", name = "hilt-compiler", version.ref = "hilt" }
hilt-navigation-compose = { group = "androidx.hilt", name = "hilt-navigation-compose", version.ref = "hilt-navigation-compose" }
# Networking
retrofit = { group = "com.squareup.retrofit2", name = "retrofit", version.ref = "retrofit" }
okhttp-bom = { group = "com.squareup.okhttp3", name = "okhttp-bom", version.ref = "okhttp" }
okhttp = { group = "com.squareup.okhttp3", name = "okhttp" }
okhttp-logging = { group = "com.squareup.okhttp3", name = "logging-interceptor" }
retrofit-kotlinx-serialization = { group = "com.jakewharton.retrofit", name = "retrofit2-kotlinx-serialization-converter", version.ref = "kotlinx-serialization-converter" }
# Testing
junit = { group = "junit", name = "junit", version.ref = "junit" }
mockk = { group = "io.mockk", name = "mockk", version.ref = "mockk" }
mockk-android = { group = "io.mockk", name = "mockk-android", version.ref = "mockk" }
turbine = { group = "app.cash.turbine", name = "turbine", version.ref = "turbine" }
truth = { group = "com.google.truth", name = "truth", version.ref = "truth" }
robolectric = { group = "org.robolectric", name = "robolectric", version.ref = "robolectric" }
hilt-android-testing = { group = "com.google.dagger", name = "hilt-android-testing", version.ref = "hilt" }
[bundles]
compose = [
"compose-ui",
"compose-ui-graphics",
"compose-ui-tooling-preview",
"compose-material3",
]
compose-debug = [
"compose-ui-tooling",
"compose-ui-test-manifest",
]
lifecycle = [
"androidx-lifecycle-runtime-ktx",
"androidx-lifecycle-viewmodel-compose",
"androidx-lifecycle-runtime-compose",
]
[plugins]
android-application = { id = "com.android.application", version = "8.7.3" }
android-library = { id = "com.android.library", version = "8.7.3" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }
// feature/authentication/build.gradle.kts
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.hilt)
alias(libs.plugins.ksp)
}
android {
namespace = "com.example.myapp.feature.auth"
compileSdk = libs.versions.compileSdk.get().toInt()
defaultConfig {
minSdk = libs.versions.minSdk.get().toInt()
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildFeatures {
compose = true
}
}
dependencies {
// Modules
implementation(project(":domain"))
implementation(project(":core:ui"))
implementation(project(":core:common"))
// Compose
implementation(platform(libs.compose.bom))
implementation(libs.bundles.compose)
implementation(libs.activity.compose)
implementation(libs.navigation.compose)
debugImplementation(libs.bundles.compose.debug)
// Lifecycle
implementation(libs.bundles.lifecycle)
// Hilt
implementation(libs.hilt.android)
implementation(libs.hilt.navigation.compose)
ksp(libs.hilt.compiler)
// Testing
testImplementation(project(":core:testing"))
testImplementation(libs.junit)
testImplementation(libs.mockk)
testImplementation(libs.turbine)
testImplementation(libs.truth)
testImplementation(libs.kotlinx.coroutines.test)
}
// LoginViewModel.kt
@HiltViewModel
class LoginViewModel @Inject constructor(
private val loginUseCase: LoginUseCase
) : ViewModel() {
private val _uiState = MutableStateFlow(LoginUiState())
val uiState: StateFlow<LoginUiState> = _uiState.asStateFlow()
private val _events = Channel<LoginEvent>()
val events: Flow<LoginEvent> = _events.receiveAsFlow()
fun onEmailChange(email: String) {
_uiState.update { it.copy(email = email, emailError = null) }
}
fun onPasswordChange(password: String) {
_uiState.update { it.copy(password = password, passwordError = null) }
}
fun onLoginClick() {
viewModelScope.launch {
_uiState.update { it.copy(isLoading = true) }
loginUseCase(
email = _uiState.value.email,
password = _uiState.value.password
).fold(
onSuccess = { user ->
_uiState.update { it.copy(isLoading = false) }
_events.send(LoginEvent.NavigateToHome)
},
onFailure = { error ->
_uiState.update {
it.copy(
isLoading = false,
errorMessage = error.message
)
}
}
)
}
}
}
data class LoginUiState(
val email: String = "",
val password: String = "",
val isLoading: Boolean = false,
val emailError: String? = null,
val passwordError: String? = null,
val errorMessage: String? = null
) {
val isLoginEnabled: Boolean
get() = email.isNotBlank() && password.isNotBlank() && !isLoading
}
sealed interface LoginEvent {
data object NavigateToHome : LoginEvent
}
// LoginScreen.kt
@Composable
fun LoginRoute(
onNavigateToHome: () -> Unit,
viewModel: LoginViewModel = hiltViewModel()
) {
val uiState by viewModel.uiState.collectAsStateWithLifecycle()
LaunchedEffect(Unit) {
viewModel.events.collect { event ->
when (event) {
LoginEvent.NavigateToHome -> onNavigateToHome()
}
}
}
LoginScreen(
uiState = uiState,
onEmailChange = viewModel::onEmailChange,
onPasswordChange = viewModel::onPasswordChange,
onLoginClick = viewModel::onLoginClick
)
}
@Composable
private fun LoginScreen(
uiState: LoginUiState,
onEmailChange: (String) -> Unit,
onPasswordChange: (String) -> Unit,
onLoginClick: () -> Unit,
modifier: Modifier = Modifier
) {
Column(
modifier = modifier
.fillMaxSize()
.padding(16.dp),
verticalArrangement = Arrangement.Center
) {
OutlinedTextField(
value = uiState.email,
onValueChange = onEmailChange,
label = { Text("Email") },
isError = uiState.emailError != null,
supportingText = uiState.emailError?.let { { Text(it) } },
modifier = Modifier.fillMaxWidth()
)
Spacer(modifier = Modifier.height(8.dp))
OutlinedTextField(
value = uiState.password,
onValueChange = onPasswordChange,
label = { Text("Password") },
visualTransformation = PasswordVisualTransformation(),
isError = uiState.passwordError != null,
supportingText = uiState.passwordError?.let { { Text(it) } },
modifier = Modifier.fillMaxWidth()
)
Spacer(modifier = Modifier.height(16.dp))
Button(
onClick = onLoginClick,
enabled = uiState.isLoginEnabled,
modifier = Modifier.fillMaxWidth()
) {
if (uiState.isLoading) {
CircularProgressIndicator(
modifier = Modifier.size(24.dp),
color = MaterialTheme.colorScheme.onPrimary
)
} else {
Text("Login")
}
}
uiState.errorMessage?.let { error ->
Spacer(modifier = Modifier.height(8.dp))
Text(
text = error,
color = MaterialTheme.colorScheme.error,
style = MaterialTheme.typography.bodySmall
)
}
}
}
@Preview(showBackground = true)
@Composable
private fun LoginScreenPreview() {
MyAppTheme {
LoginScreen(
uiState = LoginUiState(email = "[email protected]"),
onEmailChange = {},
onPasswordChange = {},
onLoginClick = {}
)
}
}
// domain/usecase/user/LoginUseCase.kt
class LoginUseCase @Inject constructor(
private val userRepository: UserRepository,
private val analyticsTracker: AnalyticsTracker
) {
suspend operator fun invoke(
email: String,
password: String
): Result<User> {
// Validation
if (!email.isValidEmail()) {
return Result.failure(ValidationException("Invalid email format"))
}
if (password.length < 8) {
return Result.failure(ValidationException("Password too short"))
}
return try {
val user = userRepository.login(email, password)
analyticsTracker.trackLogin(success = true)
Result.success(user)
} catch (e: Exception) {
analyticsTracker.trackLogin(success = false)
Result.failure(e)
}
}
}
// data/repository/UserRepositoryImpl.kt
class UserRepositoryImpl @Inject constructor(
private val api: ApiService,
private val userDao: UserDao,
private val userPreferences: UserPreferences,
private val mapper: UserMapper,
@IoDispatcher private val ioDispatcher: CoroutineDispatcher
) : UserRepository {
override suspend fun login(email: String, password: String): User =
withContext(ioDispatcher) {
val response = api.login(LoginRequest(email, password))
val user = mapper.toDomain(response.user)
// Cache locally
userDao.insertUser(mapper.toEntity(user))
userPreferences.saveAuthToken(response.token)
user
}
override fun observeUser(userId: String): Flow<User?> =
userDao.observeUser(userId)
.map { entity -> entity?.let { mapper.toDomain(it) } }
.flowOn(ioDispatcher)
}
# Create new Android project in Android Studio
# File > New > New Project > Empty Activity
# Add version catalog
mkdir -p gradle
touch gradle/libs.versions.toml
# Create module structure
./gradlew :app:createModule -PmoduleName=feature:authentication
./gradlew :app:createModule -PmoduleName=domain
./gradlew :app:createModule -PmoduleName=data
./gradlew :app:createModule -PmoduleName=core:ui
./gradlew :app:createModule -PmoduleName=core:common
./gradlew :app:createModule -PmoduleName=core:network
./gradlew :app:createModule -PmoduleName=core:testing
# Or manually create directories
mkdir -p feature/authentication/src/main/kotlin
mkdir -p domain/src/main/kotlin
mkdir -p data/src/main/kotlin
mkdir -p core/{ui,common,network,testing}/src/main/kotlin
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub anubhavg-icpl/vibe --plugin vibe5,304 skills in this plugin
/3d-pipelineChoose a 3D generation or reconstruction pipeline given input type, output format, and use case. Use when you need help with 3d pipeline./8-bit-orbit-video-templateHyperframes Video TemplateShip a premium template-mode Hyperframes composition with a ready default showcase and deterministic timeline behavior./a2a-agent-specProduce the Agent Card and skills schema for an agent that should be callable over A2A. Use when you need help with a2a agent spec.Other plugins' skills for the same job