Spring Boot project conventions and mandatory rules. Auto-loads when working with Spring Boot, Java, or Maven projects. Enforces No-Lombok, constructor injection, RestClient, Flyway for relational databases, Problem Details errors, and other standards; adds OpenAPI contract rules when the API is built for a UI.
84%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
These conventions apply to ALL code generated or reviewed in the project. Follow them strictly.
LoggerFactory.getLogger() for loggers@Autowired on fields@AutoConfigureRestTestClient for integration tests@ServiceConnection (not @DynamicPropertySource)javax.persistence)<Resource>Response, <Resource>CreateRequest, <Resource>UpdateRequest; controllers never expose entitiespl.piomin.services1.0.0 — PATCH by default, MINOR for a backward-compatible feature, MAJOR for a breaking API change; every OpenAPI contract change bumps the version.github/workflows/, .circleci/, .gitlab-ci.yml) and match it, or default to a sensible choiceREADME.md on each new version@Transactional(readOnly = true) at service class level, @Transactional on mutating methods@Valid @RequestBody on all POST/PUT endpoints@RestControllerAdvice for global exception handlingResponseEntity with proper status codes (201 Created, 204 No Content)@ConfigurationProperties for type-safe config (no raw @Value for groups)@HttpExchange interfaces for declarative HTTP clientsspring.threads.virtual.enabled: true)spring.mvc.problemdetails.enabled: true); every error, including the catch-all 500, is RFC 9457 Problem Details, and the catch-all never returns the exception messagePagedModel; never Page/PageImpl@Version; a lost update returns 409server.shutdown: graceful)/actuator/health/** (not only /actuator/health), so the liveness/readiness probes work behind securityDecide first whether these rules apply. They are required only when the API is built for a UI (or another client) that is generated from its OpenAPI contract; they cost extra code and tests that a plain API does not need.
| Situation | Action |
|---|---|
The user says the API backs a web UI or generated clients; the project's CLAUDE.md names a UI (e.g. a crud-ui-blueprint UI); the repo has contract/openapi.json or docs/API-CONTRACT.md | Load the spring-boot skill, references/ui-contract.md, and follow it |
| Service-to-service API, internal API, or no client is generated from the contract | Optional - the general rules above are enough; use a rule from ui-contract.md only when the user asks for it |
| Unsure | Ask once whether a UI or generated client will consume the API |
references/ui-contract.md is the single source of these rules: /api base path without CORS, operationIds, the springdoc 3 contract exported to contract/openapi.json and checked in CI, the fixed FieldError codes, PUT with a required version, filters, Reference {id, label} relations, Keycloak realm layout, public health/info, and the README "Connect a UI" section. Where it differs from the defaults above (e.g. /api instead of /api/v1), it wins; a contract document in the project (docs/API-CONTRACT.md) wins over both.
Decide first whether Flyway applies:
| Situation | Action |
|---|---|
| JDBC/JPA with a Flyway-supported relational database (PostgreSQL, MySQL, MariaDB, Oracle, SQL Server, DB2, H2, ...) | Use Flyway |
| Project already uses Liquibase | Keep Liquibase, do not add Flyway |
| No persistence, NoSQL only (MongoDB, Redis, Cassandra, Elasticsearch), or a database Flyway does not support | Skip Flyway - no dependency, no db/migration, no spring.flyway.* |
When Flyway applies:
src/main/resources/db/migration); Hibernate only validates it (spring.jpa.hibernate.ddl-auto: validate). Never use update/create outside testsspring-boot-starter-flyway plus the database module (e.g. flyway-database-postgresql)application.yml: ddl-auto: validate, open-in-view: false, and the database in the readiness probe (management.endpoint.health.group.readiness.include: readinessState,db). Flyway defaults need no spring.flyway.* keysGenerationType.IDENTITY: GENERATED BY DEFAULT AS IDENTITY (PostgreSQL, Oracle, DB2, H2), AUTO_INCREMENT (MySQL/MariaDB), IDENTITY (SQL Server); not SERIAL/BIGSERIALV<n>__<description>.sqlNOT NULL column gets a DEFAULT or a backfill, so existing rows keep workingpk_, uk_, ck_, fk_, ix_); index every foreign key column; a unique constraint the API reports as a 409 conflict is referenced by name from the exception handlerDEFAULTs match entity defaults; validation rules get a matching DB CHECKDetails and examples: spring-boot skill, references/data.md (Database Migrations).
piomin/claude-ai-spring-boot
31fe1d5
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.