ワンクリックで
android-clean-architecture
Use when designing the architecture, data layer, domain models, or business logic for Android apps.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use when designing the architecture, data layer, domain models, or business logic for Android apps.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Handling Bluetooth Low Energy, flow wrappers, and Android 12+ permissions.
Seamless integration of CameraX with Google ML Kit for vision tasks.
Deep-dive skills for banking and healthcare apps.
Use when integrating Google Gemini Nano via AICore for on-device ML.
Automated UIAutomator tests and Hardware mocking setup.
Expanding KMP shared UI to cover Compose Multiplatform edge-cases.
| name | android-clean-architecture |
| description | Use when designing the architecture, data layer, domain models, or business logic for Android apps. |
| category | architecture |
| risk | low |
| source | community |
| date_added | 2026-03-31 |
| metadata | {"triggers":["@clean-architecture","data-layer","domain-layer","presentation-layer","use-case","repository-pattern"]} |
Standardized architectural patterns for scalable, testable, and maintainable Android applications.
MutableStateFlow in ViewModel. In Compose UI, ALWAYS collect using collectAsStateWithLifecycle() (requires androidx.lifecycle:lifecycle-runtime-compose). NEVER use collectAsState() as it wastes resources in the background.onClicked = { /* Future implementation */ }) when scaffolding. If tasked to build a feature, ALWAYS implement the full event flow from UI to ViewModel to Repository.Rule: NO Android dependencies (except maybe @Inject). Pure Kotlin.
Use Cases: Each Use Case should have a single responsibility.
class GetUserUseCase @Inject constructor(private val repository: UserRepository) {
operator fun invoke(id: String): Flow<User> = repository.getUser(id)
}
Models: Pure Kotlin data classes (Domain-specific).
CRITICAL ANTI-HALLUCINATION GUARD: NEVER assume or guess the properties of a data class (e.g., guessing a TodoItem has a dueDate). You MUST explicitly read the data classes in domain/model/ before writing ViewModel or Repository mapping logic to prevent Unresolved reference or constructor errors.
LocalDateTime, Enums, Custom Objects), you MUST create a @TypeConverter class and explicitly register it on the @Database class before compiling. Room cannot natively store them!Hilt is the standard DI library. Ensure the following foundational setup is ALWAYS present:
Application and annotate it with @HiltAndroidApp.
@HiltAndroidApp
class BaseApplication : Application()
AndroidManifest.xml using android:name=".BaseApplication".@HiltViewModel for ViewModels.@AndroidEntryPoint for Activities/Fragments (if any).@Inject constructor for Use Cases and Repositories.@Module and @InstallIn(SingletonComponent::class) for platform dependencies.test/. Use MockK for mocking interfaces.runTest and TestDispatcher.Result wrapper or Resource object to encapsulate Success/Error states.