android-clean-architecture

Create Clean Architecture module structures for Android and Kotlin Multiplatform projects.

1|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/xxih/ai-harness-zh --skill android-clean-architecture-xxih
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-clean-architecture
Source: https://github.com/xxih/ai-harness-zh/tree/main/references/translations/everything-claude-code/docs/zh-CN/skills/android-clean-architecture
Command: npx skills add https://github.com/xxih/ai-harness-zh --skill android-clean-architecture-xxih

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a clear, reproducible architecture blueprint that eliminates ad-hoc layering, tangled dependencies, and mixed concerns in Android and Kotlin Multiplatform projects so teams can build modular, testable, and maintainable apps.

Core Features & Use Cases

  • Module Layout & Dependency Rules: Recommended project layout and strict dependency directions to keep domain layer framework-free.
  • UseCase & Repository Patterns: Standardized UseCase invocation patterns, repository interfaces in domain, and coordinating implementations in the data layer.
  • Data Layer Patterns: Mapping strategies, Room/SQLDelight schemas, Ktor client setup, and local/remote data source coordination.
  • DI & Build Conventions: Examples for Koin and Hilt integration and Gradle convention plugins for KMP projects.
  • Use Case Example: Design a new feature module that exposes repository interfaces in domain, implements data sources with SQLDelight and Ktor, and wires ViewModels in presentation via DI.

Quick Start

Generate a module layout and dependency diagram for a new Kotlin Multiplatform feature following Clean Architecture rules and list the interfaces and DI bindings required.

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 and keep the domain layer framework-free?

To structure an Android project with Clean Architecture, you separate domain, data, and presentation layers while enforcing strict dependency rules. The domain layer stays framework-free by defining repository interfaces and UseCases, keeping Android dependencies isolated in the outer layers.

What's the best way to set up Gradle convention plugins for a Kotlin Multiplatform Clean Architecture project?

Setting up Gradle convention plugins for a Kotlin Multiplatform Clean Architecture project standardizes module configurations. This approach generates reproducible builds by centralizing dependency directions and KMP module setups, ensuring architectural rules are enforced across shared code.

How do I implement the Repository pattern with Room and Ktor in an Android Clean Architecture module?

Implementing the Repository pattern with Room and Ktor involves defining repository interfaces in the domain layer. The data layer then coordinates local Room or SQLDelight data sources with remote Ktor clients, applying data mapping strategies to return domain models.

Can I use Koin or Hilt for dependency injection in a Kotlin Multiplatform Clean Architecture setup?

You can use Koin or Hilt for dependency injection in a Kotlin Multiplatform Clean Architecture setup. Koin is fully KMP compatible, while Hilt integrates specifically with the Android presentation layer, allowing you to wire ViewModels and data source implementations effectively.

How do I expose data using Flow and coroutines from UseCases in a Clean Architecture module?

Exposing data with Flow and coroutines from UseCases in a Clean Architecture module involves returning reactive streams from repository interfaces. UseCases invoke these repositories and propagate Flow patterns to the presentation layer, ensuring asynchronous data operations remain testable.

Why use SQLDelight instead of Room when building a Kotlin Multiplatform feature with Clean Architecture?

Using SQLDelight instead of Room for Kotlin Multiplatform Clean Architecture features enables shared database logic across platforms. SQLDelight provides KMP-compatible schemas, while Room is primarily Android-focused, making SQLDelight the better choice for cross-platform data layers.