android-kotlin

Implements Android apps with Kotlin Coroutines, Jetpack Compose, Hilt, and MockK testing.

Updated Jan 16, 2026
One-click install
npx skills add https://github.com/dudqks0319-cpu/antigravity-skills --skill android-kotlin-dudqks0319-cpu
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: android-kotlin
Source: https://github.com/dudqks0319-cpu/antigravity-skills/tree/main/android-kotlin
Command: npx skills add https://github.com/dudqks0319-cpu/antigravity-skills --skill android-kotlin-dudqks0319-cpu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Android developers often struggle with inconsistent project structure, improper coroutine usage, and untestable ViewModels. This Skill provides a complete reference architecture covering Gradle setup, layered project structure, Compose UI patterns, and unit testing so you can build maintainable Android apps without reinventing boilerplate. ## Core Features & Use Cases - Project Architecture: Defines a clean data/domain/ui layered structure with Hilt dependency injection, Room persistence, and Retrofit networking. - Coroutines & Flow Patterns: Provides ViewModel StateFlow patterns, repository Flow implementations, and sealed Result wrappers for state management. - Testing & CI: Includes MockK and Turbine unit test examples, a MainDispatcherRule, detekt/ktlint configuration, and a GitHub Actions CI workflow. - Use Case: When starting a new Android feature, use this Skill to scaffold a Hilt-injected ViewModel with StateFlow, a Compose screen, and corresponding unit tests following the documented patterns. ## Quick Start Use the android-kotlin skill to create a Hilt ViewModel with StateFlow and a Compose screen for a user profile feature.

Frequently Asked Questions about android-kotlin

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

FAQPage Schema
How do I structure an Android Kotlin project with Hilt and Compose?▼

Organize code into data, domain, and ui layers with Hilt modules in a di package. Use @HiltViewModel for ViewModels, hiltViewModel() in Compose screens, and ksp for the Hilt compiler in your Gradle Kotlin DSL configuration.

How to test Kotlin Flows in ViewModel unit tests?▼

Use Turbine's test extension on StateFlow combined with runTest and a MainDispatcherRule that replaces Dispatchers.Main with UnconfinedTestDispatcher. Mock use cases with MockK's coEvery to return flowOf values.

Should I use StateFlow or LiveData in Android ViewModels?▼

StateFlow is the recommended approach in this architecture. Expose immutable StateFlow from a private MutableStateFlow, update it with update {}, and collect it in Compose with collectAsStateWithLifecycle().

What are common Kotlin coroutine anti-patterns on Android?▼

Avoid runBlocking on the main thread, GlobalScope usage, exposing MutableStateFlow publicly, and hardcoded dispatchers. Use viewModelScope, inject dispatchers for testability, and always handle exceptions with the catch operator.

Does this setup work with older Android versions?▼

The configuration targets minSdk 24 and compileSdk 34 with Java 17 compatibility. Compose BOM 2024.01.00 and Hilt 2.50 support this range, so apps run on Android 7.0 and above.