clean-architecture-kmp

Assigns Kotlin Multiplatform classes to Clean Architecture layers and reviews layer boundary violations.

Updated Sep 12, 2026
One-click install
npx skills add https://github.com/Vierco/citoVisionApp --skill clean-architecture-kmp-vierco
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: clean-architecture-kmp
Source: https://github.com/Vierco/citoVisionApp/tree/main/.claude/skills/clean-architecture-kmp
Command: npx skills add https://github.com/Vierco/citoVisionApp --skill clean-architecture-kmp-vierco

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When building Kotlin Multiplatform apps, it is easy to lose track of where a class belongs, letting DTOs leak into the UI or ViewModels call Retrofit directly. This Skill provides a deterministic rule set for placing every class in the correct layer (Presentation, Application, Domain, Infrastructure, Composition) and for reviewing whether a PR respects dependency direction. ## Core Features & Use Cases - Layer assignment rules: A responsibility table and decision tree map each element (Entity, Use Case, DTO, ViewModel, Koin module, etc.) to exactly one layer. - Dependency enforcement: Invariants and anti-patterns define illegal imports, such as ViewModels knowing Ktor or Entities carrying persistence annotations. - PR review checklist: A checklist and Definition of Done let an agent audit existing code for architectural violations. - Use Case: While adding a new feature, ask where a repository implementation or mapper should live, and get a definitive layer placement plus the allowed dependencies. ## Quick Start Ask the agent to decide which Clean Architecture layer a new class belongs to, or to review a pull request for layer boundary violations.

Frequently Asked Questions about clean-architecture-kmp

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I decide which Clean Architecture layer a class belongs to?▼

Use the decision tree: business rules go to Domain, use case orchestration to Application, external resource access (network, database, preferences) to Infrastructure, and UI state or composables to Presentation. Each class must belong to exactly one layer.

Where should repository interfaces and implementations live in Clean Architecture?▼

Repository interfaces (ports) belong in the Domain layer, while their implementations live in Infrastructure. Infrastructure depends on Domain, never the reverse, keeping business rules independent of frameworks.

Can a ViewModel use Ktor or Retrofit directly in Kotlin Multiplatform?▼

No. ViewModels sit in Presentation and may only depend on the Application layer. Network clients like Ktor or Retrofit are Infrastructure concerns, so a ViewModel referencing them violates the dependency rule.

What is the Composition layer in Clean Architecture?▼

Composition is the only layer allowed to know all other layers. It wires dependencies, connects interfaces to implementations (for example via Koin modules), and initializes the app, but contains no business logic or UI code.

When should I not use this architecture skill?▼

Do not use it to define MVVM, dependency injection, the Repository pattern, or testing strategy. Those topics are covered by separate skills such as mvvm-compose-kmp, dependency-injection-koin, repository-pattern, and testing-kmp.