/major-ai-skills:spring-bootfrom major-ai-skills
Ship Spring Boot 3 services with profiles, Bean Validation, Flyway/Liquibase release migrations, locked-down Actuator, and test slices agents routinely skip.
Ships in major-ai-skills. 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.
Read when SKILL.md points to them.
Spring Boot auto-configures a Spring ApplicationContext from starters on the classpath. Web apps expose MVC controllers (embedded Tomcat) or WebFlux handlers. Configuration is profile- and env-driven (application.yml + SPRING_DATASOURCE_*). Agents prefer constructor injection, Bean Validation on DTOs, Flyway/Liquibase for schema (ideally as an explicit release step in prod), and Actuator limited to health/probes—never open env/heapdump to the internet.
┌─────────────────────────────────────────────────────────────┐
│ Spring Boot request path │
│ │
│ Client → LB / @nginx │
│ → embedded Tomcat (servlet) or Netty (WebFlux) │
│ → Filter chain / Security │
│ → @RestController → @Service → @Repository / JPA │
│ └── @postgresql (+ pool: HikariCP) │
│ │
│ Boot lifecycle │
│ ├── Auto-config from starters │
│ ├── Flyway/Liquibase (dev migrate / prod validate+job) │
│ └── Actuator: health/liveness/readiness (narrow exposure) │
│ │
│ Async: @Async / Spring AMQP / Kafka — not the HTTP thread │
└─────────────────────────────────────────────────────────────┘
Use when
Do not use when
elastic threads.@terraform / @kubernetes without app code.env/shutdown/heapdump publicly → refuse; lock down or disable.@Autowired (harder tests, hidden deps).@Valid + @NotBlank/@Size on request records; @ControllerAdvice → RFC 7807 problem details.SPRING_DATASOURCE_PASSWORD, etc.—never commit prod passwords in YAML.management.endpoints.web.exposure.include=health,info (add prometheus only if scraped privately); secure or disable sensitive endpoints.@WebMvcTest, @DataJpaTest over only @SpringBootTest for speed; use @SpringBootTest for wiring smoke.@docker base images.application.yml (non-secret defaults):
spring:
application:
name: items-api
jpa:
open-in-view: false
hibernate:
ddl-auto: validate
flyway:
enabled: true
management:
endpoints:
web:
exposure:
include: health,info
endpoint:
health:
probes:
enabled: true
---
spring:
config:
activate:
on-profile: prod
datasource:
url: ${SPRING_DATASOURCE_URL}
username: ${SPRING_DATASOURCE_USERNAME}
password: ${SPRING_DATASOURCE_PASSWORD}
flyway:
# Prefer CI migrate; app validates schema at boot
enabled: true
Controller + DTO:
@RestController
@RequestMapping("/api/items")
public class ItemController {
private final ItemService items;
public ItemController(ItemService items) {
this.items = items;
}
@PostMapping
@ResponseStatus(HttpStatus.CREATED)
public ItemResponse create(@Valid @RequestBody ItemRequest body) {
return items.create(body);
}
}
public record ItemRequest(
@NotBlank @Size(max = 64) String sku,
@Min(0) int qty
) {}
Flyway: src/main/resources/db/migration/V1__items.sql
CREATE TABLE items (
id BIGSERIAL PRIMARY KEY,
sku VARCHAR(64) NOT NULL UNIQUE,
qty INT NOT NULL CHECK (qty >= 0),
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
Commands:
./mvnw -DskipTests package
./mvnw flyway:migrate # release job against prod URL from CI secrets
java -jar target/items-api.jar --spring.profiles.active=prod
./mvnw -Dtest=ItemControllerTest test
Optional prod-only validate strategy (conceptual):
@Bean
@Profile("prod")
public FlywayMigrationStrategy validateOnly() {
return Flyway::validate;
}
| Signature | Likely cause | Fix path |
|---|---|---|
Failed to configure a DataSource | Missing JDBC URL/driver starter | Set SPRING_DATASOURCE_*; add postgresql driver |
| Flyway checksum mismatch | Edited applied migration | Never edit applied versions; add new Vn__ repair only with ops approval |
| Long startup / probe kills pod | Migrate on boot under lock + slow SQL | Move migrate to Job; shorten startup path; tune probes |
| Actuator leaks config | Broad exposure.include=* | Restrict to health/info; authenticate management port |
| LazyInitializationException | open-in-view + lazy nav after session | open-in-view: false; fetch joins / DTO queries |
| Slow CI | Only full @SpringBootTest | Add @WebMvcTest / @DataJpaTest slices |
| Validation returns empty 400 | Missing @Valid / advice | Add @Valid + @ControllerAdvice ProblemDetail |
@ControllerAdvice for exceptions; structured logs with correlation IDs.@postgresql); fail fast on migrate validate errors.@Transactional on services, not controllers; keep transactions short.@Async + broker (or queue) for email/webhooks—do not block Tomcat threads.@postgresql — indexes, locks, pool sizing under Hikari@docker — JDK runtime images and healthchecks hitting /actuator/health@kubernetes — probes using liveness/readiness Actuator paths@redis — cache or session when added via Spring Data Redis@kotlin — idiomatic Spring Boot on KotlinMANDATORY: Constructor injection,
@ValidDTOs, and env-backed secrets. Schema via Flyway/Liquibase—prefer release-job migrate + boot validate in prod. Lock Actuator exposure. Prefer test slices. Never invent datasource passwords or open sensitive Actuator endpoints.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub alivirgo/major-ai-skills --plugin major-ai-skills412 skills in this plugin
/3d-slicerAutomate 3D Slicer research workflows with MRML, VTK/ITK, DICOM data, and Segment Editor. Use for software workflows, not clinical interpretation./abbreviated-git-statusInspect Git branch, staging, and working-tree changes with short or porcelain status output when a compact repository check is needed./ableton-liveAutomate Ableton Live sessions with Python MIDI Remote Scripts, Max for Live, AbletonOSC, and Link synchronization./act-as-a-personal-tutorExplain a subject step by step, assess prior knowledge, and use short exercises to check understanding before advancing.