kmp-project-structure

kmp-project-structure is a skill for Claude Code, Codex from iammohdzaki/kmp-skills. It costs 71 tokens per session (3,838 once invoked), scanned A, original, MIT.

A reference guide for structuring new Kotlin Multiplatform projects, which share code between platforms. It describes the newer multi-module layout with separate shared, Android, and desktop application modules, and compares it with the older layout.

In plain words
What is it for?
Use it when creating or reviewing a KMP project structure and its Gradle configuration, especially for projects using AGP 9.0 or newer.
Why use it?
It helps avoid a project structure that is incompatible with newer Android Gradle Plugin versions. It also explains where shared code and platform-specific application code belong.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when creating or reviewing a KMP project structure and its Gradle configuration, especially for projects using AGP 9.0 or newer.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/iammohdzaki/kmp-skills/kmp-project-structure
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add iammohdzaki/kmp-skills --skill kmp-project-structure
Clone the repo
git clone --depth 1 https://github.com/iammohdzaki/kmp-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for kmp-project-structure

README.md
[![agentmods](https://agentmods.dev/badge/skills/iammohdzaki/kmp-skills/kmp-project-structure/github.svg)](https://agentmods.dev/skills/iammohdzaki/kmp-skills/kmp-project-structure)
Your own site
<a href="https://agentmods.dev/skills/iammohdzaki/kmp-skills/kmp-project-structure"><img src="https://agentmods.dev/badge/skills/iammohdzaki/kmp-skills/kmp-project-structure/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for kmp-project-structure

Your own site · 80×15
<a href="https://agentmods.dev/skills/iammohdzaki/kmp-skills/kmp-project-structure"><img src="https://agentmods.dev/badge/skills/iammohdzaki/kmp-skills/kmp-project-structure.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 71 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,838 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00071 $0.03838
Opus 5 $0.00036 $0.01919
Sonnet 5 $0.00014 $0.00768
Haiku 4.5 $0.00007 $0.00384

Measured 11d ago against content hash b8a1e6cfb101, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

kmp-project-structure scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/create-project/kmp-project-structure/SKILL.md · 497 lines

How it starts

The opening of the file, as written. The whole thing — 497 lines — stays where its author put it; the contents beside it link to each section on GitHub.

KMP Project Structure (2026+)

IMPORTANT — Structure Changed

The KMP project structure has changed significantly. The old single-module layout where composeApp held both shared code and the Android app entry point is deprecated and incompatible with AGP 9.0+.

Always scaffold new projects using the new multi-module layout described in this skill. Use the KMP Wizard to generate a reference project if unsure.


Old vs New Structure

Old Structure (pre-2026 / AGP < 9.0) — Do NOT use for new projects

MyApp/
├── composeApp/                         ← ⚠️ Mixed: shared code + Android app entry point
│   ├── build.gradle.kts                ← applies com.android.application + kotlin.multiplatform
│   └── src/
│       ├── commonMain/kotlin/…
│       ├── androidMain/kotlin/…        ← MainActivity lives here
│       └── jvmMain/kotlin/…
├── iosApp/                             ← Xcode project
├── gradle/libs.versions.toml
├── build.gradle.kts
└── settings.gradle.kts

Problem: AGP 9.0 forbids com.android.application (or com.android.library) from coexisting with org.jetbrains.kotlin.multiplatform in the same module.


New Structure (AGP 9.0+ / KMP 2.2+) — Use this for all new projects

MyApp/
├── shared/                             ← KMP library module (all shared code + shared UI)
│   ├── build.gradle.kts                ← applies com.android.kotlin.multiplatform.library + kotlin.multiplatform
│   └── src/
│       ├── commonMain/kotlin/<pkg>/
│       │   ├── App.kt                  ← Root @Composable (shared UI)
│       │   ├── mvi/
│       │   ├── di/
│       │   └── navigation/
│       ├── androidMain/kotlin/<pkg>/   ← Android-specific actual implementations only
│       └── jvmMain/kotlin/<pkg>/       ← Desktop-specific actual implementations only
│
├── androidApp/                         ← Thin Android shell (entry point only)
│   ├── build.gradle.kts                ← applies com.android.application only
│   └── src/main/kotlin/<pkg>/
│       └── MainActivity.kt             ← calls setContent { App() } — nothing more
│
├── desktopApp/                         ← (optional) Thin Desktop shell
│   ├── build.gradle.kts                ← applies org.jetbrains.kotlin.jvm
│   └── src/main/kotlin/
│       └── main.kt                     ← calls application { Window { App() } }
│
├── iosApp/                             ← Xcode project (unchanged)
│   └── …
│
├── gradle/
│   └── libs.versions.toml
├── build.gradle.kts                    ← root build file
├── settings.gradle.kts
└── gradle.properties

Read the full file on GitHub · 497 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 497 lines · 71 tokens per session scan A b8a1e6cfb101

Subscribe to this mod's changes

kmp-project-structure is a skill published in the GitHub repository iammohdzaki/kmp-skills (4 stars, last pushed 1mo ago), licensed MIT. It adds 71 tokens to every session and 3,838 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

flutter-implement-json-serialization

Create model classes with fromJson and toJson methods using dart:convert. Use when manually mapping JSON keys to class properties for simple data structures.

aiskillstore/marketplace · 41 tokens

neo-swift-ui

Use this skill when building, debugging, refactoring, or reviewing SwiftUI apps or views for iOS 16+ and related Apple platforms. Trigger for NavigationStack, Observation/state flow, view composition, previews, performance, accessibility, and SwiftUI architecture.

Benknightdark/neo-skills · 57 tokens

neo-swift

Use this skill when writing, reviewing, debugging, or modernizing Swift code for iOS, macOS, server-side Swift, or shared packages. Trigger for Swift 5+ language features, structured concurrency, memory safety, protocols/generics, SwiftUI integration, and performance-sensitive code.

Benknightdark/neo-skills · 63 tokens

swift-networking

Builds a protocol-based async/await networking layer with URLSession, testable abstractions, error handling, and mock support for Swift projects. Use when user says "add networking", "create an API layer", "fetch data from API", "build a network service", "add URLSession", "implement HTTP requests", "create a REST…

jeremieb/swift-unit-test-instructions · 82 tokens

swift-project-setup

Bootstraps a new Swift/SwiftUI/UIKit project with MVVM architecture, standard folder structure, testing targets, and CLAUDE.md configuration. Use when user says "create a new project", "setup a new app", "start a new iOS project", "scaffold a Swift project", "initialize an Xcode project", or "new SwiftUI app".

jeremieb/swift-unit-test-instructions · 80 tokens

kotlin-specialist

Provides idiomatic Kotlin implementation patterns including coroutine concurrency, Flow stream handling, multiplatform architecture, Compose UI construction, Ktor server setup, and type-safe DSL design. Use when building Kotlin applications requiring coroutines, multiplatform development, or Android with Compose.…

Jeffallan/claude-skills · 86 tokens