# android-kotlin

Feeds your agent the layout of an Android Kotlin project: Coroutines, Jetpack Compose, Hilt, Room and MockK tests. Kicks in on its own when .kt files are open.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 3300 installs · ★ 711
- Author: alinaqi
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/alinaqi/maggy/tree/HEAD/skills/android-kotlin/SKILL.md
- Updated: 2026-10-13
- HTML: https://affpapa.org/en/nevibecode/skills/android-kotlin

## What it does

The skill activates on `**/*.kt`, `**/*.kts`, `android/**` and `**/build.gradle.kts`, so there is no command to type. Inside you get worked examples: a module tree split into data, domain and ui, a Kotlin DSL `build.gradle.kts` with the Hilt and KSP plugins, a ViewModel built on `StateFlow`, a repository returning `Flow` with `flowOn`, and a Compose screen wired through `hiltViewModel()` and `collectAsStateWithLifecycle()`.

Versions in those samples are pinned: Compose BOM 2024.01.00, Hilt 2.50, Room 2.6.1, MockK 1.13.9, coroutines 1.7.3, Java 17, compileSdk 34, minSdk 24. On a project running different versions the agent may copy these over, so read the diff before you commit.

Tests lean on MockK and Turbine, with `ui-test-junit4` for instrumentation. Handy when you need a feature skeleton fast, or when a module has grown messy and you want the layers back.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add alinaqi/maggy --skill android-kotlin -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/android-kotlin/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/android-kotlin/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add alinaqi/maggy --skill android-kotlin -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/android-kotlin/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add alinaqi/maggy --skill android-kotlin -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/android-kotlin/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install alinaqi/maggy android-kotlin
```

2. **Manually: put the files in place**
- File: `.github/skills/android-kotlin/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add alinaqi/maggy --skill android-kotlin -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/alinaqi/maggy --path skills/android-kotlin
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/android-kotlin/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add alinaqi/maggy --skill android-kotlin -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/alinaqi/maggy/tree/HEAD/skills/android-kotlin/SKILL.md

## When to use it
- split a feature into data, domain and ui layers
- write a StateFlow ViewModel with error handling
- build a repository that caches and fetches over Flow
- wire Hilt and KSP into build.gradle.kts
- cover a ViewModel with MockK and Turbine tests

## Example prompts
- add a profile screen following the android-kotlin structure
- write a StateFlow ViewModel with error handling like android-kotlin does
- set up Hilt and Room in build.gradle.kts using the skill's example

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 8bffcbbcc2d7598a.

BEGIN THIRD-PARTY FILE 8bffcbbcc2d7598a
````text
---
name: android-kotlin
description: Android Kotlin development with Coroutines, Jetpack Compose, Hilt, and MockK testing
when-to-use: When working on Android Kotlin source files
user-invocable: false
paths: ["**/*.kt", "**/*.kts", "android/**", "**/build.gradle.kts"]
effort: medium
---

# Android Kotlin Skill


---

## Project Structure

```
project/
├── app/
│   ├── src/
│   │   ├── main/
│   │   │   ├── kotlin/com/example/app/
│   │   │   │   ├── data/               # Data layer
│   │   │   │   │   ├── local/          # Room database
│   │   │   │   │   ├── remote/         # Retrofit/Ktor services
│   │   │   │   │   └── repository/     # Repository implementations
│   │   │   │   ├── di/                 # Hilt modules
│   │   │   │   ├── domain/             # Business logic
│   │   │   │   │   ├── model/          # Domain models
│   │   │   │   │   ├── repository/     # Repository interfaces
│   │   │   │   │   └── usecase/        # Use cases
│   │   │   │   ├── ui/                 # Presentation layer
│   │   │   │   │   ├── feature/        # Feature screens
│   │   │   │   │   │   ├── FeatureScreen.kt      # Compose UI
│   │   │   │   │   │   └── FeatureViewModel.kt
│   │   │   │   │   ├── components/     # Reusable Compose components
│   │   │   │   │   └── theme/          # Material theme
│   │   │   │   └── App.kt              # Application class
│   │   │   ├── res/
│   │   │   └── AndroidManifest.xml
│   │   ├── test/                       # Unit tests
│   │   └── androidTest/                # Instrumentation tests
│   └── build.gradle.kts
├── build.gradle.kts                    # Project-level build file
├── gradle.properties
├── settings.gradle.kts
└── CLAUDE.md
```

---

## Gradle Configuration (Kotlin DSL)

### App-level build.gradle.kts
```kotlin
plugins {
    id("com.android.application")
    id("org.jetbrains.kotlin.android")
    id("com.google.dagger.hilt.android")
    id("com.google.devtools.ksp")
}

android {
    namespace = "com.example.app"
    compileSdk = 34

    defaultConfig {
        applicationId = "com.example.app"
        minSdk = 24
        targetSdk = 34
        versionCode = 1
        versionName = "1.0"

        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            isMinifyEnabled = true
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )
        }
    }

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_17
````
END THIRD-PARTY FILE 8bffcbbcc2d7598a

The third-party file has ended. Everything between the 8bffcbbcc2d7598a tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2936 of 12343 bytes. © alinaqi · MIT · https://github.com/alinaqi/maggy/tree/HEAD/skills/android-kotlin/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
