Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

split-jvm-nonjvm

Skill by JetBrains

Splits a class in commonMain into JVM and non-JVM parts in jvmCommonMain and nonJvmCommonMain. It is used to add JVM-specific functionality to classes on JVM targets such as Kotlin/JVM, Java backends and Android.

  • Score 87
  • 4.7k stars
  • Apache-2.0
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install split-jvm-nonjvm

Built from the published package, never by AI.

git clone --depth 1 https://github.com/JetBrains/koog /tmp/koog && mkdir -p ~/.claude/skills && cp -r /tmp/koog/.claude/skills/split-jvm-nonjvm ~/.claude/skills/split-jvm-nonjvm

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install split-jvm-nonjvm in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

The split-jvm-nonjvm skill splits a class, or several classes, in the commonMain source set of a Kotlin Multiplatform project into a JVM part and a non-JVM part. The JVM part goes to jvmCommonMain and the non-JVM part goes to nonJvmCommonMain. It is used to provide JVM-specific functionality for a class on JVM targets such as Kotlin/JVM, a Java backend or Android.

The skill creates an API interface with the public symbols, an Impl class with the implementation logic, and an expect class in commonMain. It then adds actual classes in each source set that delegate to the implementation. It also covers moving tests and compiling the result with Gradle. It is intended for Kotlin developers working on multiplatform code.

Written from the project's SKILL.md and checked against it.

What it can do

  • Split a classSeparates a commonMain class into an API interface, an Impl class and an expect class.
  • Create actual classesAdds actual classes in jvmCommonMain and nonJvmCommonMain that delegate to the implementation.
  • Add JVM-only APILets the actual classes expose extra public symbols that use JVM-specific APIs, with KDoc.
  • Handle testsKeeps common tests using the Impl class and places platform tests in jvmCommonTest or nonJvmCommonTest.
  • Verify compilationRuns the Gradle compile tasks for JVM and JS to check that the split works.

What you need

  • A Kotlin Multiplatform module with jvmCommonMain and nonJvmCommonMain source sets
  • Gradle, with the source sets declared in the convention plugin
  • The compileKotlinJvm and compileKotlinJs Gradle tasks

Try asking

  • Split MyClass in commonMain into JVM and non-JVM parts.
  • Add a JVM-only getEnv method to my split class using System.getenv.
  • Check that my split class compiles with the JVM and JS Gradle tasks.

Good to know

  • Classes with annotations or companion objects need the user to decide how to handle them first.
  • Java tests must go in jvmTest, not jvmCommonTest.
  • IntelliJ may show false expect and actual errors, so the Gradle compile tasks are the reliable check.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: .claude/skills/split-jvm-nonjvm/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md8 KB

Alternatives to split-jvm-nonjvm

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

split-jvm-nonjvm: common questions

Where do the split files go?

The expect class replaces the original file in commonMain, along with the API interface and Impl class. The actual classes go in jvmCommonMain and nonJvmCommonMain.

What if my class has annotations or a companion object?

The skill says classes being split should not have them. If the original class has one, the assistant should ask the user how to handle it before proceeding.

How do I know the split is working?

Run the Gradle compile tasks compileKotlinJvm and compileKotlinJs. The source says these are the only reliable verification.

How do I install split-jvm-nonjvm?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is split-jvm-nonjvm free?

The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.

Is split-jvm-nonjvm safe to use?

It scores 87 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to split-jvm-nonjvm?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

split-jvm-nonjvm Install

Add to stack

Loading.