Skip to content

Add Kotlin Toolchain skills - #56

Open
singleton11 wants to merge 4 commits into
mainfrom
add-kotlin-toolchain-skills
Open

Add Kotlin Toolchain skills#56
singleton11 wants to merge 4 commits into
mainfrom
add-kotlin-toolchain-skills

Conversation

@singleton11

@singleton11 singleton11 commented Aug 18, 2026

Copy link
Copy Markdown

Adds four new skills covering the Kotlin Toolchain:

  • kotlin-tooling-kotlin-toolchain — building, running, testing, packaging, linting, and configuring Kotlin/Java projects with the Kotlin Toolchain.
  • kotlin-tooling-kotlin-toolchain-plugin-authoring — authoring local Kotlin Toolchain plugins.
  • kotlin-tooling-gradle-to-kotlin-toolchain-plugin — porting a single Gradle plugin to a Kotlin Toolchain local plugin.
  • kotlin-tooling-gradle-to-kotlin-toolchain-project — migrating an entire Gradle Kotlin/JVM project to the Kotlin Toolchain.

@singleton11
singleton11 marked this pull request as ready for review August 18, 2026 13:26
@singleton11

Copy link
Copy Markdown
Author

eval info:

there was only one data point in dataset with the following prompt:

"Create a Kotlin project with Android and iOS platforms"

skill tested: kotlin-tooling-kotlin-toolchain

10 trials with 2 models (10 trials each): Claude Opus 5 and Claude Sonnet 5

harness: Claude Code (via harbor)

Graders were deterministic:

  • The project is built with Kotlin Toolchain, not Gradle or Maven: no build.gradle, build.gradle.kts, settings.gradle, settings.gradle.kts, or pom.xml exists anywhere in the workspace
  • At least one module.yaml (or a project.yaml) is present, marking this as a Kotlin Toolchain project
  • The project has three modules: a shared non-application module, an android/app module, and an ios/app module
  • At least one module declares the iOS targets, i.e. one of iosArm64, iosSimulatorArm64, or iosX64
  • The Android application builds successfully and produces an .apk file
  • The shared module has a test in its common test source set that passes when run via kotlin test
  • A @composable function defined in the shared module's common code is invoked from both the Android and the iOS app entry points,
  • The annotation @org.jetbrains.compose.reload.DevelopmentEntryPoint is present in the project's Kotlin sources

the result:

without skill agents created a Gradle project and there were 7-9 Gradle calls
with skill agents created Kotlin Toolchain projects (via kotlin init) with approximately the same amount of kotlin calls
Docker image was clean without kotlin installed, because of skill agents figured out themselves how to install kotlin toolchain

the example of tokens amount for Opus 5
Mean values:
Total Tokens with Gradle: 2 493 322
Total tokens with Kotlin Toolchain: 764 503

Significantly less tokens and the cost

Experiment has been conducted only for project initialization, but the dataset will be expanded in future

proxies into them, pinning the project to the wrapper's version. Always invoke `kotlin` from the project
root so the wrapper wins; never call a globally installed binary directly when a wrapper exists.

## CLI commands

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that the set of commands may change in the future, maybe it's better to provide a generic hint on how for the agent can get an overview of the available commands?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

```
project-root/
├── kotlin, kotlin.bat # Local wrappers
├── project.yaml # Project-level config

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this skill also contain an example for project-level config?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add that as examples in references/ to the skill

## Templates

A template extracts reusable `module.yaml` sections into a `<name>.module-template.yaml` file (same
structure as `module.yaml`) that modules pull in via an `apply:` list of relative paths. It's a general

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a convention for where templates should be located?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, there is no convention, but yeah, I'll add one sentence about it


The Toolchain ships no bundled linters — `tests` is the only built-in check. detekt, ktlint, and
API-compatibility verification must be registered as local-plugin tasks under `checks:` in `plugin.yaml`.
Invoking a linter binary directly or wiring in a Gradle plugin bypasses the check pipeline.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use Gradle plugins in the Kotlin toolchain? 🤔

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, it's better not to mention Gradle here in order not to steer agents, which are even without anything trying to wire up Gradle with Kotlin Toolchain anyway, I think I'll just remove this one

user explicitly asks.

For anything the declarative YAML cannot express, use a local plugin — that is the supported escape hatch.
Toolchain cannot consume Gradle plugins: reimplement the behaviour instead of adapting one. When a

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we here reference the kotlin-tooling-gradle-to-kotlin-toolchain-plugin skill?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, sure

Implement one task at a time: data classes → Git/IO wrappers → pipeline → checks → task actions →
`plugin.yaml` wiring.

### 4. Validate against a demo module

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do toolchain plugins have testing support? If so, I think the first thing the agent should do is write tests covering the semantics of the Gradle plugin.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, not yet

version: "0.1.0"
---

# Gradle → Kotlin Toolchain Plugin Conversion

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this skill reference kotlin-tooling-kotlin-toolchain-plugin-authoring one?


# Kotlin Toolchain Plugin Authoring

Local plugins are the official escape hatch from declarative YAML: a `jvm/amper-plugin` module shipping

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amper-plugin is still valid name?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it's still valid, we haven't renamed that yet

---
name: kotlin-tooling-gradle-to-kotlin-toolchain-project
description: >
Load when migrating or converting an entire Gradle Kotlin/JVM project

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KMP project is also migratable?

Write the inventory down (e.g. `MIGRATION_PLAN.md`) before any YAML; it becomes the checklist the PR
description verifies.

- **Plugins** in the `plugins { }` block, each sorted into native / local plugin. Native covers

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it also check gradle.properties?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants