agentleFS
KotlinKotlin/kotlinx-rpc/.claude/skills/verify-compiler-plugin-compatibility/SKILL.md

verify-compiler-plugin-compatibility

Skill1.1k starsChanged 5 days agoApache-2.0View on GitHub

Verify that the kotlinx-rpc compiler plugin compiles successfully against multiple Kotlin compiler versions, and fix any incompatibilities found. Use this skill whenever the user wants to check compiler plugin compatibility across Kotlin versions, test a new Kotlin version, fix compiler plugin build failures after a Kotlin upgrade, ensure the CSM templates produce valid code for all supported versions, or test against Kotlin Master. Trigger on phrases like "verify compiler plugin", "check compatibility", "test Kotlin versions", "compiler plugin broken", "fix for Kotlin X.Y", "support new Kotlin version", or "Kotlin master".

We split this skill into the rules it gives an agent

15 rules. About 0 are common, 3 are distinctive, and 12 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 12

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read the range bounds (e.g., 2.1.22...2.3.*)

    line 42
  2. Very specific:

    Look up actual published Kotlin releases.

    line 43
  3. Very specific:

    If the range's lower bound hasn't been published yet and no published version falls within it, that range covers a future Kotlin version — …

    line 47
  4. Distinctive:

    When invoking builds through the skill, use:

    line 61
  5. Very specific:

    Use inspect_build to diagnose failures -- it gives structured access to errors, task outputs, and build problems rather than raw log …

    line 66
  6. Very specific:

    When you need to understand what a Kotlin compiler API looks like in a specific version, use the searching_dependency_sources skill to …

    line 69
  7. Distinctive:

    After testing all versions, present a summary table:

    line 88
  8. Distinctive:

    If everything passes, report success and stop.

    line 99
  9. Very specific:

    Read references/csm-fix-patterns.md for the CSM template system, fix patterns (import changes, signature changes, new VS methods, checker …

    line 123
  10. Very specific:

    After applying fixes, re-run the build (via the running_gradle_builds skill) for every version that failed.

    line 132
  11. Very specific:

    If the user requests Kotlin Master testing, or after fixing incompatibilities for released versions, read references/kotlin-master.md for …

    line 152
  12. Very specific:

    After fixing CSM templates, golden file mismatches may occur in :tests:compiler-plugin-tests.

    line 158
  13. Very specific:

    Use inspect_build from the running_gradle_builds skill to get structured error details instead of parsing raw logs.

    line 164
  14. Very specific:

    If an import section error occurs, check that the specific block has ALL needed imports for that version, not just the changed ones.

    line 169
  15. Very specific:

    When unsure about new API shape, use the searching_dependency_sources skill to search the Kotlin compiler jar for the symbol name.

    line 171

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Verify Compiler Plugin Compatibility

Systematically build the compiler plugin against each provided Kotlin compiler version, identify compilation failures, and fix them.

Input

The user provides one or more Kotlin versions to verify. If none are given, determine the set of versions to test by inspecting the CSM template version ranges in these files:

  • compiler-plugin/compiler-plugin-backend/src/main/templates/kotlinx/rpc/codegen/VersionSpecificApiImpl.kt
  • compiler-plugin/compiler-plugin-k2/src/main/templates/kotlinx/rpc/codegen/FirVersionSpecificApiImpl.kt

Extract the distinct version ranges from //##csm specific=[...] directives. For each range, pick one actually published Kotlin release that falls within it. Also include the current default from versions-root/libs.versions.toml kotlin-lang.

CSM range boundaries are NOT real Kotlin versions

CSM range lower bounds (e.g., 2.1.22, 2.1.11, 2.4.0) represent the Kotlin version that introduced an API change, but that exact version may never have been published as a stable release. Kotlin publishes specific patch versions (like 2.1.0, 2.1.20, 2.2.0, 2.2.20), not every number in sequence. Never use CSM boundary values directly as build versions — they will fail to resolve from Maven Central.

Resolving real versions for each range

For each CSM range, find the lowest published Kotlin release that falls within it:

  1. Read the range bounds (e.g., 2.1.22...2.3.*)
  2. Look up actual published Kotlin releases. Use the managing_gradle_dependencies skill to query Maven Central for available versions of org.jetbrains.kotlin:kotlin-stdlib if you are unsure which versions exist.
  3. Pick the first published version that falls within the range.
  4. If the range's lower bound hasn't been published yet and no published version falls within it, that range covers a future Kotlin version — test it via the Kotlin Master workflow (see references/kotlin-master.md), not by guessing a version number.

Kotlin publishes in a pattern: X.Y.0, then X.Y.10, X.Y.20, etc. (not sequential patches). For example, after 2.1.0 the next release was 2.1.10, then 2.1.20, then 2.1.21 — there was never a 2.1.1 through 2.1.9 or a 2.1.11 through 2.1.19.

Build Execution: Use Gradle Skills

All builds MUST go through the running_gradle_builds skill. Do not run ./gradlew directly via shell. The running_gradle_builds skill provides background orchestration, structured failure analysis via inspect_build, and reliable output capture.

When invoking builds through the skill, use:

  • projectRoot: absolute path to compiler-plugin/ directory
  • Gradle task: clean compileKotlin
  • Additional arguments: -Pkotlin.compiler=<VERSION>

Use inspect_build to diagnose failures -- it gives structured access to errors, task outputs, and build problems rather than raw log parsing.

When you need to understand what a Kotlin compiler API looks like in a specific version, use the searching_dependency_sources skill to search the Kotlin compiler jar for the class or method name. This reveals new signatures, package locations, and parameter lists.

Workflow

Phase 1: Verify Each Version

For each Kotlin version, build the compiler plugin using the running_gradle_builds skill with these arguments:

  • Tasks: clean compileKotlin
  • Extra args: -Pkotlin.compiler=<VERSION>
  • Project root: absolute path to the compiler-plugin/ directory

The -Pkotlin.compiler=<VERSION> flag overrides the Kotlin compiler version at build time. The CSM template processor reads this to select the right code blocks.

Record the result for each version: PASS or FAIL with the error summary.

After testing all versions, present a summary table:

| Version | Status | Errors |
|---------|--------|--------|
| 2.1.0   | PASS   |        |
| 2.1.20  | PASS   |        |
| 2.2.0   | FAIL   | 3 errors in FirVersionSpecificApiImpl.kt |
| 2.3.0   | FAIL   | 5 errors in VersionSpecificApiImpl.kt    |

If everything passes, report success and stop.

Phase 2: Diagnose Failures

For each failing version, use inspect_build with mode="details" to get structured error information. Categorize every compilation error:

Category A -- Import change: A class/function moved to a different package. Symptom: Unresolved reference on an import.

Category B -- Signature change: A method's parameters or return type changed. Symptom: None of the following candidates is applicable, Too many arguments.

Category C -- API replacement: An entire API was replaced by a new mechanism. Symptom: Unresolved reference on a class or method that no longer exists.

Category D -- Structural change: Property became function, List became MutableList, etc. Symptom: Val cannot be reassigned, Type mismatch.

To understand what the new API looks like, use the searching_dependency_sources skill to search the Kotlin compiler sources for the class or method name.

Phase 3: Fix Incompatibilities

Read references/csm-fix-patterns.md for the CSM template system, fix patterns (import changes, signature changes, new VS methods, checker signatures), and the template files reference table listing all CSM files that may need changes.

The key principle: default blocks hold the latest version's code; specific blocks hold older versions.

Phase 4: Re-verify

After applying fixes, re-run the build (via the running_gradle_builds skill) for every version that failed. If new errors appear, go back to Phase 2. Repeat until all versions pass.

Then present the final summary:

All versions verified successfully:
| Version | Status |
|---------|--------|
| 2.1.0   | PASS   |
| 2.1.20  | PASS   |
| 2.2.0   | PASS   |
| 2.3.0   | PASS   |

Testing with Kotlin Master

This is a mandatory test for all changes to the compiler plugin.

If the user requests Kotlin Master testing, or after fixing incompatibilities for released versions, read references/kotlin-master.md for the full download, build, and verification workflow.

Updating Golden Test Data

After fixing CSM templates, golden file mismatches may occur in :tests:compiler-plugin-tests. Read references/golden-test-data.md for the scripts/update_test_data.sh usage and important caveats about passing properties to the test JVM.

Debugging Tips

  • Use inspect_build from the running_gradle_builds skill to get structured error details instead of parsing raw logs.
  • Inspect generated CSM output in <module>/build/generated-sources/csm/ after building.
  • CSM logs matched blocks: look for [CSM] Matched specific or [CSM] Matched default in build output (use inspect_build with consoleTail=true to find these).
  • If an import section error occurs, check that the specific block has ALL needed imports for that version, not just the changed ones.
  • When unsure about new API shape, use the searching_dependency_sources skill to search the Kotlin compiler jar for the symbol name.

Download now (ZIP)

Trending

Quiet since September.about the whole repository

Dec 2025: 2 mentionsJan 2026: 1 mentionFeb 2026: 0 mentionsMar 2026: 1 mentionApr 2026: 0 mentionsMay 2026: 1 mentionJun 2026: 2 mentionsJul 2026: 2 mentionsAug 2026: 0 mentionsSep 2026: 1 mentionOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the Kotlin/kotlinx-rpc repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about Kotlin/kotlinx-rpc

The biggest 5 of 16 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 16

Talked about on GitHub (16 times).

On GitHub · 16

11 more on GitHub

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.