android-clean-architecture

Implements Clean Architecture module structure and layer patterns for Android and Kotlin Multiplatform projects.

1|Updated Oct 11, 2025
One-click install
npx skills add https://github.com/ibytechaos/claude --skill android-clean-architecture-ibytechaos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-clean-architecture
Source: https://github.com/ibytechaos/claude/tree/main/plugins/everything-claude-code/skills/android-clean-architecture
Command: npx skills add https://github.com/ibytechaos/claude --skill android-clean-architecture-ibytechaos

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Structuring Android and Kotlin Multiplatform codebases without clear layer boundaries leads to tangled dependencies, untestable business logic, and framework leakage into domain code. This Skill provides concrete patterns for module separation, UseCases, Repositories, and data layer design. ## Core Features & Use Cases - Module Structure & Dependency Rules: Defines a recommended layout (app, core, domain, data, presentation, design-system) with strict dependency direction so domain stays pure Kotlin. - UseCase and Repository Patterns: Provides operator-invoke UseCases, Flow-based reactive streams, repository interfaces in domain, and implementations coordinating local and remote DataSources. - Data Layer Tooling: Includes Room entities and DAOs for Android, SQLDelight schemas and Ktor HTTP clients for KMP, plus mapper extension functions between DTOs, entities, and domain models. - Use Case: When starting a new KMP feature, apply this Skill to scaffold the domain UseCase, repository interface, Room/SQLDelight persistence, Ktor remote source, and Koin DI modules with correct layer boundaries. ## Quick Start Ask the AI to structure a new Android or Kotlin Multiplatform feature using Clean Architecture with a UseCase, Repository, Room database, and Koin dependency injection.

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. Domain holds pure-Kotlin UseCases, models, and repository interfaces; data implements repositories with Room or Ktor sources; presentation contains ViewModels and UI. Dependencies must point inward only.

How to implement a UseCase in Kotlin Clean Architecture?

Define a class with an operator fun invoke that calls a repository, returning Result<T> or Flow<T>. This gives clean call sites like getItems(category) and keeps one business operation per UseCase, making ViewModels thin and logic testable.

Koin vs Hilt for Kotlin Multiplatform dependency injection?

Koin works across KMP targets using module DSL with factory and single declarations, making it the choice for shared code. Hilt is Android-only, using @Module, @Binds, and @HiltViewModel annotations with compile-time injection.

Can the domain layer depend on Android framework classes?

No. The domain layer must remain pure Kotlin with no Android, Room, or network framework imports. It contains only data classes, repository interfaces, and UseCases so business logic stays platform-independent and testable.

Should Room entities be exposed to the UI layer?

No. Database entities and network DTOs should never reach the UI. Map them to domain models using extension functions like toDomain() in the data layer, so presentation only consumes stable domain types.

How do I share database code between Android and iOS in KMP?

Use SQLDelight with .sq files defining tables and queries, which generates type-safe Kotlin APIs for all KMP targets. Combine with Ktor for networking and Koin for DI to keep the entire data layer in shared code.