kotlin-tooling-native-build-performance
Skill1.1k starsChanged 16 days agoApache-2.0View on GitHub
Diagnoses and fixes slow Kotlin/Native compilation and linking in Kotlin Multiplatform projects that target iOS. Use when the user reports slow iOS or shared-framework builds, long linkDebug*/linkRelease* or XCFramework tasks, cold CI builds that re-download the Kotlin/Native toolchain, KSP or other generated code on the native path, transitiveExport usage, or asks for a local-development versus CI build performance plan.
Adopted by
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Who's talking about Kotlin/kotlin-agent-skills
- @pamelaahill.bsky.social“The @kotlinlang.org team has been working on some skills. There is one for migrating your project to AGP 9, …”Bluesky · Mar 18, 2026 · 15 likes
- @kotlinweekly.bsky.social“Kotlin Agent Skills: github.com/Kotlin/kotli... #kotlin”Bluesky · May 18, 2026 · 8 likes
- @kotlinlang.org“🤖 Kotlin agent skills are now available on GitHub! Explore AI-assisted skills for converting Java to …”Bluesky · May 19, 2026 · 5 likes
- premex-ab/gross“Bump org.jetbrains.kotlinx:kotlinx-collections-immutable from 0.4.0 to 0.5.1”GitHub · Jul 3, 2026 · 1 reactions
- premex-ab/gross“Bump org.jetbrains.kotlinx:kotlinx-collections-immutable from 0.4.0 to 0.5.0”GitHub · Jun 10, 2026 · 1 reactions
The biggest 5 of 50 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 50
Talked about on GitHub, Bluesky and Hacker News (50 times).
On GitHub · 46
- Jul 3, 2026Bump org.jetbrains.kotlinx:kotlinx-collections-immutable from 0.4.0 to 0.5.1 — premex-ab/gross1 reaction
- Jun 10, 2026Bump org.jetbrains.kotlinx:kotlinx-collections-immutable from 0.4.0 to 0.5.0 — premex-ab/gross1 reaction · 1 comment
- Nov 11, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Nov 7, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Nov 2, 2026Bump org.jetbrains.kotlinx:kotlinx-collections-immutable from 0.4.0 to 0.5.2 in the kotlin-and-compose group across 1 directory — altaraneu/watchwallet0 reactions
41 more on GitHub
- Nov 1, 2026codex-plugins.github.kotlin.kotlin-agent-skills: init at 0-unstable-2026-10-30 — sudosubin/agents.nix0 reactions
- Nov 1, 2026codex-marketplaces.github.kotlin.kotlin-agent-skills: init at 0-unstable-2026-10-30 — sudosubin/agents.nix0 reactions
- Oct 30, 2026claude-code-plugins.github.kotlin.kotlin-agent-skills: 0-unstable-2026-03-24 → 0-unstable-2026-10-30 — sudosubin/agents.nix0 reactions
- Oct 30, 2026claude-code-marketplaces.github.kotlin.kotlin-agent-skills: 0-unstable-2026-09-11 → 0-unstable-2026-10-30 — sudosubin/agents.nix0 reactions
- Oct 29, 2026claude-code-plugins.github.kotlin.kotlin-agent-skills: 0-unstable-2026-09-11 → 0-unstable-2026-03-24 — sudosubin/agents.nix0 reactions
- Oct 28, 2026claude-code-plugins.github.kotlin.kotlin-agent-skills: init at 0-unstable-2026-09-11 — sudosubin/agents.nix0 reactions
- Oct 28, 2026claude-code-marketplaces.github.kotlin.kotlin-agent-skills: init at 0-unstable-2026-09-11 — sudosubin/agents.nix0 reactions
- Oct 21, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Oct 11, 2026Build(deps): Bump org.jetbrains.kotlinx:kotlinx-collections-immutable from 0.4.0 to 0.5.2 — krishnasinghrao/cloudstream-macos0 reactions
- Oct 10, 2026Bump org.jetbrains.kotlinx:kotlinx-collections-immutable from 0.3.8 to 0.5.2 — HKmario852/monologue0 reactions
- Oct 7, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Oct 3, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 30, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 29, 2026agent-skills.github.kotlin.kotlin-agent-skills: init at 0-unstable-2026-09-11 — sudosubin/agents.nix0 reactions
- Sep 24, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 23, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 23, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 19, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 19, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 9, 2026Bump org.jetbrains.kotlinx:kotlinx-collections-immutable from 0.4.0 to 0.5.2 in /ragedroid — eordano/ragewarden0 reactions
- Sep 7, 2026chore(deps): Bump org.jetbrains.kotlinx:kotlinx-collections-immutable from 0.4.0 to 0.5.2 — caucy2026/KemiMail0 reactions · 1 comment
- Sep 7, 2026chore(deps): bump org.jetbrains.kotlinx:kotlinx-collections-immutable from 0.4.0 to 0.5.2 — VictorSkurchik/tablet-demo0 reactions
- Aug 25, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Aug 21, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Aug 18, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Aug 14, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Aug 14, 2026chore(deps): bump org.jetbrains.kotlinx:kotlinx-collections-immutable from 0.4.0 to 0.5.1 — motyabc/email0 reactions · 1 comment
- Aug 11, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Aug 7, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Aug 4, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Jul 31, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Jul 31, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Jul 30, 2026chore(deps): bump org.jetbrains.kotlinx:kotlinx-collections-immutable from 0.4.0 to 0.5.1 — slowwylx/DVote0 reactions
- Jul 16, 2026build(deps): bump org.jetbrains.kotlinx:kotlinx-collections-immutable from 0.4.0 to 0.5.1 — fuchi-no-dokuneko/ShareGuard0 reactions
- Jun 30, 2026chore(deps): bump org.jetbrains.kotlinx:kotlinx-collections-immutable from 0.4.0 to 0.5.0 — feihu1991/legado-with-MD30 reactions
- Jun 27, 2026Create a SKILL for every migration — InsertKoinIO/koin-compiler-plugin0 reactions
- Jun 25, 2026Bump org.jetbrains.kotlinx:kotlinx-collections-immutable from 0.4.0 to 0.5.0 — investigaciongiis/test_signal_android0 reactions
- Jun 15, 2026Bump org.jetbrains.kotlinx:kotlinx-collections-immutable from 0.4.0 to 0.5.0 — alexandregpereira/Monster-Compendium0 reactions
- Jun 9, 2026bump: (deps): bump org.jetbrains.kotlinx:kotlinx-collections-immutable from 0.4.0 to 0.5.0 — TENUM-Dev/tenum0 reactions
- May 19, 2026Add Kotlin Agent Skill for DataFrame — Kotlin/dataframe0 reactions
- Apr 25, 2018Come to the Dark Side : we have Kotlin! 🍪 — ghusta/android-docker-search0 reactions · 1 comment
On Bluesky · 3
- Mar 18, 2026The @kotlinlang.org team has been working on some skills. There is one for migrating your project to AGP 9, done by my super-smart… — @pamelaahill.bsky.social15 likes and reposts
- May 18, 2026Kotlin Agent Skills: github.com/Kotlin/kotli... #kotlin — @kotlinweekly.bsky.social8 likes and reposts
- May 19, 2026🤖 Kotlin agent skills are now available on GitHub! Explore AI-assisted skills for converting Java to Kotlin, migrating to AGP 9.0, mapping… — @kotlinlang.org5 likes and reposts · 1 reply
On Hacker News · 1
- May 18, 2026Kotlin-agent-skills: A collection of skills for projects using Kotlin1 point
In this repository9 other files it gives its agents.
- kotlin-backend-jpa-entity-mappingSkill
- kotlin-tooling-agp9-migrationSkill
- kotlin-tooling-cocoapods-spm-migrationSkill
- kotlin-tooling-gradle-to-kotlin-toolchain-pluginSkill
- kotlin-tooling-gradle-to-kotlin-toolchain-projectSkill
- kotlin-tooling-immutable-collections-0-5-x-migrationSkill
- kotlin-tooling-java-to-kotlinSkill
- kotlin-tooling-kotlin-toolchain-plugin-authoringSkill
- kotlin-tooling-kotlin-toolchainSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 23
Never trade away required release behavior.
- Distinctive: line 47
Run the static audit from the project root:
- Distinctive: line 60
Run it twice when practical.
- Distinctive: line 69
If you cannot run the build (no macOS host, no Xcode), analyze logs, build scans, or checked-in metrics instead — and state explicitly that …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Kotlin/Native Build Performance
Turn "the iOS build is slow" into a measured diagnosis and a small set of safe fixes. Two rules apply throughout:
- Never trade away required release behavior. A faster local loop must not change what CI publishes.
- Measure before and after with the same command and the same build state. An unmeasured fix is a guess.
Step 0: Classify the Slow Scenario
Establish four facts before editing anything: where (local or CI), what (debug feedback loop or release/distribution artifact), state (first build, clean, warm, or no-op), and phase (which tasks dominate the log). Then match the dominant symptom:
| Symptom in the build log | Likely cause | Read |
linkRelease* or *ReleaseXCFramework tasks in a local development loop | Building distribution artifacts for development | artifacts-and-targets |
| Kotlin/Native compiler distribution downloaded on every CI run | ~/.konan not preserved between runs | caching-and-gradle |
| Long pause before the first task starts | Configuration phase, no configuration cache | caching-and-gradle |
| All iOS targets build when only one simulator is needed | Broad task (build, assemble, assemble*XCFramework) or unused targets | artifacts-and-targets |
ksp* tasks ahead of compileKotlinIos* | Generated-code work on the native path | exports-and-generated-code |
| Small source edit recompiles and relinks everything | Compiler caches disabled, or missing incrementality | caching-and-gradle, experimental |
Machine overloaded while several link* tasks run at once | Parallel native linking | caching-and-gradle, worker-limit caveat |
Step 1: Audit and Measure
Run the static audit from the project root:
scripts/audit-native-build.sh /path/to/projectIt is read-only and prints
file:linefindings (disabled caches, broad local tasks,transitiveExport, broad KSP configuration, missing CI.konancache), each pointing at the reference file with the fix. Findings are leads, not verdicts — confirm each against project policy.- Find the command the user actually waits for: a script, a CI step, or the Gradle invocation inside an Xcode build phase. Optimize that command, not a task you picked yourself.
Run it twice when practical. The first build downloads Kotlin/Native components and fills caches; only the second and later runs are representative. Attribute time per task before blaming the compiler:
kotlin.build.report.output=file # writes build/reports/kotlin-build/Gradle's
--scanor--profilework too.- If you cannot run the build (no macOS host, no Xcode), analyze logs, build scans, or checked-in metrics instead — and state explicitly that the conclusion is static.
Step 2: Fix in Safe Order
Apply fixes one at a time, re-measuring as you go:
- Restore healthy defaults — remove cache/daemon workarounds, enable
Gradle build and configuration caches, keep
~/.konanwarm in CI, update Kotlin: references/caching-and-gradle.md - Build only what the feedback loop needs — one specific task per loop, correct integration method, justified target matrix: references/artifacts-and-targets.md
- Cut export and generated-code cost — drop
transitiveExport, narrowexport(...), scope KSP work to the native compilations that need it: references/exports-and-generated-code.md - Experimental switches last, with the user's agreement: references/experimental.md
Worked Example
A developer on an Apple Silicon Mac complains that "every shared-module
change costs 12 minutes". Their loop runs ./gradlew :shared:assembleXCFramework.
A build scan of the second (warm) run shows:
:shared:linkReleaseFrameworkIosArm64 348s
:shared:linkReleaseFrameworkIosX64 341s
:shared:compileKotlinIosX64 96s
:shared:linkDebugFrameworkIosSimulatorArm64 41s
:shared:compileKotlinIosSimulatorArm64 38s
configuration phase 64sReasoning chain:
- The loop is local + debug + warm, but ~690s goes to
linkRelease*— release linking is an order of magnitude slower than debug and only CI needs it. Replace the local command with:shared:linkDebugFrameworkIosSimulatorArm64(or the Xcode embed task if Xcode drives the build). (artifacts-and-targets) - All
iosX64work serves Intel simulators; ask whether the team still supports them before removing the target. (artifacts-and-targets) - 64s of configuration on every run disappears behind
org.gradle.configuration-cache=trueonce trialed. (caching-and-gradle) - Expected loop after the change: ~40s compile + ~40s link on warm builds — confirm by re-running the new command twice and comparing.
- CI keeps
assembleXCFrameworkuntouched; note that explicitly in the report.
Verify
- Re-run the exact baseline command; compare warm build against warm build, not warm against cold.
- Second run with the configuration cache reports it is being reused.
- The local development log no longer contains
linkRelease*,*ReleaseXCFramework, or removed generator tasks. - CI still produces every required release artifact, unchanged.
- Tests pass and the app still runs from Xcode.
scripts/audit-native-build.shreports no findings you have not consciously accepted and documented.
Report Your Changes
Close with a short performance note:
- The slow scenario (local/CI, debug/release, cold/warm) and the measured evidence — or a statement that the analysis was static.
- Each change, and why it is safe for release behavior.
- The before/after commands the user can run to confirm the win.
- Remaining tradeoffs: experimental flags enabled, targets removed under a policy assumption, worker limits, or generated-code work deferred.
- Links to the relevant official documentation below.
Official Documentation
| Topic | Link |
| Improving Kotlin/Native compilation time | https://kotlinlang.org/docs/native-improving-compilation-time.html |
| Kotlin Gradle plugin compilation and caches | https://kotlinlang.org/docs/gradle-compilation-and-caches.html |
| iOS integration methods | https://kotlinlang.org/docs/multiplatform-ios-integration-overview.html |
| Direct integration with Xcode | https://kotlinlang.org/docs/multiplatform/multiplatform-direct-integration.html |
| Building final native binaries and XCFrameworks | https://kotlinlang.org/docs/multiplatform/multiplatform-build-native-binaries.html |
| Kotlin/Native binary options | https://kotlinlang.org/docs/native-binary-options.html |
| KSP with Kotlin Multiplatform | https://kotlinlang.org/docs/ksp-multiplatform.html |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

