android-clean-architecture

Organize Android and Kotlin Multiplatform projects into clean architecture modules.

1|Updated Jan 30, 2021
One-click install
npx skills add https://github.com/fideguch/my_dotfiles --skill android-clean-architecture-fideguch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-clean-architecture
Source: https://github.com/fideguch/my_dotfiles/tree/main/claude/skills/android-clean-architecture
Command: npx skills add https://github.com/fideguch/my_dotfiles --skill android-clean-architecture-fideguch

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a practical blueprint for structuring Android and Kotlin Multiplatform projects with Clean Architecture, defining module boundaries, data flow, and testability to reduce coupling and improve maintainability.

Core Features & Use Cases

  • Defines a layered architecture with app, core, domain, data, presentation, design-system, and optional feature modules to organize responsibilities.
  • Establishes dependency rules (domain is independent, data depends on domain and core, presentation depends on domain, design-system, core) to prevent leakage of implementation details.
  • Provides patterns for UseCases, Repositories, and DataSources, plus DI wiring with Koin or Hilt, and data-layer integrations (Room, SQLDelight, Ktor) to support scalable, testable code.
  • Use Cases are represented as operator overloaded calls and domain models stay pure Kotlin, enabling clean separation of concerns.

Quick Start

Follow the recommended module layout and integrate DI with Hilt or Koin to begin implementing a clean Android architecture in your project.

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

To structure an Android project with clean architecture, you organize code into app, core, domain, data, and presentation modules. This enforces dependency rules where the domain layer remains independent, while data and presentation layers depend on it to reduce coupling and improve maintainability.

How does clean architecture keep the domain layer framework-agnostic in Kotlin Multiplatform?

Clean architecture keeps the domain layer framework-agnostic in Kotlin Multiplatform by representing UseCases as operator overloaded calls and keeping domain models pure Kotlin. This ensures the domain layer remains independent and prevents leakage of implementation details.

Can I use Hilt or Koin for dependency injection in an Android clean architecture setup?

Yes, you can use Hilt or Koin for dependency injection in an Android clean architecture setup. The architecture provides specific patterns for DI wiring, allowing you to integrate either framework to support scalable and testable code across your modules.

What's the best way to implement Repositories and DataSources with Room and Ktor?

The best way to implement Repositories and DataSources with Room and Ktor is by placing them in the data layer, which depends on the domain and core layers. This data-layer pattern supports integrations like Room, SQLDelight, and Ktor while maintaining strict separation of concerns.

When do I need to separate presentation and design-system modules in Android clean architecture?

You need to separate presentation and design-system modules in Android clean architecture when you want to organize UI responsibilities distinctly. The presentation layer depends on domain, design-system, and core layers, ensuring implementation details do not leak across module boundaries.

Does clean architecture for Android support Kotlin Multiplatform projects?

Yes, clean architecture for Android fully supports Kotlin Multiplatform projects. It provides a practical blueprint for structuring shared modules, defining data flow, and establishing testability across platforms while keeping the domain layer pure Kotlin.