Mobile — Android

Screen Architecture

One command, eleven files, one architecture — MVI, every time, for every feature.

Screen Architecture

One command, eleven files, one architecture always

This kit generates exactly one architecture — MVI — every time, for every feature, with zero exceptions. There's no "assisted" mode to fall back to for a different shape. A screen has exactly one way in (a UiEvent) and one way out (a StateFlow<UiState>); a Composable never calls a ViewModel function directly.

Composable UI
     │  UiEvent
     ▼
  ViewModel  ── StateFlow<UiState> flows back up
     │  calls
     ▼
  UseCase          (pure Kotlin)
     │
     ▼
 Repository        (interface + impl)
   │        │
   ▼        ▼
Remote    Local    (aspirational — no Room yet)

./scripts/new_feature.sh user_settings "email:String,notificationsEnabled:Boolean" produces eleven files:

FileIts job
domain/model/UserSettingsThe data type
domain/repository/UserSettingsRepositoryThe interface a ViewModel depends on — not the real thing
domain/usecase/GetUserSettingsUseCaseOne operation, pure Kotlin, no Android/Hilt/Retrofit imports
data/remote/UserSettingsApiServiceThe Retrofit interface
data/remote/UserSettingsApiModuleHilt module providing that service from the shared Retrofit instance
data/repository/UserSettingsRepositoryImplThe one real implementation
data/repository/UserSettingsModuleHilt binding: interface → impl
presentation/UserSettingsUiStateThe UiState data class and the UiEvent sealed interface, together
presentation/UserSettingsViewModelonEvent() dispatch, StateFlow<UiState> out
presentation/UserSettingsScreenStateless Screen + a thin Route, two @Previews, error-retry wired back through the same onEvent
UserSettingsViewModelTestThree real, passing tests: success, failure, and retry-after-failure recovers

The dispatch shape it generates every time, concretely:

sealed interface UserSettingsUiEvent {
    data object Load : UserSettingsUiEvent
}

fun onEvent(event: UserSettingsUiEvent) {
    when (event) {
        is UserSettingsUiEvent.Load -> load()
    }
}

private fun load() {
    viewModelScope.launch {
        _uiState.value = _uiState.value.copy(isLoading = true, error = null)
        getUserSettingsUseCase()
            .onSuccess { result -> _uiState.value = _uiState.value.copy(isLoading = false, userSettings = result) }
            .onFailure { throwable -> _uiState.value = _uiState.value.copy(isLoading = false, error = throwable.message) }
    }
}

Every combination here is templated. There's no fixed-template-vs-assisted split, because there's only one pattern. Every field type gets a sensible fake value in the generated test (String → "test", a nullable type → null); an unrecognized custom type still compiles — via TODO(), a Nothing that type-checks against anything — but fails loudly at test runtime until you fill in a real value, never silently wrong.