Agent skill

Kotlin Tooling Immutable Collections 0 5 X Migration

by Kotlin in Kotlin/kotlin-agent-skills

Migrate Kotlin (and Java) code from kotlinx.collections.immutable 0.3.x / 0.4.x to the latest 0.5.x.

Apache-2.0Auto-check passedMobile

Install Kotlin Tooling Immutable Collections 0 5 X Migration

skills CLI
$ npx skills add Kotlin/kotlin-agent-skills --skill kotlin-tooling-immutable-collections-0-5-x-migration -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Kotlin/kotlin-agent-skills kotlin-tooling-immutable-collections-0-5-x-migration --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Kotlin/kotlin-agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/kotlin-tooling-immutable-collections-0-5-x-migration .claude/skills/kotlin-tooling-immutable-collections-0-5-x-migration && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
kotlin-tooling-immutable-collections-0-5-x-migration
GitHub stars
1.1k
Token cost
~2.3k tokens
SKILL.md length
1,062 words
Files
1
Skills in repo
6
Repo updated
First seen
Licence
Apache-2.0

At a glance

Migrate Kotlin (and Java) code from kotlinx.collections.immutable 0.3.x / 0.4.x to the latest 0.5.x.

  • Works in 6 steps: Find the build command → Baseline compile → Bump to the latest 0.5.x → …
  • The user mentions kotlinx.collections.immutable 0.5.x
  • SKILL.md covers When it applies, Migration, Rename reference and Links
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Kotlin Tooling Immutable Collections 0 5 X Migration is an agent skill from Kotlin/kotlin-agent-skills. Migrate Kotlin (and Java) code from kotlinx.collections.immutable 0.3.x / 0.4.x to the latest 0.5.x. The 0.5.x line renames every copy-returning method on PersistentList / PersistentMap / PersistentSet / PersistentCollection to a participial form per KEEP-0459 (add→adding, removeAt→removingAt, set→replacingAt, put→putting, clear→cleared, …) and deprecates the old names (WARNING, with ReplaceWith). Driven by the compiler: bump the version, recompile, and apply the rename each deprecation warning names. Use when…

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Mobile, covering Android development. It works with Kotlin, Java and Gradle. The repository describes itself as: A collection of AI agent skills useful for projects using Kotlin language. The licence is Apache-2.0.

When your agent uses it

  • The user mentions kotlinx.collections.immutable 0.5.x
  • PersistentList migration
  • Use adding() instead
  • Sees deprecation warnings from kotlinx.collections.immutable

Example prompts

  • “Use adding() instead”
  • “/kotlin-tooling-immutable-collections-0-5-x-migration”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Find the build command
  2. Baseline compile
  3. Bump to the latest 0.5.x
  4. Recompile and fix the warnings
  5. Custom implementers
  6. Run any documented follow-up steps

What it can do on your machine

Read from SKILL.md and the folder at commit c2f9069. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are bash, powershell and kotlin).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com
    • central.sonatype.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Kotlin Tooling Immutable Collections 0 5 X Migration loads about 2.3k tokens when it runs. Until then it costs about 187 tokens; SKILL.md has 1,062 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~187
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Kotlin/kotlin-agent-skills at commit c2f9069, republished under its Apache-2.0 licence (© Kotlin). 1,062 words, ~2,334 tokens.

Download SKILL.mdSave it as .claude/skills/kotlin-tooling-immutable-collections-0-5-x-migration/SKILL.md (or your agent's skills folder).
name
kotlin-tooling-immutable-collections-0-5-x-migration
description
Migrate Kotlin (and Java) code from kotlinx.collections.immutable 0.3.x / 0.4.x to the latest 0.5.x. The 0.5.x line renames every copy-returning method on PersistentList / PersistentMap / PersistentSet / PersistentCollection to a participial form per KEEP-0459 (add→adding, removeAt→removingAt, set→replacingAt, put→putting, clear→cleared, …) and deprecates the old names (WARNING, with ReplaceWith). Driven by the compiler: bump the version, recompile, and apply the rename each deprecation warning names. Use when the user mentions kotlinx.collections.immutable 0.5.x, PersistentList migration, "Use adding() instead", KEEP-0459, or sees deprecation warnings from kotlinx.collections.immutable.
license
Apache-2.0
metadata.author
JetBrains
metadata.version
2.4.0

kotlinx.collections.immutable 0.5.x Migration

The 0.5.x line renames every copy-returning method on the persistent collections to a participial form (per KEEP-0459) and deprecates the old names at WARNING level with a ReplaceWith hint. Migrating is a mechanical, binary-compatible, semantics-preserving call-site rename — same parameters, order, and return type; only the name changes.

Drive it from the compiler: bump the version, recompile, and fix each deprecation warning — the warning names the replacement. Source of truth: 0.5.0-MIGRATION.md.

When it applies

Check the version the project currently uses:

  • 0.3.x or 0.4.x (any pre-0.5.0) → run the migration below.
  • On 0.5.x but not the latest → set the version to the latest 0.5.x and stop. All 0.5.x releases share the same renames, so a within-line bump adds no new deprecations and needs no recompile.
  • On the latest 0.5.x, or on 0.6.x and later → nothing to do.

Migration

1. Find the build command

Check README.md, CLAUDE.md, or AGENTS.md for how the project builds; if it isn't written down, infer it from the build files — Gradle (./gradlew), Maven (mvn, or the ./mvnw wrapper), Bazel (a bazel wrapper), or a custom script. Record the compile command (and the test command). In a multi-module project you only need the modules that use the library, plus any you change — not a whole-repo build.

2. Baseline compile

Compile on the current version and confirm it's green. If it doesn't build now, you can't tell post-migration errors from pre-existing ones — get a working compile command first.

3. Bump to the latest 0.5.x

Find where the version is pinned — grep -rn kotlinx-collections-immutable across the build files finds it (version catalog, build script, gradle.properties, pom.xml, …) — and set it to the latest 0.5.x on Maven Central (a -beta is fine). If the build pins artifact hashes (e.g. gradle/verification-metadata.xml), update those too — the cheapest fix is to copy the new artifact's checksum straight from the dependency-verification failure message and add just that one entry, rather than regenerating the whole metadata file. The bump is binary-compatible; old code keeps compiling with warnings. (If the dependency fails to resolve with a Kotlin metadata-version error, the project's Kotlin is too old for the 0.5.x artifact — bump Kotlin first.)

4. Recompile and fix the warnings

Recompile. Each renamed method carries @Deprecated(WARNING, ReplaceWith(...)), so the compiler emits one warning per call site naming the replacement (e.g. "Use removingAll() instead"). Apply that rename. Repeat compile → fix until no kotlinx.collections.immutable deprecation warnings remain. (For multiplatform, one target compile surfaces the shared call sites. Pre-existing factory deprecations such as immutableListOf → persistentListOf appear the same way — apply those too.) A recompile that fails right after the bump is failing on these deprecations (plus, if hashes are pinned, a one-time dependency-verification error) — keep applying the renames the warnings name; don't re-run dependency-resolution or metadata-regeneration commands to try to clear it.

Trust the compiler — never find/replace by name. The same method names exist on MutableList / MutableMap / MutableSet and on the .Builder types, which mutate in place and are not deprecated. Only the sites the compiler flags (receiver statically Persistent*) get renamed; if it didn't flag it, leave it.

An Unresolved reference after a rename means the participial name isn't on that receiver — you've split a rename. A rename only compiles if the declaration and every call site move together. The library already did that for the kotlinx types, so renaming their call sites just works — but it doesn't hold for anything else that merely shares the names. When a renamed call won't resolve, there are two cases:

  • The receiver is unrelated to this library (a Mutable*, a .Builder, a same-named method on some other type) — the rename was wrong; revert that site.
  • The receiver is a project type the codebase is itself migrating — it implements a Persistent*, or it's the project's own wrapper whose methods echo these names and get renamed to match. The rename is right but half-done: rename the declaration and its other callers too, so the call resolves. (Deprecated overrides on an implementer are step 5.)

Decide by the receiver's declared type, never the method name — a Persistent*-named field may hold another type. This matters most when you can't lean on a fast recompile and are renaming from reading the source.

Java callers. The recompile flags them only if the build reports javac deprecation warnings (-Xlint:deprecation, usually off). If it doesn't, grep the .java files that import the library for the old names and rename the calls whose receiver is a Persistent* type.

After the renames, the compiler may report some @Suppress("DEPRECATION") as having no effect — remove those (re-read the region first, in case it still covers something else).

Show full SKILL.md (300 more words)Show less
5. Custom implementers

If the project has classes that implement PersistentList / PersistentMap / PersistentSet / PersistentCollection, their deprecated overrides need migrating too. Find them:

bash
grep -rnE --include='*.kt' \
  '(class|object|interface)\s+\w[^:]*:\s*[^{]*\b(PersistentList|PersistentMap|PersistentSet|PersistentCollection)\s*<' .

On Windows PowerShell, Select-String is the grep equivalent:

powershell
Get-ChildItem -Recurse -Filter *.kt |
  Select-String '(class|object|interface)\s+\w[^:]*:\s*[^{]*\b(PersistentList|PersistentMap|PersistentSet|PersistentCollection)\s*<'

(Confirm a match really lists the interface as a supertype, not just a field type or type argument.) For each, move the implementation into the new participial method and have the deprecated override delegate to it:

kotlin
override fun adding(element: E): MyList<E> = /* real implementation */

@Suppress("OVERRIDE_DEPRECATION")
override fun add(element: E): MyList<E> = adding(element)

If the participial methods call each other, route those calls through participial siblings, not the deprecated names. (Add "DEPRECATION" to the suppress only when an override body itself still calls a deprecated member.) Doing this now matters: at 0.6.0 the old names become compile errors, and at 0.7.0 they are removed. See 0.5.0-MIGRATION.md for the upstream implementer guidance.

6. Run any documented follow-up steps

Do this after the renames compile clean, so that if you run low on time the call-site work is already done. Some projects document steps to run after a dependency change that the compiler won't surface — most commonly regenerating dependency-verification metadata (the gradle/verification-metadata.xml hashes from step 3). Usually the single-entry fix from step 3 is all you need; only fall back to the project's documented full-regeneration procedure (in README.md / CONTRIBUTING.md / CLAUDE.md / AGENTS.md) if that one entry isn't enough. Run it once — a full --write-verification-metadata / "resolve all dependencies" pass re-resolves the entire graph and is slow, and repeating it rarely changes the outcome. Then re-confirm the build is clean.

Rename reference

  • PersistentCollection — add→adding, addAll→addingAll, remove→removing, removeAll→removingAll, retainAll→retainingAll, clear→cleared
  • PersistentList (the above, plus) — add(i, e)→addingAt, addAll(i, c)→addingAllAt, set(i, e)→replacingAt, removeAt→removingAt
  • PersistentMap — put→putting, putAll→puttingAll, remove(k)→removing, remove(k, v)→removing, clear→cleared

Builders (PersistentList.Builder, etc.) are not renamed — they mutate in place, so their imperative names stay.

© Kotlin, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/kotlin-tooling-immutable-collections-0-5-x-migration of Kotlin/kotlin-agent-skills.

Open the folder on GitHubat commit c2f9069

Compare with similar skills

Kotlin Tooling Immutable Collections 0 5 X Migration next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Kotlin Tooling Immutable Collections 0 5 X Migration compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Kotlin Tooling Immutable Collections 0 5 X Migration this skillKotlin/kotlin-agent-skills1.1k—~2.3kAutomated safety check: PassApache-2.0
Jugg Android Dev Loopniki914/zafiro241—~2kAutomated safety check: PassMIT
Android Audio E2Ehyochan/react-native-nitro-sound961—~814Automated safety check: PassMIT
Harmonica DevKenjiOhtsuka/harmonica131—~742Automated safety check: PassMIT
Apc BuildJoker-x-dev/AndroidProject-Compose102—~553Automated safety check: PassNone
Neo4j Driver Java Skillneo4j-contrib/neo4j-skills114—~4.2kAutomated safety check: NotesMIT

Similar skills

  • Jugg Android Dev Loop

    niki914/zafiro

    A skill your agent uses when editing source files (Java/Kotlin/XML/layout/AndroidManifest/Gradle) in a Android project, or when user asks to build/deploy/verify an Android app.

    241 GitHub stars~2k tokensUpdated today
    MobileAuto-check passed
  • Android Audio E2E

    hyochan/react-native-nitro-sound

    Build and run device-backed Android end-to-end checks for react-native-nitro-sound permissions, recording, playback, listeners, pause/resume, seek, speed, audio focus, lifecycle behavior, and rapid…

    961 GitHub stars~814 tokensUpdated 11 days ago
    MobileAuto-check passed
  • Harmonica Dev

    KenjiOhtsuka/harmonica

    A skill your agent uses when working on the Harmonica Kotlin DB migration tool — planning, phase work, PRs, or anything touching this repo.

    131 GitHub stars~742 tokensUpdated 19 days ago
    MobileAuto-check passed
  • Apc Build

    Joker-x-dev/AndroidProject-Compose

    管理 AndroidProject-Compose 的 Gradle、版本目录、SDK、BuildConfig、构建类型、ABI、签名、混淆、应用资源和 APK/AAB 发布流程。用户要求升级依赖、修改构建配置、替换图标或启动页、配置签名、排查构建失败、缩减包体或生成发布包时使用。

    102 GitHub stars~553 tokensUpdated 24 days ago
    MobileAuto-check passed
  • Neo4j Driver Java Skill

    neo4j-contrib/neo4j-skills

    Neo4j Java Driver v6 — driver lifecycle, Maven/Gradle setup, executableQuery, executeRead/Write managed transactions, explicit transactions, async/reactive patterns, error handling, data type…

    114 GitHub stars~4.2k tokensUpdated yesterday
    MobileAuto-check: notes
  • Sentry Android SDK

    getsentry/sentry-for-ai

    Official

    Full Sentry SDK setup for Android. An agent skill from getsentry/sentry-for-ai.

    268 GitHub stars~7.7k tokensUpdated yesterday
    MobileAuto-check passed

More from Kotlin/kotlin-agent-skills

  • Kotlin Tooling Native Build Performance

    Kotlin/kotlin-agent-skills

    Diagnoses and fixes slow Kotlin/Native compilation and linking in Kotlin Multiplatform projects that target iOS.

    1.1k GitHub stars~2k tokensUpdated 3 days ago
    Auto-check passed
  • Load when porting, converting, or reimplementing a single Gradle plugin as a Kotlin Toolchain local plugin, or when mapping Gradle plugin concepts (Task, Extension, project.version, dependsOn, -P…

    1.1k GitHub stars~3.2k tokensUpdated 3 days ago
    Auto-check passed
  • Kotlin Tooling Kotlin Toolchain

    Kotlin/kotlin-agent-skills

    Load when building, running, testing, packaging, linting, or configuring a Kotlin/Java project with the Kotlin Toolchain (JetBrains' unified CLI, formerly Amper), when scaffolding a new or…

    1.1k GitHub stars~2.4k tokensUpdated 3 days ago
    Auto-check passed
  • Load when authoring, writing, or designing a Kotlin Toolchain local plugin to extend the declarative build with code generation, build-time processing, custom verification, or packaging that…

    1.1k GitHub stars~2.3k tokensUpdated 3 days ago
    Auto-check passed
  • Load when migrating or converting an entire Gradle Kotlin project (build.gradle(.kts), wrapper, libs.versions.toml, buildSrc) to the Kotlin Toolchain, including rewriting CI and replacing Gradle…

    1.1k GitHub stars~6k tokensUpdated 3 days ago
    Auto-check passed

Categories

Questions about Kotlin Tooling Immutable Collections 0 5 X Migration

What does Kotlin Tooling Immutable Collections 0 5 X Migration do?

Migrate Kotlin (and Java) code from kotlinx.collections.immutable 0.3.x / 0.4.x to the latest 0.5.x. Kotlin Tooling Immutable Collections 0 5 X Migration is an agent skill from Kotlin/kotlin-agent-skills.x.

When should I use Kotlin Tooling Immutable Collections 0 5 X Migration?

Kotlin Tooling Immutable Collections 0 5 X Migration fits situations like: the user mentions kotlinx.collections.immutable 0.5.x; persistentList migration; use adding() instead; sees deprecation warnings from kotlinx.collections.immutable.

How do I install Kotlin Tooling Immutable Collections 0 5 X Migration in Claude Code?

Run `npx skills add Kotlin/kotlin-agent-skills --skill kotlin-tooling-immutable-collections-0-5-x-migration -a claude-code`. Or copy the skill folder (skills/kotlin-tooling-immutable-collections-0-5-x-migration in Kotlin/kotlin-agent-skills) into .claude/skills/kotlin-tooling-immutable-collections-0-5-x-migration in your project. Claude Code loads it when a task matches its description.

How do I install Kotlin Tooling Immutable Collections 0 5 X Migration in Codex?

Run `npx skills add Kotlin/kotlin-agent-skills --skill kotlin-tooling-immutable-collections-0-5-x-migration -a codex`. Or copy the skill folder (skills/kotlin-tooling-immutable-collections-0-5-x-migration in Kotlin/kotlin-agent-skills) into .agents/skills/kotlin-tooling-immutable-collections-0-5-x-migration in your project. Codex loads it when a task matches its description.

Can I use Kotlin Tooling Immutable Collections 0 5 X Migration in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Kotlin/kotlin-agent-skills --skill kotlin-tooling-immutable-collections-0-5-x-migration -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/kotlin-tooling-immutable-collections-0-5-x-migration, .gemini/skills/kotlin-tooling-immutable-collections-0-5-x-migration, .github/skills/kotlin-tooling-immutable-collections-0-5-x-migration and .opencode/skills/kotlin-tooling-immutable-collections-0-5-x-migration in your project.

What does Kotlin Tooling Immutable Collections 0 5 X Migration need to run?

SKILL.md names no scripts, command-line tools or credentials: Kotlin Tooling Immutable Collections 0 5 X Migration is instructions for the agent only.

Does Kotlin Tooling Immutable Collections 0 5 X Migration access the network?

SKILL.md names 2 domains. As links in the text: github.com and central.sonatype.com. This is read from the text; nothing was executed.

Is Kotlin Tooling Immutable Collections 0 5 X Migration safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Kotlin Tooling Immutable Collections 0 5 X Migration use?

Kotlin Tooling Immutable Collections 0 5 X Migration is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Kotlin Tooling Immutable Collections 0 5 X Migration use?

About 2.3k tokens (SKILL.md is roughly 9.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Kotlin Tooling Immutable Collections 0 5 X Migration?

Skills that share tags, products or a category with Kotlin Tooling Immutable Collections 0 5 X Migration: Jugg Android Dev Loop (niki914/zafiro, 241 stars), Android Audio E2E (hyochan/react-native-nitro-sound, 961 stars), Harmonica Dev (KenjiOhtsuka/harmonica, 131 stars) and Apc Build (Joker-x-dev/AndroidProject-Compose, 102 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Kotlin Tooling Immutable Collections 0 5 X Migration?

Kotlin (a GitHub organization) maintains it in Kotlin/kotlin-agent-skills, which has 1,072 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on October 8, 2026.

Source: Kotlin/kotlin-agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.