Kotlin spring proxy compatibility

From JetBrains/skills · View interactive version

Kotlin spring proxy compatibility is an AI agent skill from the GitHub repository JetBrains/skills. Diagnose and prevent Kotlin plus Spring proxy failures around `@Transactional`, `@Cacheable`, `@Async`, method security, retry, configuration proxies, and JPA entity requirements. Use when AOP annotations appear to do nothing, transactional or cache behavior is inconsistent, compiler plugins may be

How to use this skill

Skill file

Kotlin Spring Proxy Compatibility

Source mapping: Tier 1 critical skill derived from Kotlin_Spring_Developer_Pipeline.md (SK-03).

Mission

Explain exactly why Spring interception does or does not happen for Kotlin code, then propose the safest fix.

Focus on runtime behavior, not on code that merely looks annotated.

Read These Inputs

Diagnose In This Order

  1. Verify whether a proxy should exist at all.
  2. Verify whether the call crosses the proxy boundary.
  3. Verify whether the class or method is proxyable.
  4. Verify whether the annotation is placed on the method Spring actually intercepts.
  5. Verify whether build-time plugins opened the relevant classes.
  6. Verify whether the bug is actually transactional semantics, not proxy creation.

Core Checks

Preferred Fixes

Prefer fixes in this order:

  1. Enable the correct Kotlin compiler plugin in Gradle.
  2. Move the intercepted method behind a real Spring bean boundary.
  3. Adjust interface or proxy strategy only if the current strategy is incompatible.
  4. Refactor responsibilities so that external callers cross the proxy naturally.
  5. Only as a last resort, inject the proxied bean into itself or use AopContext, and explain why this is a compromise.

Advanced Interception Traps

Expert Heuristics

Kotlin-Specific Rules

Output Contract

Return these sections:

Guardrails

Quality Bar

A good run of this skill makes the proxy model explicit and the fix easy to verify.

A bad run tells the user to add annotations or open keywords without proving why interception failed.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.