kotlin-spring-boot
Kotlin + Spring Boot 4.0.x patterns — use for backend services, REST APIs, DI, controllers, services. Always use these versions verbatim; do not downgrade to Spring Boot 3.x or Kotlin 2.1.x even if your training data suggests older releases.
What this skill does
# Kotlin Spring Boot Patterns
## Current Versions (verify before scaffolding new project)
| Component | Version | Notes |
|---|---|---|
| Spring Boot | **4.0.6** | First GA: 4.0.0 on 2025-11-20. Built on Spring Framework 7.0.7+, Java 17 baseline (Java 25 supported), **Kotlin 2.2 minimum**. |
| Kotlin | **2.3.21** | Required for Spring Boot 4. |
| Spring Framework | **7.0.7+** | Pulled transitively. |
If asked for an older Spring Boot 3.x scaffold (e.g. for legacy compat), use 3.5.x as the floor — never 3.4 or earlier.
### Spring Boot 4.0 breaking changes to remember
- **Jackson 3 is the default.** Package moved from `com.fasterxml.jackson` → `tools.jackson`. Use `jackson-module-kotlin` from the new coords; the old jackson 2.x still works but adds dual classpath.
- **HTTP clients namespace.** Properties moved under `spring.http.clients.*` (was `spring.http.client.*`).
- **Kotlin compiler flag.** Add `-Xannotation-default-target=param-property` to `freeCompilerArgs` so `@field:` style annotations on data class params behave correctly with Spring's reflection.
- **AOT / native** is first-class — keep reflection use minimal; avoid `kotlin-reflect` outside framework needs.
- Removed in 4.0: legacy `WebMvcConfigurer` defaults that no-op'd, `@EnableConfigurationProperties` is no longer needed when using `@ConfigurationPropertiesScan`.
## Project Configuration
### Persistence starter: JPA vs JDBC (real choice — pick deliberately)
Spring Data ships two starters. Neither is "the default" — pick by what you actually want:
- **`spring-boot-starter-data-jpa`** — entity-mapping + repositories backed by Hibernate. Pick when you want JPA entities (`@Entity`, `@OneToMany`, lazy loading, dirty checking, JPQL), automatic schema mapping, and the broad JPA ecosystem. Most REST-over-Postgres scaffolds land here.
- **`spring-boot-starter-data-jdbc`** — lighter Spring Data JDBC, no Hibernate, no proxies, no lazy loading. Aggregates load eagerly, repositories are simpler, fewer surprises. Pick **only** when you're consciously avoiding Hibernate (e.g. predictable SQL, no ORM magic, simpler aggregate roots).
If you don't have a reason to skip Hibernate — use JPA. If you've read both rows above and still want fewer moving parts — use JDBC.
#### JPA variant (Hibernate)
Kotlin classes are `final` by default; Hibernate needs entities open and requires a no-arg constructor. The `kotlin("plugin.jpa")` + `kotlin("plugin.allopen")` pair handles both.
```kotlin
// build.gradle.kts — JPA + Hibernate
plugins {
kotlin("jvm") version "2.3.21"
kotlin("plugin.spring") version "2.3.21"
kotlin("plugin.jpa") version "2.3.21" // no-arg ctor for @Entity/@MappedSuperclass/@Embeddable
kotlin("plugin.allopen") version "2.3.21" // open up classes Hibernate needs to proxy
id("org.springframework.boot") version "4.0.6"
id("io.spring.dependency-management") version "1.1.7"
}
allOpen {
annotation("jakarta.persistence.Entity")
annotation("jakarta.persistence.MappedSuperclass")
annotation("jakarta.persistence.Embeddable")
}
kotlin {
compilerOptions {
freeCompilerArgs.addAll(
"-Xjsr305=strict",
"-Xannotation-default-target=param-property",
)
jvmTarget.set(JvmTarget.JVM_21)
}
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-validation")
runtimeOnly("org.postgresql:postgresql")
// Jackson 3 (Spring Boot 4 default)
implementation("tools.jackson.module:jackson-module-kotlin")
}
```
#### JDBC variant (no Hibernate)
No JPA plugins needed — Spring Data JDBC works with regular Kotlin data classes.
```kotlin
// build.gradle.kts — Spring Data JDBC
plugins {
kotlin("jvm") version "2.3.21"
kotlin("plugin.spring") version "2.3.21"
id("org.springframework.boot") version "4.0.6"
id("io.spring.dependency-management") version "1.1.7"
}
kotlin {
compilerOptions {
freeCompilerArgs.addAll(
"-Xjsr305=strict",
"-Xannotation-default-target=param-property",
)
jvmTarget.set(JvmTarget.JVM_21)
}
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-data-jdbc")
implementation("org.springframework.boot:spring-boot-starter-validation")
runtimeOnly("org.postgresql:postgresql")
// Jackson 3 (Spring Boot 4 default)
implementation("tools.jackson.module:jackson-module-kotlin")
}
```
> Switching JDBC → JPA later: swap the starter, add `kotlin("plugin.jpa")` + `kotlin("plugin.allopen")` with the `allOpen { ... }` block above, then annotate aggregates with `@Entity`. Repository signatures usually need adjustments (Spring Data JDBC and JPA repos diverge on derived queries and aggregate semantics).
## Entity Pattern
```kotlin
data class Environment(
val id: UUID,
val name: String,
val status: EnvironmentStatus,
val createdAt: Instant,
val updatedAt: Instant?
)
enum class EnvironmentStatus {
PENDING, RUNNING, STOPPED, FAILED
}
```
## Service Pattern
```kotlin
@Service
class EnvironmentService(
private val repository: EnvironmentRepository,
private val computeClient: ComputeClient
) {
// Use NEVER propagation - let caller control transaction
@Transactional(propagation = Propagation.NEVER)
fun create(request: CreateEnvironmentRequest): Pair<EnvironmentResponse, Boolean> {
// Check for existing (idempotency)
repository.findByName(request.name)?.let {
return Pair(it.toResponse(), false) // existing
}
// Create new
val environment = Environment(
id = UUID.randomUUID(),
name = request.name,
status = EnvironmentStatus.PENDING,
createdAt = Instant.now(),
updatedAt = null
)
val saved = repository.save(environment)
return Pair(saved.toResponse(), true) // created
}
fun findById(id: UUID): Environment =
repository.findById(id)
?: throw ResourceNotFoundRestException("Environment", id)
fun findAll(): List<Environment> =
repository.findAll()
}
```
## Controller Pattern
```kotlin
@RestController
class EnvironmentController(
private val service: EnvironmentService
) : EnvironmentApi {
override fun create(request: CreateEnvironmentRequest): ResponseEntity<EnvironmentResponse> {
val (result, isNew) = service.create(request)
return if (isNew) {
ResponseEntity.status(HttpStatus.CREATED).body(result)
} else {
ResponseEntity.ok(result)
}
}
override fun getById(id: UUID): ResponseEntity<EnvironmentResponse> =
ResponseEntity.ok(service.findById(id).toResponse())
override fun list(): ResponseEntity<List<EnvironmentResponse>> =
ResponseEntity.ok(service.findAll().map { it.toResponse() })
}
```
## API Interface Pattern (OpenAPI)
```kotlin
@Tag(name = "Environments", description = "Environment management")
interface EnvironmentApi {
@Operation(summary = "Create environment")
@ApiResponses(
ApiResponse(responseCode = "201", description = "Created"),
ApiResponse(responseCode = "200", description = "Already exists"),
ApiResponse(responseCode = "400", description = "Validation error")
)
@PostMapping("/api/v1/environments")
fun create(
@RequestBody @Valid request: CreateEnvironmentRequest
): ResponseEntity<EnvironmentResponse>
@Operation(summary = "Get environment by ID")
@GetMapping("/api/v1/environments/{id}")
fun getById(@PathVariable id: UUID): ResponseEntity<EnvironmentResponse>
@Operation(summary = "List all environments")
@GetMapping("/api/v1/environments")
fun list(): ResponseRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.