Kotlin Compiler Plugin Skills
A Claude Code plugin shipping a single skill, kotlin-compiler-plugin, that bundles 24 reference guides covering Kotlin compiler plugin development. Use it when building K2 (FIR) frontend extensions, IR backend transformations, custom diagnostics, synthetic declarations, scripting / REPL dialects, or shipping a compiler plugin via Gradle.
Every API claim is cross-referenced against the Kotlin compiler source (2.4.x).
Installation
In Claude Code, register this repo as a plugin marketplace, then install the plugin from it:
/plugin marketplace add kitakkun/kotlin-compiler-plugin-skills
/plugin install kotlin-compiler-plugin-skills@kotlin-compiler-plugin-skills
The single kotlin-compiler-plugin skill is auto-discovered after install; list it via /plugin. Its router SKILL.md lives at skills/kotlin-compiler-plugin/SKILL.md and the per-topic guides under skills/kotlin-compiler-plugin/references/<topic>/guide.md. The router triggers on any Kotlin-compiler-plugin task and Claude reads only the references the task actually needs.
Install footprint: the full repo is copied to ~/.claude/plugins/cache/ (a few MB). Only the skill's SKILL.md is auto-loaded into Claude's context — each reference's guide.md is read on demand, and the bundled verification/ (13 working reference plugins) and evaluation/ (6 benchmark tasks) sit on disk for you to inspect locally and never enter the token budget.
To uninstall: /plugin uninstall kotlin-compiler-plugin-skills@kotlin-compiler-plugin-skills.
What's included
The plugin ships one skill at skills/kotlin-compiler-plugin/. Its references/ directory contains the 24 topic guides below.
Foundation
| Topic | When to read |
|---|
compiler-plugin-bootstrap | Scaffolding a new Kotlin compiler plugin project from scratch |
compiler-plugin-debugging | Setting up MessageCollector, IR dumps, debugger attach |
compiler-plugin-testing | Writing diagnostic / IR-box tests with the official infrastructure |
gradle-plugin-integration | Packaging via KotlinCompilerPluginSupportPlugin for distribution |
multi-version-kotlin-support | Supporting multiple Kotlin compiler versions in one plugin |
FIR (K2 frontend) extensions
| Topic | What it covers |
|---|
fir-extensions-overview | Architecture, the 17 extension points, FirSession lifecycle, how to choose |
fir-predicate-system | Declarative annotation matching DSL (annotated, parentAnnotated, etc.) |
fir-additional-checkers-extension | Emit custom compile-time diagnostics (warnings/errors) on user code |
fir-declaration-generation-extension | Synthesise classes/functions/properties/constructors visible to source |
fir-supertype-generation-extension | Inject supertypes (interfaces, base classes) onto existing classes |
fir-status-transformer-extension | Modify modifiers on existing declarations (visibility, modality, inline, etc.) |
fir-expression-resolution-extension | Inject implicit extension receivers into call resolution |
fir-session-components | Share computed state across FIR extensions |
fir-type-attribute-extension | Attach plugin-defined attributes to types (e.g. @Positive Int) so they participate in inference and metadata |
fir-sam-conversion-transformer-extension | Customise SAM conversion — e.g. promote first parameter to a receiver (sam-with-receiver pattern) |
fir-assign-expression-alterer-extension | Rewrite property assignments to an arbitrary statement (e.g. x = v → x.assign(v) — the pattern Gradle build scripts use via the JetBrains-maintained kotlin-assignment plugin) |
fir-function-type-kind-extension | Declare new function-type families (e.g. @Composable () -> Unit) |
fir-function-call-refinement-extension | Refine a call's return type at the call site by generating local declarations (data-frame schema-inference pattern, advanced/unstable) |
fir-scripting-extensions | Define a .kts-style script dialect — FirScriptConfiguratorExtension, FirScriptResolutionConfigurationExtension, Fir2IrScriptConfiguratorExtension |
fir-repl-snippet-extensions | Implement a REPL / Jupyter-style dialect with cross-snippet visibility — FirReplSnippetConfiguratorExtension, FirReplSnippetResolveExtension, Fir2IrReplSnippetConfiguratorExtension, FirReplHistoryProvider |
IR (backend) transformations
| Topic | What it covers |
|---|
ir-plugincontext-usage | Symbol lookup, diagnostic reporting, and metadata registration — the foundation API for any IR extension |
ir-call-rewriting | Replace function calls in user code with calls to a different function |
ir-body-modification | Modify existing function bodies, including filling in stubs declared by FIR |
ir-synthetic-class-generation | Synthesise new IR classes — typically the IR-side counterpart of FIR-generated declarations |