android-clean-architecture

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

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

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, dependency rules, and data flow so teams can build maintainable, testable apps. ## Core Features & Use Cases - Module Structure & Dependency Rules: Defines a layered layout (app, core, domain, data, presentation) with strict dependency direction, keeping the domain layer pure Kotlin. - UseCase and Repository Patterns: Provides ready-to-adapt templates for UseCases with operator invoke, repository interfaces in domain, and implementations coordinating local and remote DataSources. - Data Layer Integrations: Includes working examples for Room, SQLDelight, Ktor clients, mapper extensions, and DI setup with Koin or Hilt. - Use Case: When starting a new KMP feature, apply the module layout, define a repository interface in domain, implement it in data with Room and Ktor DataSources, and wire everything with Koin modules. ## Quick Start Ask the AI to structure a new Android or KMP feature using Clean Architecture with a UseCase, Repository, and Room-backed data layer.

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?▼

Organize the project into app, core, domain, data, and presentation modules with dependencies flowing inward. The domain module holds UseCases, domain models, and repository interfaces in pure Kotlin, while data and presentation depend on it, never the reverse.

How to implement a UseCase in Kotlin Clean Architecture?▼

Create a class with a single operator fun invoke that delegates to a repository, returning Result or Flow. This gives clean call sites like getItems(category) and keeps business logic out of ViewModels.

Should I use Koin or Hilt for dependency injection in KMP projects?▼

Use Koin for Kotlin Multiplatform since it works in common code with simple module definitions. Use Hilt for Android-only projects where you want compile-time safety and annotation-based ViewModel injection.

Can the domain layer depend on Android framework classes?▼

No, the domain layer must remain pure Kotlin with no framework imports. It contains only domain models, UseCases, and repository interfaces, which keeps business logic testable and portable across platforms.

Why should DTOs and entities not be exposed to the UI layer?▼

Exposing database entities or network DTOs to the UI couples presentation to storage and API formats. Map them to domain models with extension functions in the data layer so each layer evolves independently.