kotlin-spring-proxy-compatibility

Diagnose Spring proxy interception failures in Kotlin applications.

14|1|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/yalishevant/kotlin-backend-agent-skills --skill kotlin-spring-proxy-compatibility-yalishevant
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-spring-proxy-compatibility
Source: https://github.com/yalishevant/kotlin-backend-agent-skills/tree/main/.agents/skills/kotlin-spring-proxy-compatibility
Command: npx skills add https://github.com/yalishevant/kotlin-backend-agent-skills --skill kotlin-spring-proxy-compatibility-yalishevant

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

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 missing, self-invocation is suspected, or Kotlin final-by-default semantics may break Spring behavior.

Core Features & Use Cases

  • Analyze whether a proxy should exist and whether the call crosses the proxy boundary.
  • Check Kotlin compiler plugins (kotlin("plugin.spring"), kotlin("plugin.jpa")) and Open configuration to confirm interception.
  • Provide concrete fixes and safe design recommendations to restore proxy behavior in Kotlin Spring apps.

Quick Start

Identify the root cause of a proxy interception issue by guiding a diagnostic pass on a Kotlin Spring service using transactional or caching annotations.

Frequently Asked Questions about kotlin-spring-proxy-compatibility

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does @Transactional not work in my Kotlin Spring application?

@Transactional fails in Kotlin Spring applications when proxy interception breaks due to final-by-default class semantics or missing kotlin("plugin.spring") compiler plugin. Spring AOP proxying requires open classes and non-final methods to generate interceptable proxies for transactional, cacheable, and async annotations.

How do I diagnose Spring AOP proxy issues in Kotlin?

Diagnose Spring AOP proxy issues in Kotlin by analyzing proxy types, bean boundaries, and compiler plugin configuration. Check whether the proxy should exist, verify the call crosses the proxy boundary, and confirm kotlin("plugin.spring") and kotlin("plugin.jpa") plugins are enabled to restore interception.

Do I need the kotlin-spring compiler plugin for @Cacheable and @Async annotations?

Yes, the kotlin("plugin.spring") compiler plugin is required for @Cacheable and @Async annotations in Kotlin. It opens classes and methods that are final by default in Kotlin, allowing Spring to create the CGLIB proxies necessary for AOP interception to execute as expected.

What causes Spring proxy interception to fail with self-invocation in Kotlin?

Spring proxy interception fails with self-invocation in Kotlin because internal method calls bypass the proxy boundary and call the target directly. When a method annotated with @Transactional or @Retryable calls another annotated method within the same class, the interceptor does not execute.

Can I use Spring method security and retry annotations with Kotlin final classes?

Spring method security and retry annotations cannot intercept Kotlin final classes without the kotlin("plugin.spring") compiler plugin. Kotlin's final-by-default semantics prevent Spring from subclassing the target to generate proxies, breaking configuration proxies and method security interception.

Best way to fix inconsistent @Cacheable behavior in a Kotlin Spring service?

Fix inconsistent @Cacheable behavior in a Kotlin Spring service by verifying the correct proxy strategy and confirming kotlin("plugin.spring") is applied. Ensure the cache call crosses the proxy boundary and check Open configuration to validate that interceptors execute as expected across runtime contexts.