android-kotlin-architecture

Enforce MVI/MVVM patterns and atomic ViewModel state updates in Kotlin Android projects.

34|8|Updated May 21, 2026
One-click install
npx skills add https://github.com/haidrrrry/compose-kotlin-agent-skills --skill android-kotlin-architecture
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-kotlin-architecture
Source: https://github.com/haidrrrry/compose-kotlin-agent-skills/tree/main/skills/android-kotlin-architecture
Command: npx skills add https://github.com/haidrrrry/compose-kotlin-agent-skills --skill android-kotlin-architecture

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

AI coding agents frequently generate Kotlin and Jetpack Compose Android code that compiles but follows poor architectural practices, leading to race conditions from improper state updates, broken unidirectional data flow, unmaintainable module structures, and scattered business logic that is hard to test and scale.

Core Features & Use Cases

  • Strict MVI/MVVM Enforcement: Mandates unidirectional data flow with immutable UiState, UiEvent, and UiEffect contracts, plus atomic ViewModel state updates via _state.update to eliminate race conditions.
  • Clear Module Structure Rules: Defines standard feature and core module layouts to prevent circular dependencies and keep large codebases scalable across Android, Kotlin Multiplatform, and Compose Multiplatform projects.
  • UseCase Placement Guidance: Provides explicit rules for when to extract business logic into UseCases, separating UI logic from domain logic to improve testability and reusability.
  • Anti-Pattern Blocklist: Explicitly bans common harmful patterns like direct _state.value assignment, God ViewModels, and improper Flow collection, with clear fixes for each.

Quick Start

Use the android-kotlin-architecture skill to structure your new Compose feature following MVI patterns with proper ViewModel state management and module separation.

Frequently Asked Questions about android-kotlin-architecture

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

FAQPage Schema
How do I fix race conditions in Android Jetpack Compose ViewModel state updates?

Fix race conditions in Jetpack Compose ViewModel state updates by enforcing unidirectional data flow and atomic state mutations using _state.update, eliminating improper direct _state.value assignments.

What is the best way to structure a Kotlin Multiplatform feature module to prevent circular dependencies?

The best way to structure Kotlin Multiplatform feature modules is by defining standard feature and core module layouts with clear dependency boundaries, preventing circular dependencies and keeping large codebases scalable.

How do I enforce strict MVI patterns in Android Kotlin projects?

Enforce strict MVI patterns in Android Kotlin projects by mandating unidirectional data flow with immutable UiState, UiEvent, and UiEffect contracts, separating UI logic from domain logic for testability.

When should I extract business logic into UseCases in an Android clean architecture?

Extract business logic into UseCases in Android clean architecture when separating UI logic from domain logic to improve testability and reusability across features.

Does this approach work with Compose Multiplatform and Kotlin 2.x?

Yes, this approach works with Compose Multiplatform and Kotlin 2.x, applying architectural decision-making and module splitting rules across Android, Kotlin Multiplatform, and Compose Multiplatform projects.

Why does my AI generated Android code have broken unidirectional data flow?

AI generated Android code often has broken unidirectional data flow because agents frequently produce code that compiles but follows poor architectural practices, requiring an anti-pattern blocklist to enforce proper structure.