Use when creating, modifying, or working on Spring Boot projects. Triggers: creating a new Spring Boot application, adding REST endpoints, writing Spring services or repositories, configuring Spring Data JPA, writing validation, exception handling, configuration properties, observability (metrics, tracing, OpenAPI), enabling virtual threads, @Async / ThreadPoolTaskExecutor / TaskDecorator / executor selection, setting up NullAway and JSpecify null safety, structuring code by feature vs layer, Spring Modulith module boundaries, writing JUnit tests for Spring components, or running a Spring Boot build. Applies version-appropriate best practices (Boot 3.5.x and 4.1.x), writes JavaDocs, adds JUnit tests, and runs the build. Do NOT use for: full Spring Boot major-version migrations (use the spring-boot-4-migration skill instead), pure JPA/Hibernate code review (use hibernate-jpa-validator), broader JSpecify migration across non-Spring annotation libraries (use the jspecify skill), or reactive testing details (use project-reactor).
Ships in spring-boot. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Last verified: 2026-07 (Spring Boot 4.1 era). Facts here age. If the answer hinges on a version-sensitive fact — a Boot minor, a pinned plugin version, a JDK feature's release, a default that names a version — and time has passed since the stamp above, spot-check current release notes or the tool's own source before asserting it. When current docs disagree with this file, the docs win: say so and note the line is stale.
Before making any changes, detect the project's Spring Boot and Java versions:
pom.xml or build.gradle/build.gradle.kts for spring-boot-starter-parent (or the Spring Boot plugin) version and java.version / sourceCompatibility / targetCompatibility.| Spring Boot | Spring Framework | Jakarta EE | Java | Jackson | JUnit |
|---|---|---|---|---|---|
| 3.5.x | 6.x | 9/10 | 17, 21, 25 | 2.x | 5 (Jupiter) |
| 4.0.x | 7.x | 11 | 17, 21, 25 | 3.x | 6 |
Spring Boot 4.x (Spring Framework 7 / Jakarta EE 11) -- Java 25 recommended; virtual threads remain opt-in via spring.threads.virtual.enabled=true (recommended for new 4.x projects):
org.jspecify.annotations.*) only.version attribute on @GetMapping/@PostMapping.@Retryable and @ConcurrencyLimit from Spring Framework 7.@ConfigurationProperties: public-field binding removed -- use records or private fields with getters/setters.@MockBean/@SpyBean removed -- use @MockitoBean/@MockitoSpyBean. RestTestClient available.spring-jcl removed (Commons Logging 1.3.0 used directly).AntPathMatcher for HTTP request mappings deprecated -- use PathPattern.Spring Boot 3.5.x (Spring Framework 6.x / Jakarta EE 9/10):
org.jspecify.annotations.* (forward-compat) over org.springframework.lang.*.@MockBean/@SpyBean deprecated -- prefer @MockitoBean/@MockitoSpyBean (3.4+).spring-retry dependency.spring.threads.virtual.enabled=true.Default to Spring Boot 4.0.x and Java 25 unless the user specifies otherwise.
The model's training data has a knowledge cutoff. Actively verify APIs and configuration are current for the detected version:
mcp__claude_ai_Context7__resolve-library-id then query-docs) for up-to-date docs when the version is newer than training, or you are unsure whether an API is still valid.WebSearch/WebFetch for breaking changes, migration guides, and CVEs.gh to check release notes when needed.Do not assume APIs based on model knowledge. When in doubt, look it up.
For every code change:
mcp__sonarqube__*) is configured, run analysis. Skip silently if not configured.Never consider a task complete until the build passes (and SonarQube violations are resolved when applicable).
Default to package by feature, not by layer. Sibling top-level packages per bounded concern (orders/, shipping/, ...), package-private by default, types public only when another module needs them. Avoid global controller/, service/, dto/ packages.
For applications with more than ~3 features, adopt Spring Modulith: declare modules with @ApplicationModule on package-info.java, prefer @ApplicationModuleListener events for cross-module communication, and add an ApplicationModules.of(Application.class).verify() test. See references/code-organization.md for layout, dependencies, named interfaces, the event publication registry, test slicing, and observability.
Load the relevant spoke file on demand for the task at hand:
| Task | Read |
|---|---|
| Building controllers, request/response DTOs, API versioning | references/rest-controllers.md |
@RestControllerAdvice, ProblemDetail, RFC 7807 errors | references/exception-handling.md |
| Bean Validation 3 (Jakarta), custom constraints | references/validation.md |
@Entity, JpaRepository, @Transactional, Hibernate notes | references/spring-data-jpa.md |
@Async, ThreadPoolTaskExecutor, TaskDecorator, CompletableFuture executor selection, MDC/Security/Trace propagation | references/async-and-executors.md |
@ConfigurationProperties, profiles | references/configuration-properties.md |
@WebMvcTest, @DataJpaTest, @SpringBootTest, Testcontainers, mock-bean annotations | references/testing.md |
| OpenAPI, Micrometer metrics, distributed tracing | references/observability.md |
| NullAway / Error Prone build configuration | references/nullaway-setup.md |
| Package layout (feature vs layer), Spring Modulith modules and events | references/code-organization.md |
For comprehensive, in-depth testing guidance, see the SivaLabs spring-boot skill: https://github.com/sivaprasadreddy/sivalabs-agent-skills/tree/main/skills/spring-boot. Its testing references cover the testing pyramid and level-selection, unit/mocking, slice tests (@WebMvcTest/@DataJpaTest/@JdbcTest/@JooqTest/@JsonTest/@RestClientTest), Testcontainers wiring (@ServiceConnection vs dynamic properties), integration and end-to-end tests, and context-caching performance — all with Boot 3.5.x-vs-4.x differences, adapted with credit to Philip Riecks, Paul Bakker (Netflix), Siva Katamreddy, and Dan Vega. (The expanded testing reference set is being contributed via sivalabs-agent-skills#12 — available once merged.)
Enable by default on Java 21+ (spring.threads.virtual.enabled=true). When enabled:
Executors.newVirtualThreadPerTaskExecutor() for custom executors.ReentrantLock instead of synchronized around blocking I/O on Java 21–23 (synchronized pins the carrier thread). Java 24+ fixed this via JEP 491, so on Java 24 or later the constraint is historical — verify only if a legacy runtime is still in play.ThreadLocal for large or long-lived state. Prefer ScopedValue (preview on 21, stable on 25) or pass context explicitly.For broader JSpecify topics (migrating from JSR-305, JetBrains, Spring's org.springframework.lang.*, Jakarta, Android, FindBugs, Checker, Eclipse JDT via OpenRewrite; incremental adoption with @NullUnmarked; Kotlin interop) use the standalone jspecify skill. This section covers Spring-Boot-specific usage only.
Spring Boot 4.x includes JSpecify transitively. For 3.5.x, add it explicitly:
org.jspecify:jspecify:1.0.0implementation 'org.jspecify:jspecify:1.0.0'| Spring Boot | Package | Annotations |
|---|---|---|
| 4.x | org.jspecify.annotations | @Nullable, @NonNull, @NullMarked, @NullUnmarked |
| 3.5.x | org.jspecify.annotations (preferred for forward-compat) or org.springframework.lang | @Nullable, @NonNull, @NullMarked |
Prefer JSpecify on 3.5.x to ease the 4.x upgrade.
@NullMarked in package-info.java. Create one in every package.@Nullable.Optional<T> over @Nullable for service/repository return types. Use @Nullable for fields, parameters, and entity/DTO records where Optional is inappropriate.null to a non-null parameter. Validate inputs at system boundaries.@NullMarked packages, do not use @NonNull -- it is redundant.@NullUnmarked sparingly to interop with legacy code, and document why.List<@Nullable String>.For NullAway/Error Prone build configuration, read references/nullaway-setup.md.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/spring-boot:spring-bootfrom spring-boot
npx claudepluginhub adityamparikh/spring-boot-skill --plugin spring-boot