android-clean-architecture

Define Clean Architecture module boundaries and dependency rules for Android and Kotlin Multiplatform projects.

Updated Sep 13, 2025
One-click install
npx skills add https://github.com/llmh333/employee_management_spring --skill android-clean-architecture-llmh333
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-clean-architecture
Source: https://github.com/llmh333/employee_management_spring/tree/main/.gemini/skills/android-clean-architecture
Command: npx skills add https://github.com/llmh333/employee_management_spring --skill android-clean-architecture-llmh333

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves messy Android/Kotlin Multiplatform codebases by showing how to separate concerns into clear layers so business logic stays framework-agnostic and maintainable.

Core Features & Use Cases

  • Module Structure & Dependency Rules: Enforces boundary discipline so domain never depends on data, presentation, or frameworks.
  • UseCase/Repository Pattern: Models each business operation as a UseCase and defines repository interfaces in domain, implemented in data.
  • Data Layer Patterns: Coordinates local and remote data flows using Room (Android), SQLDelight (KMP), and Ktor networking, with mappers between entities/DTOs and domain models.

Quick Start

Use the android-clean-architecture skill to design your project’s module layout, place UseCases and repository interfaces in the domain layer, and implement repositories in the data layer that integrate Room, SQLDelight, and Ktor while mapping results into pure Kotlin domain models.

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 to prevent domain leakage?

Android clean architecture prevents domain leakage by enforcing strict module boundaries where the domain layer remains pure Kotlin and never depends on data, presentation, or frameworks. This keeps business logic framework-agnostic and maintainable.

What is the best way to implement the repository pattern in Kotlin Multiplatform?

The best way to implement the repository pattern in Kotlin Multiplatform is by defining repository interfaces in the domain layer and implementing them in the data layer. This approach coordinates local and remote data flows using SQLDelight and Ktor while mapping results into pure Kotlin domain models.

How do I use Room and Ktor in a layered data flow with clean architecture?

You use Room and Ktor in the data layer to coordinate local and remote data flows. The data layer implements repository interfaces defined in the domain layer, using mappers to translate between database entities, network DTOs, and pure Kotlin domain models.

Does clean architecture require dependency injection for UseCases in Android?

Clean architecture in Android requires dependency injection to wire UseCases and repository implementations together. The skill provides patterns for DI wiring, ensuring that UseCases remain pure Kotlin and receive their repository dependencies through inversion of control.

How do I handle errors in UseCases without leaking framework dependencies?

To handle errors in UseCases without leaking framework dependencies, you use pure Kotlin constructs like Result or Try wrappers. This ensures the domain layer remains framework-agnostic while still propagating and managing failures from repository operations cleanly.

Can I apply clean architecture boundaries to both Android and Kotlin Multiplatform modules?

Yes, you can apply clean architecture boundaries to both Android and Kotlin Multiplatform modules. The skill defines a unified structure that uses Room for Android local storage and SQLDelight for KMP, ensuring domain logic stays shared and framework-agnostic across platforms.