android-clean-architecture

Guide Clean Architecture implementation for Android and Kotlin Multiplatform projects.

1|Updated Apr 21, 2026
One-click install
npx skills add https://github.com/ROYCE-8425/ai-marketing-hub --skill android-clean-architecture-royce-8425
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-clean-architecture
Source: https://github.com/ROYCE-8425/ai-marketing-hub/tree/main/skills/android-clean-architecture
Command: npx skills add https://github.com/ROYCE-8425/ai-marketing-hub --skill android-clean-architecture-royce-8425

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill unit provides a comprehensive guide to implement Clean Architecture patterns in Android and Kotlin Multiplatform projects, ensuring modularity, testability, and maintainability.

Core Features & Use Cases

  • Module Structure: Detailed guide on organizing modules (app, core, domain, data, presentation, design-system, feature) and their dependencies.
  • Domain Layer: Instructions on creating UseCases, domain models, and repository interfaces with examples in Kotlin.
  • Data Layer: Examples of repository implementations, data sources, databases (Room, SQLDelight), and network clients (Ktor).
  • Dependency Injection: Demonstrations of setting up Koin and Hilt for dependency injection across different layers.
  • Error Handling: Best practices for implementing error handling with Result and Try patterns.
  • Gradle Plugins: Using convention plugins to simplify build configurations in Kotlin Multiplatform projects.
  • Avoiding Anti-Patterns: Tips to avoid common architectural mistakes.

Quick Start

Use the android-clean-architecture skill to review the suggested module structure for a new Android or KMP 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 Kotlin Multiplatform project for clean architecture?

Clean architecture for KMP involves separating domain, data, and presentation layers. This Skill guides you in defining module boundaries, creating domain use cases, and implementing repository interfaces to ensure your multiplatform codebase remains modular and testable.

What is the best way to implement the domain layer in Kotlin Multiplatform?

The best way to implement the domain layer in Kotlin Multiplatform is by creating UseCases, domain models, and repository interfaces. This approach isolates your business logic from the data and presentation layers, making your core application logic highly testable and maintainable.

How do I set up Room and Ktor in the clean architecture data layer?

You implement the data layer in clean architecture by creating repository implementations that fetch data from local databases like Room or SQLDelight, and remote sources using Ktor network clients, mapping them to domain models.

Can I use Hilt and Koin for dependency injection across clean architecture modules?

Yes, you can use Hilt and Koin for dependency injection across clean architecture modules. This Skill provides demonstrations on configuring both DI frameworks to supply dependencies effectively across the domain, data, and presentation layers in Android and KMP projects.

How do I handle errors in Kotlin clean architecture using Result patterns?

To handle errors in Kotlin clean architecture, implement best practices using Result and Try patterns. This approach propagates failures safely across architectural boundaries without throwing exceptions, ensuring robust error handling within your UseCases and repository implementations.

What are common anti-patterns to avoid in Android clean architecture?

Common anti-patterns to avoid in Android clean architecture include leaking data layer details into the domain layer and bypassing repository interfaces. This Skill provides tips to identify and avoid these architectural mistakes, preserving strict module separation and testability.