Sandbox
@haidrrrry/compose-kotlin-agent-skills

Compose and Kotlin skills for coding agents

This repo packages Markdown skills that guide AI coding agents through Jetpack Compose and Kotlin work. The root skill sets guardrails like strict MVI and banned antipatterns, while sub-skills and reference files cover architecture, UI, and testing.

47 stars8 forksMarkdownUpdated 2mo ago
Who it's for

Builders who want their coding agent to write and review Jetpack Compose and Kotlin code with consistent rules.

What it delivers

You can get more consistent Compose and Kotlin code, with fewer common state, lifecycle, and UI mistakes.

What it does

Root skill with guardrails

`SKILL.md` defines the main routing rules, strict MVI defaults, and banned antipatterns.

Compose, architecture, and testing sub-skills

Three focused skills under `skills/` load on demand for architecture, Compose UI, and testing.

Topic reference library

`references/00-banned-antipatterns.md` through `references/19-xml-to-compose-migration.md` cover the main Android and Kotlin topics.

Per-agent setup guides

Files under `agents/` explain how to install the skills for Cursor, Claude Code, Codex, Gemini, Copilot, and others.

Validation and registry checks

`scripts/validate_skills.py` and `api/skills.lock` keep the skill files linted, linked, and registered in CI.

How to get it

  1. 1Run
    git clone https://github.com/haidrrrry/compose-kotlin-agent-skills.git \
      .cursor/skills/compose-kotlin-agent-skills
  2. 2Run
    # Personal — available in all your projects
    git clone https://github.com/haidrrrry/compose-kotlin-agent-skills.git \
      ~/.claude/skills/compose-kotlin-agent-skills
    
    # Project-specific
    git clone https://github.com/haidrrrry/compose-kotlin-agent-skills.git \
      .claude/skills/compose-kotlin-agent-skills
  3. 3Run
    git clone https://github.com/haidrrrry/compose-kotlin-agent-skills.git
  4. 4Run
    git clone https://github.com/haidrrrry/compose-kotlin-agent-skills.git

README

compose-kotlin-agent-skills

compose-kotlin-agent-skills

Make your AI coding agent actually understand Jetpack Compose & Kotlin — on Android, Kotlin Multiplatform, and Compose Multiplatform.
Strict MVI · Kotlin 2.x K2 · Compose 2026 · CI-validated · 27 agents supported.

Setup time License Skill Lint Agents supported Kotlin Compose AGENTS.md Star History Chart


Quick install

AgentCommand
Cursorgit clone https://github.com/haidrrrry/compose-kotlin-agent-skills.git .cursor/skills/compose-kotlin-agent-skills
Claude Codegit clone https://github.com/haidrrrry/compose-kotlin-agent-skills.git ~/.claude/skills/compose-kotlin-agent-skills
Codex CLIgit clone https://github.com/haidrrrry/compose-kotlin-agent-skills.git → add block to root AGENTS.md (guide)
Gemini CLIgit clone https://github.com/haidrrrry/compose-kotlin-agent-skills.git → add block to GEMINI.md (guide)
GitHub Copilotgit clone https://github.com/haidrrrry/compose-kotlin-agent-skills.git .github/skills/compose-kotlin-agent-skills (guide)

Per-agent details → Setup · All 27 agents → agents/README.md

The problem

AI coding agents generate Kotlin/Compose code that compiles but gets the details wrong:

  • _state.value = … instead of atomic _state.update { } — race conditions
  • collectAsState() instead of collectAsStateWithLifecycle() — battery drain
  • Hardcoded UI strings instead of stringResource(R.string.…) — broken localisation
  • LazyColumn without key + contentType — broken scroll, recomposition storms
  • GlobalScope.launch { } inside ViewModels — leaks
  • mutableStateListOf in ViewModel — survives config change wrong

This skill kit fixes that by giving your AI agent:

  1. A primary SKILL.md with the 2026 toolchain, strict MVI guardrails, and a dedicated banned-antipatterns reference.
  2. 3 modular sub-skills (architecture, Compose, testing) loaded on demand — Compose sub-skill includes REVIEW MODE for screen audits.
  3. 20 reference modules (00–19) covering every major Android/Kotlin topic.
  4. 27 per-agent install guides so Cursor, Claude Code, Codex, Copilot, Gemini, etc. each load it correctly.
  5. CI-validated — every SKILL.md is frontmatter-linted, link-checked, and registered in api/skills.lock on every push.

What this is NOT

Wrong guessReality
Android library / Gradle dependencyNo — nothing to implementation(...). Pure markdown.
Alexa / Bixby / voice-assistant "skill"No — not a voice platform. The word "skill" here = agentskills.io format.
On-device LLM runtime / tool-calling SDKNo — no model inference, no agent framework.
Compose UI library (coachmarks, theming, charts)No — we don't ship Composables; we teach how to write them.
Backend or REST APINo — markdown files plus a Python validator.

TL;DR: clone this repo into your agent's skills folder. The agent reads it before writing Kotlin. That's it.


What changes when you install it

AreaWithout the skillWith the skill
ViewModel state_state.value = ... (race conditions)Atomic _state.update { it.copy(...) }
Flow collectioncollectAsState() (drains battery in background)collectAsStateWithLifecycle()
UI textHardcoded "Login" literalsstringResource(R.string.login)
ListsLazyColumn with no keyStable key + contentType per item
ArchitectureMixed MVVM / state in ComposableStrict MVI — UiState + UiEvent + UiEffect
DIcompanion object Singleton@HiltViewModel + constructor injection
NavigationString routes (deprecated)Navigation 3 type-safe NavKey routes
CoroutinesGlobalScope.launch { }viewModelScope + structured concurrency
Compose perfUnstable params → constant recomposition@Stable / @Immutable + deferred reads
Edge-to-edgeStatus bar overlaps contentenableEdgeToEdge() + correct insets
VersionsMade up / outdatedPinned to 2026 stable releases

Platforms

Supported
Target (what the docs teach)Android · Kotlin Multiplatform · Compose Multiplatform
Host (where the docs are read)macOS · Linux · Windows — anywhere your AI agent runs
Agent compatibility27 install guides (see agents/README.md)
Languages taughtKotlin 2.x (K2 compiler)
Tooling enforcedAGP 9, Compose BOM 2026, Navigation 3

Skill catalog

SkillWhen the agent loads it
SKILL.md (root)Any Android / Kotlin / Compose work — toolchain, MVI guardrails, banned antipatterns
skills/android-kotlin-architecture/SKILL.mdClean Architecture, MVVM/MVI, modules, UseCases, UiState / UiEvent / UiEffect
skills/android-kotlin-compose/SKILL.mdJetpack Compose UI, recomposition, Material 3, edge-to-edge, REVIEW MODE audits
skills/android-kotlin-testing/SKILL.mdViewModel tests, Compose UI tests, Hilt fakes, Turbine

Full routing index → AGENTS.md


What's covered

TopicReferenceWhat the agent learns
Banned antipatternsreferences/00-banned-antipatterns.mdMaster WRONG/RIGHT lookup — load first for reviews
Architecturereferences/01-architecture.mdClean Arch, MVVM, MVI, module structure
Compose UIreferences/02-compose-ui.mdComposition, stability, Modifier order, theming
Animationsreferences/03-animations.mdSprings, Canvas, gestures, shared elements
Coroutines & Flowreferences/04-coroutines-flow.mdStateFlow, structured concurrency, error handling
Hilt DIreferences/05-hilt-di.mdScopes, EntryPoint, testing
Roomreferences/06-room-db.mdMigrations, offline-first, DAOs
Navigationreferences/07-navigation.mdNavigation 3, type-safe routes, deep links
KMP / CMPreferences/08-kmp-cmp.mdexpect/actual, shared ViewModel, Ktor
Networkingreferences/09-networking.mdKtor, JWT, DTO mappers
Performancereferences/10-performance.mdRecomposition, LazyColumn, baseline profiles
Testingreferences/11-testing.mdTurbine, Compose UI tests, Hilt TestInstallIn
Camera & MLreferences/12-camera-mlkit.mdCameraX, ML Kit pose, angle math
Releasereferences/13-release-checklist.mdSigning, R8, Play Store
DataStorereferences/14-datastore.mdPreferences/Proto DataStore, SP migration, encryption
Paging 3references/15-paging3.mdPagingSource, RemoteMediator, asState(), LoadState UI
Coil 3references/16-coil-image.mdAsyncImage, Coil 3.4 network dep, cache config
Accessibilityreferences/17-accessibility.mdTalkBack, semantics, 48dp targets, WCAG AA
Gradle / buildreferences/18-gradle-build-logic.mdConvention plugins, KSP, R8, baseline profiles
XML → Composereferences/19-xml-to-compose-migration.mdView migration, RxJava → Flow, interop checklist

Review mode

Ask your agent to audit a Composable or screen — triggers the 6-point checklist in skills/android-kotlin-compose/SKILL.md:

"Review TodoScreen.kt in REVIEW MODE" · "Audit this composable for banned antipatterns"

#Check
1modifier: Modifier = Modifier present and last optional param
2State hoisted — no screen state stuck in @Composable
3LazyColumn/LazyRow has key + contentType
4collectAsStateWithLifecycle() — never collectAsState()
5No IO/DB/network in composition body
6Data params to children are @Stable or @Immutable

Cross-reference hits against references/00-banned-antipatterns.md. Example target: examples/todo-mvi/TodoScreen.kt.

How it works

You ask about Kotlin / Compose
        |
        v
  AI reads SKILL.md (routing + guardrails + banned antipatterns)
        |
        v
  Loads the right sub-skill
        |
        +-- skills/android-kotlin-architecture/SKILL.md
        +-- skills/android-kotlin-compose/SKILL.md
        +-- skills/android-kotlin-testing/SKILL.md
        |
        v
  Pulls topic reference
        |
        +-- references/00-banned-antipatterns.md
        +-- references/01-architecture.md
        +-- references/02-compose-ui.md
        +-- ... 20 references total (00–19)
        |
        v
  Writes code that follows the guardrails

Layer 1: root skill (SKILL.md) — single source of truth for toolchain versions, mandatory defaults, and banned antipatterns.

Layer 2: sub-skills (3 files) — focused playbooks loaded only when the task matches the domain.

Layer 3: references (20 files, 00–19) — deep dives with WRONG/RIGHT pairs, decision matrices, pinned versions.

Layer 4: validator (scripts/validate_skills.py) — CI enforces frontmatter, link integrity, and skill-registry parity.


File structure

compose-kotlin-agent-skills/
├── SKILL.md                              # Routing hub + MVI guardrails + banned antipatterns
├── AGENTS.md                             # agentskills.io meta-discovery index
├── CHANGELOG.md                          # Keep a Changelog · semver
├── ROADMAP.md                            # Planned milestones
├── api/
│   └── skills.lock                       # CI-tracked registry of every SKILL.md (md5)
├── skills/
│   ├── android-kotlin-architecture/SKILL.md
│   ├── android-kotlin-compose/SKILL.md
│   └── android-kotlin-testing/SKILL.md
├── references/                           # 20 topic deep-dives (00–19)
├── agents/                               # 27 per-agent install guides + index
├── examples/
│   ├── todo-mvi/                         # MVI todo list reference (VM + Screen + Repository)
│   ├── animated-clock/
│   └── authenticator/
├── assets/
│   └── logo.png
├── scripts/
│   ├── validate_skills.py                # Frontmatter + link + lock validator (JUnit XML capable)
│   └── update_lock.sh                    # Regenerate api/skills.lock after editing any SKILL.md
└── .github/
    ├── workflows/skill-lint.yml          # CI: validator + JUnit report
    ├── pull_request_template.md
    └── ISSUE_TEMPLATE/                   # bug, feature, new-agent

Setup {#setup}

The skill is just markdown. Every agent below reads the same content — pick yours.

Cursor

git clone https://github.com/haidrrrry/compose-kotlin-agent-skills.git \
  .cursor/skills/compose-kotlin-agent-skills

Cursor auto-discovers .cursor/skills/*/SKILL.md. For a rules-file alternative see agents/cursor.md.

Claude Code

# Personal — available in all your projects
git clone https://github.com/haidrrrry/compose-kotlin-agent-skills.git \
  ~/.claude/skills/compose-kotlin-agent-skills

# Project-specific
git clone https://github.com/haidrrrry/compose-kotlin-agent-skills.git \
  .claude/skills/compose-kotlin-agent-skills

Add a 5-line block to your project's CLAUDE.md — see agents/claude.md.

Codex CLI (OpenAI)

git clone https://github.com/haidrrrry/compose-kotlin-agent-skills.git

Then add a reference block to your project's root AGENTS.md — see agents/codex.md.

Gemini CLI

git clone https://github.com/haidrrrry/compose-kotlin-agent-skills.git

Then add a reference block to GEMINI.md — see agents/gemini.md.

GitHub Copilot

Clone into .github/skills/compose-kotlin-agent-skills/ and add a block to .github/copilot-instructions.md — see agents/copilot.md.

Other agents (22 more)

Windsurf · Kimi · DeepSeek · Cline · Aider · Continue.dev · OpenCode · Zed · Amazon Q · JetBrains AI / Junie · Sourcegraph Cody · Replit Agent · Augment · Roo Code · Goose · OpenHands · Qwen Code · Trae · Tabnine · Factory Droid · Devin · Bolt.new

Full table → agents/README.md Paste-anywhere snippet → agents/_shared-snippet.md


Quick example

After setup, talk to your AI agent normally:

"My LazyColumn jank — fix it."

Or run REVIEW MODE against the bundled example:

"Review examples/todo-mvi/TodoScreen.kt in REVIEW MODE"

See examples/todo-mvi/README.md for the MVI patterns it demonstrates.

What happens:

  1. Agent reads SKILL.md for the routing rules.
  2. Loads skills/android-kotlin-compose/SKILL.md and references/10-performance.md.
  3. Checks your code for missing key / contentType, unstable items, heavy work in item blocks.
  4. Returns a fix that follows the guardrails — key = { it.id }, @Immutable data class, derivedStateOf where appropriate.

No hallucinated APIs. No GlobalScope. No _state.value = ….


Validate locally

python3 scripts/validate_skills.py --strict --lock-check api/skills.lock

CI runs the same command on every push and pull request. If you edit any SKILL.md:

./scripts/update_lock.sh

Then commit api/skills.lock alongside your change.


FAQ

Best Kotlin / Compose skill for Cursor?

Clone this repo into .cursor/skills/compose-kotlin-agent-skills and point Cursor rules at SKILL.md. Covers Compose, MVI, Hilt, Room, Navigation 3, and the banned-antipatterns table.

How do I add Kotlin rules to Claude Code?

git clone https://github.com/haidrrrry/compose-kotlin-agent-skills.git ~/.claude/skills/compose-kotlin-agent-skills

Claude auto-discovers SKILL.md in the skills folder.

MVVM vs MVI — which does this enforce?

MVI with atomic StateFlow updates. UiState + UiEvent + UiEffect. Naked state assignment (_state.value = ...) is explicitly banned.

Kotlin Multiplatform / Compose Multiplatform?

See references/08-kmp-cmp.md — shared ViewModel, expect/actual, Ktor networking, SQLDelight vs Room.

Is this a Compose UI library or an Alexa skill?

No. It's markdown instructions for coding AIs — clone with git, not implementation(...). The word "skill" follows the agentskills.io format, unrelated to voice assistants.


Contributing

PRs welcome — see .github/pull_request_template.md.

Every new sub-skill must:

  1. Live under skills/<kebab-case-name>/SKILL.md with valid frontmatter.
  2. Pass python3 scripts/validate_skills.py --strict.
  3. Be registered in AGENTS.md.
  4. Bump api/skills.lock via ./scripts/update_lock.sh.

License

MIT — see LICENSE.

Author: haidrrrry

Files in the repo

Repository payload21 top-level entries
  • .github
  • agents
  • api
  • assets
  • examples
  • marketing
  • modules
  • references
  • scripts
  • skills
  • .gitattributes
  • AGENTS.md
  • CHANGELOG.md
  • CITATION.cff
  • CODE_OF_CONDUCT.md
  • CONTRIBUTING.md
  • LICENSE
  • README.md
  • ROADMAP.md
  • SECURITY.md
  • SKILL.md

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More skills

obra/
superpowers

An agentic skills framework & software development methodology that works.

285k
1 add

Turn any codebase, with its docs, SQL schemas, configs, and PDFs, into a queryable knowledge graph. A /graphify skill for Claude Code, Cursor, Codex, and Gemini CLI: local deterministic AST parsing, every edge explained, no vector store.

117k
1 add
Vincentwei1021/
anything2explainer

Topic in, narrated explainer video out. A Claude Code / Codex skill that turns any topic into a black-canvas motion-graphics explainer video with TTS voiceover, subtitles and a chapter progress bar. Chinese or English; every frame drawn in code with Remotion.

666

Open-source AI job search: scan job portals, evaluate listings into a structured A-H report with a global 1-5 score, tailor your CV, track applications — runs locally in your AI coding CLI (Claude Code, Codex, OpenCode, Antigravity…)

71k