- How you use it
- You ask for it
- What it can do
- writes files · runs shell
- What's inside
The option
| Option | ASkill · v1.0.0KMP commonMain review skill |
|---|---|
| How you use it | You ask for it |
| What it can do | writes files · runs shell |
| What's inside |
What this thread does
The problem
You share code between Android and iOS (and maybe desktop or web) with Kotlin Multiplatform. You ask a coding agent for a feature. It compiles on Android, but the shared module breaks for iOS: Android imports in commonMain, an Android-only library (a database or HTTP client without multiplatform support), or a platform API called directly instead of through expect/actual. The agent only built the Android target, so it said "done".
What the official docs say
The Kotlin "AI for development" page (dated 15 September 2026, read 18 October 2026) lists multiplatform checks to put in AGENTS.md or in a task's success criteria:
- Run the target-specific tests after every change, where they exist.
- Verify that all configured KMP targets build before the task counts as complete.
- Review for platform-specific APIs leaking into common code.
For finding libraries that work on every target, the page points to the klibs.io MCP server (a catalog of multiplatform libraries; setup is in its README). It also describes Kotlin AI skills, reusable instructions that follow the Agent Skills standard and work with Claude Code, Codex, Gemini, Copilot and Junie. The skills live in Kotlin/kotlin-agent-skills (Apache-2.0). The current skills include migrations, build tooling and backend work, not general "write KMP code" rules, so the rules above stay your job.
A third-party guide (claudecodeguides.com, not verified) makes the same observation: the common failure is Android-only code, with Ktor, SQLDelight and kotlinx.serialization named as multiplatform replacements for Retrofit, Room and Gson.
How to describe it to your agent
This is a Kotlin Multiplatform project. Code in commonMain must use only Kotlin standard library and multiplatform libraries; no android.*, java.*, or Android-only dependencies. Anything platform-specific goes behind expect/actual with an actual in every target. Before a new dependency in commonMain, check it supports all our targets (klibs.io, if configured). A task is finished only when every configured target compiles (list the Gradle tasks here) and the target-specific tests pass. Report which targets you built.
Put the target list and exact Gradle commands in the repo's AGENTS.md, so they are not left to the agent's guess.
Mistakes to check
- "It builds" meaning only
assembleDebug. Name one compile task per target (for example the iOS simulator one) in your rules. - Fixing a failing iOS build by moving code into
androidMain: ask the agent for anexpect/actualor a multiplatform library instead. - Trusting the agent to know that a library is multiplatform. Check the library's own docs or klibs.io.
Limits
From official docs and one secondary guide. I did not run any of this. For slow iOS builds see the Kotlin/Native build thread; for seeing a Compose Desktop app run, the hot reload MCP thread.
Started from a post by @JetBrains (Kotlin docs), packaged by the editor. Original post
- 01 · YouPaste the line from Try it into your agent.
- 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
- 03 · YouApprove a one-line report. Nothing is posted without you.