compose-kotlin-agent-skills
haidrrrry · haidrrrry/compose-kotlin-agent-skills
Bộ kỹ năng này dạy các tác nhân mã hóa AI tạo ra mã Jetpack Compose và Kotlin chính xác, chất lượng cao cho ứng dụng Android và đa nền tảng.
Jetpack Compose & Kotlin AI agent skills for Cursor, Claude Code, Codex, Gemini & 27+ agents. Strict MVI · Kotlin 2.x K2 · Compose 2026 · CI-validated.
Xem trước
Bạn có thể làm gì với nó
- Tạo các thành phần UI Jetpack Compose chất lượng cao cho ứng dụng Android.
- Xây dựng mã Kotlin Multiplatform Mobile (KMM) chính xác theo các mẫu MVI.
- Tự động sửa các lỗi mã hóa Kotlin/Compose phổ biến như tình trạng tranh chấp hoặc rò rỉ.
Kiểm tra an toàn
Không thấy dấu hiệu rủi ro trong các file đã quét.
Quét tự động các file trong repo. Luôn xem lại code trước khi chạy.
Trích từ README
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.
Quick install
| Agent | Command |
|---|---|
| Cursor | git clone https://github.com/haidrrrry/compose-kotlin-agent-skills.git .cursor/skills/compose-kotlin-agent-skills |
| Claude Code | git clone https://github.com/haidrrrry/compose-kotlin-agent-skills.git ~/.claude/skills/compose-kotlin-agent-skills |
| Codex CLI | git clone https://github.com/haidrrrry/compose-kotlin-agent-skills.git → add block to root AGENTS.md (guide) |
| Gemini CLI | git clone https://github.com/haidrrrry/compose-kotlin-agent-skills.git → add block to GEMINI.md (guide) |
| GitHub Copilot | git 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 conditionscollectAsState()instead ofcollectAsStateWithLifecycle()— battery drain- Hardcoded UI strings instead of
stringResource(R.string.…)— broken localisation LazyColumnwithoutkey+contentType— broken scroll, recomposition stormsGlobalScope.launch { }inside ViewModels — leaksmutableStateListOfin ViewModel — survives config change wrong
This skill kit fixes that by giving your AI agent:
- A primary
SKILL.mdwith the 2026 toolchain, strict MVI guardrails, and a dedicated banned-antipatterns reference. - 3 modular sub-skills (architecture, Compose, testing) loaded on demand — Compose sub-skill includes REVIEW MODE for screen audits.
- 20 reference modules (00–19) covering every major Android/Kotlin topic.
- 27 per-agent install guides so Cursor, Claude Code, Codex, Copilot, Gemini, etc. each load it correctly.
- CI-validated — every
SKILL.mdis frontmatter-linted, link-checked, and registered inapi/skills.lockon every push.
What this is NOT
| Wrong guess | Reality |
|---|---|
| Android library / Gradle dependency | No — 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 SDK | No — 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 API | No — 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
| Area | Without the skill | With the skill |
|---|---|---|
| ViewModel state | _state.value = ... (race conditions) | Atomic _state.update { it.copy(...) } |
| Flow collection | collectAsState() (drains battery in background) | collectAsStateWithLifecycle() |
| UI text | Hardcoded "Login" literals | stringResource(R.string.login) |
| Lists | LazyColumn with no key | Stable key + contentType per item |
| Architecture | Mixed MVVM / state in Composable | Strict MVI — UiState + UiEvent + UiEffect |
| DI | companion object Singleton | @HiltViewModel + constructor injection |
| Navigation | String routes (deprecated) | Navigation 3 type-safe NavKey routes |
| Coroutines | GlobalScope.launch { } | viewModelScope + structured concurrency |
| Compose perf | Unstable params → constant recomposition | @Stable / @Immutable + deferred reads |
| Edge-to-edge | Status bar overlaps content | enableEdgeToEdge() + correct insets |
| Versions | Made up / outdated | Pinned 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 compatibility | 27 install guides (see agents/README.md) |
| Languages taught | Kotlin 2.x (K2 compiler) |
| Tooling enforced | AGP 9, Compose BOM 2026, Navigation 3 |
Skill catalog
| Skill | When the agent loads it |
|---|---|
SKILL.md (root) | Any Android / Kotlin / Compose work — toolchain, MVI guardrails, banned antipatterns |
skills/android-kotlin-architecture/SKILL.md | Clean Architecture, MVVM/MVI, modules, UseCases, UiState / UiEvent / UiEffect |
skills/android-kotlin-compose/SKILL.md | Jetpack Compose UI, recomposition, Material 3, edge-to-edge, REVIEW MODE audits |
skills/android-kotlin-testing/SKILL.md | ViewModel tests, Compose UI tests, Hilt fakes, Turbine |
Full routing index → AGENTS.md
What's covered
| Topic | Reference | What the agent learns |
|---|---|---|
| Banned antipatterns | references/00-banned-antipatterns.md | Master WRONG/RIGHT lookup — load first for reviews |
| Architecture | references/01-architecture.md | Clean Arch, MVVM, MVI, module structure |
| Compose UI | references/02-compose-ui.md | Composition, stability, Modifier order, theming |
| Animations | references/03-animations.md | Springs, Canvas, gestures, shared el |