android-clean-architecture

Implements Clean Architecture module structure, UseCases, and Repositories for Android and Kotlin Multiplatform projects.

Updated May 19, 2026
One-click install
npx skills add https://github.com/azusagasaku/--claude-config --skill android-clean-architecture-azusagasaku
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: android-clean-architecture
Source: https://github.com/azusagasaku/--claude-config/tree/main/skills/ecc/android-clean-architecture
Command: npx skills add https://github.com/azusagasaku/--claude-config --skill android-clean-architecture-azusagasaku

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Structuring Android and Kotlin Multiplatform projects without clear layer boundaries leads to tangled dependencies, untestable business logic, and framework-coupled domain code. This Skill provides concrete patterns for module separation, dependency rules, and data flow so your codebase stays maintainable as it grows. ## Core Features & Use Cases - Module Structure & Dependency Rules: Defines a recommended layout (app, core, domain, data, presentation, design-system) with strict dependency direction, keeping the domain layer pure Kotlin. - UseCase & Repository Patterns: Provides templates for operator-invoke UseCases, Flow-based reactive streams, repository interfaces in domain, and implementations coordinating local and remote DataSources. - Data Layer Integrations: Includes working examples for Room (Android), SQLDelight and Ktor (KMP), mapper extension functions, and DI setup with Koin or Hilt. - Use Case: When starting a new KMP feature, apply this Skill to scaffold the domain UseCase, repository interface, Room/SQLDelight entity, and Koin module wiring in one consistent pass. ## Quick Start Ask the AI to structure a new Android or KMP feature using Clean Architecture with a UseCase, Repository, and Room or SQLDelight data source.

Frequently Asked Questions about android-clean-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure an Android project with Clean Architecture?▼

Split the project into app, core, domain, data, and presentation modules with dependencies pointing inward. The domain module holds UseCases, models, and repository interfaces in pure Kotlin, while data implements repositories and presentation holds ViewModels and screens.

How to implement a UseCase in Kotlin Clean Architecture?▼

Create a class with an operator fun invoke that delegates to a repository, returning Result<T> for one-shot operations or Flow<T> for reactive streams. Inject the repository interface through the constructor so the UseCase stays framework-free and testable.

Koin vs Hilt for dependency injection in KMP projects?▼

Koin works in Kotlin Multiplatform shared code using module definitions with single and factory declarations. Hilt is Android-only, using @Module, @Binds, and @HiltViewModel annotations, so choose Koin when sharing DI across platforms.

Can I use SQLDelight and Ktor in a Kotlin Multiplatform data layer?▼

Yes, SQLDelight defines tables and queries in .sq files for shared local storage, and Ktor's HttpClient with ContentNegotiation handles network calls in commonMain. Repository implementations coordinate both DataSources behind domain interfaces.

Why should the domain layer not depend on Android framework classes?▼

Framework dependencies in domain couple business logic to the platform, breaking testability and KMP sharing. Keep domain models as plain data classes and repository interfaces pure Kotlin, mapping entities and DTOs at the data layer boundary.

What are common Clean Architecture anti-patterns on Android?▼

Common mistakes include exposing database entities to the UI, putting business logic in ViewModels instead of UseCases, using GlobalScope instead of viewModelScope, and creating circular module dependencies. Fat repositories should be split into focused DataSources.