kotlin
Installation
SKILL.md
Kotlin & KMP Architecture Standards
Use this skill for pure Kotlin or Kotlin Multiplatform modules where clean boundaries and testable async code matter.
1. Clean Architecture Rules (Domain Layer)
When writing Kotlin business logic (Core/Domain modules):
- UseCases (Interactors):
- A UseCase MUST contain only one public function:
fun execute(): Result<T>. - Do NOT use
operator fun invoke. - UseCases MUST always return a Kotlin
Result<T>(success or failure) to explicitly model outcomes. - UseCases can depend on other UseCases or Repositories.
- Any external
HelperorManagerMUST be injected into the UseCase, not the Repository.
- A UseCase MUST contain only one public function: