Analysis api bump
Skill aoreshkov/kotlin-lib-mcp/.claude/skills/analysis-api-bump
Bump the Kotlin version together with the version-locked Analysis API `-for-ide` artifacts and their runtime-dep pins, then verify source analysis still works. Use when upgrading Kotlin, when the Analysis API fails to resolve types after a bump, or when auditing whether the coupled pins are still correct.From its SKILL.md
npx -y skills add aoreshkov/kotlin-lib-mcp --skill analysis-api-bumpAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 8 stars8 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.3 KB, as published. Nobody here has run it
Bump Kotlin + Analysis API (version-locked)
The Analysis API (standalone K2/FIR) is the single most version-fragile part of this repo.
Kotlin and every *-for-ide artifact must share the exact same version, and two runtime
deps (caffeine, intellijCoroutines) are pinned to match what the bundled IntelliJ core
expects. Getting this wrong shows up as NoSuchMethodError / NoClassDefFoundError at
runtime or as silent loss of type resolution — never a clean compile error. Follow the steps;
do not eyeball it.
1. Snapshot the current pins
Read gradle/libs.versions.toml and record:
kotlin— the shared version ref used by all of:analysisApi-standalone,analysisApi-highLevel,analysisApi-k2,analysisApi-lowLevelFir,analysisApi-implBase,analysisApi-platform,analysisApi-symbolLightClasses,kotlin-compiler, plus thekotlin-*/composeCompiler-*plugin artifacts.caffeine(comment: "runtime dep of the Analysis API-for-idejars; matches Kotlin's own pin").intellijCoroutines(comment: "JetBrains coroutines fork the bundled IJ core expects (KT-81457)").compose(comment: "aligned to Kotlin X.Y.Z") — Compose is Kotlin-coupled too.
Because every Analysis-API artifact uses version.ref = "kotlin", bumping the single
kotlin entry moves them all. The risk is not forgetting one artifact — it's the three
coupled satellites (caffeine, intellijCoroutines, compose) and undocumented API breaks.
2. Confirm the target and its coupled expectations (official sources)
For $ARGUMENTS (or the intended target Kotlin version), verify against official sources:
- kotlinlang.org release notes / Kotlin GitHub release: is this a stable release? Any Analysis API / standalone breaking changes called out?
- The
-for-ideartifacts exist for this version in the IntelliJ dependencies repo (https://www.jetbrains.com/intellij-repository/), not just on Maven Central. - Does the new Kotlin change the caffeine version its
-for-idejars expect? (Check the Kotlin build's own bundled version.) If so, update thecaffeinepin to match and update the comment. - Is KT-81457 fixed in this version, making the
intellijCoroutinesfork pin unnecessary? If yes, that's a chance to drop the fork; if not, keep the pin. - Compose Multiplatform ↔ Kotlin compatibility: pick the
composeversion aligned to the new Kotlin (JetBrains compatibility table) and update the# aligned to Kotlin …comment.
Delegate this research to the kotlin-currency and deps-currency subagents if a broad check
is wanted — they research official sources and respect the documented pins.
3. Apply the bump
In gradle/libs.versions.toml only (never inline versions):
- Set
kotlin = "<target>". - Update
caffeine,intellijCoroutines,composeonly if step 2 showed the constraint moved — and update their explanatory comments to reflect the new constraint.
4. Rebuild and verify source analysis actually works
A green compile is not sufficient — the Analysis API fails at runtime, not compile time.
./gradlew :core:build— compiles and runscoretests, includingSourceAnalyzertests.- Run the analyzer end-to-end on a real library so type resolution is exercised, e.g. fetch a
known library via the MCP tools (
fetch_librarythenget_api_signature/get_kdoc) and confirm signatures resolve types (not just PSI text fallback). - Watch for
NoSuchMethodError/NoClassDefFoundError/ immutable-collections shadowing — those signal a coupled-pin mismatch, not a code bug. Revisit step 2.
5. Report
Summarize: old → new Kotlin version, which coupled pins moved (and why, with the official
source), whether the intellijCoroutines fork is still needed, and the verification evidence
(test result + a resolved signature from a fetched library). Note anything that degraded to
PSI-only fallback. Do not commit unless asked.