spring-boot-server
Skill10 starsChanged 4 months agoMITView on GitHub
Stack-specific coding rules for long-running Java Spring Boot server applications, covering Spring MVC REST controllers, dependency injection, Jackson JSON, validation, configuration, persistence integration, testing (unit/integration/system), observability, security, and Maven/Gradle project conventions. Use whenever creating, generating, scaffolding, writing, migrating, troubleshooting, or reviewing Spring Boot server code. This skill is architecture-neutral, it can be composed it with BCE, package-by-feature, package-by-layer, SDD4J, or another architecture skill when the project or user specifies an architecture. Not for serverless deployments, one-off Java CLI applications, or non-Spring Jakarta/MicroProfile services.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- geertberkers/claude-skillstheir own version, first seen Oct 11, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- geertberkers/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- conventional-commitSkill
- diagramsSkill
- drawioSkill
- java-conventionsSkill
- java-distillerSkill
- mermaidSkill
- microprofile-serverSkill
- migrate-to-bceSkill
- quarkus-jnosqlSkill
- sdd4j-bceSkill
- sdd4j-ears-testsSkill
- sdd4j-hexagonalSkill
- sdd4j-package-by-featureSkill
- sdd4j-package-by-layerSkill
- sdd4jSkill
- slddSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
69 rules. About 0 are common, 53 are distinctive, and 16 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈53
Distinctive · estimate
This author's own choices. Worth a look.
16
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 9
when no architecture is specified, infer and preserve the existing project organization instead of introducing BCE, package-by-feature, or …
- Distinctive: line 13
prefer dependencies in this order: Java SE, Spring Boot starters already present in the project, Spring ecosystem modules already used by …
- Distinctive: line 14
avoid adding dependencies for problems already solved by Spring Boot, Java SE, or the existing project stack
- Very specific: line 15
ask before changing Maven pom.xml, Gradle build files, dependency versions, Java version, Spring Boot version, or plugin configuration
- Distinctive: line 16
do not introduce a second web stack.
- Distinctive: line 19
treat Spring Boot as the application stack, not as the architecture
- Distinctive: line 21
do not rename packages, introduce architectural layers, or reorganize code solely because this skill is active
- Distinctive: line 22
when adding new code, place it where equivalent Spring components already live
- Distinctive: line 23
when no convention exists, choose the smallest clear structure for the requested change and avoid committing the project to a broad …
- Distinctive: line 24
keep Spring framework annotations at application entry points, application services, configuration, adapters, and persistence integration …
- Distinctive: line 27
place Spring MVC controllers, REST API DTO mapping, request/response models, scheduled entry points, messaging listeners, external API …
- Distinctive: line 29
keep controllers coarse-grained and free of business logic.
- Very specific: line 30
use @RestController for JSON HTTP APIs and @Controller only when rendering views or redirects is intentional
- Very specific: line 33
put @Transactional on request-sized use case methods when the transaction boundary is intentionally tied to that entry point
- Distinctive: line 34
avoid calling repositories directly from controllers except for trivial generated code explicitly requested by the user
- Very specific: line 38
use Spring stereotypes such as @Service or @Component for injectable application classes
- Distinctive: line 39
keep application services independent of HTTP, servlet, controller, and JSON serialization details
- Very specific: line 41
place @Transactional on application service/use-case methods when the transaction is intentionally scoped to reusable application logic
- Distinctive: line 42
prefer constructor injection.
- Distinctive: line 49
if a relation exists in the database, the entity model must carry a corresponding reference, id field, or association.
- Distinctive: line 51
keep JPA annotations out of DTOs and controller request/response types
- Distinctive: line 54
place Spring Data repositories near the aggregate, feature, service, or persistence package that owns the persistent concept according to …
- Distinctive: line 56
do not expose Spring Data repositories directly as REST resources unless the project already uses Spring Data REST and the user explicitly …
- Very specific: line 57
avoid leaking Pageable, Page, Specification, or persistence-specific types outside Spring-facing API/application code unless the existing …
- Distinctive: line 58
prefer explicit query methods or small custom queries over broad generic repository use in business logic
- Very specific: line 63
use ResponseStatusException only for small web/API-local cases.
- Distinctive: line 65
never construct successful and error response payloads ad hoc across multiple controllers when a shared error format exists
- Distinctive: line 68
use Jackson as the default JSON mechanism in Spring Boot applications
- Distinctive: line 70
prefer records for immutable request/response DTOs when validation, serialization, and project style allow it
- Distinctive: line 71
keep Jackson annotations at the DTO/API model level when possible.
- Very specific: line 72
use @JsonFormat, @JsonProperty, and custom serializers sparingly and only when the API contract requires them
- Distinctive: line 75
use Bean Validation on request DTOs for syntactic request validation
- Distinctive: line 76
place business validation in application/domain code so it remains independent of HTTP and can be tested without Spring MVC
- Very specific: line 77
use @Valid or @Validated at controller entry points when consuming validated request bodies or parameters
- Distinctive: line 78
do not use validation annotations as the only enforcement for domain invariants that must hold outside HTTP requests
- Very specific: line 81
use application.yml or application.properties consistently with the existing project
- Very specific: line 82
prefer typed @ConfigurationProperties over scattered @Value fields when more than one related property is used
- Distinctive: line 83
keep environment-specific values in profiles, environment variables, or deployment configuration, not hardcoded in source
- Distinctive: line 84
do not introduce new profiles, property namespaces, or configuration files without checking existing conventions first
- Distinctive: line 85
avoid reading configuration directly from deep domain code.
- Distinctive: line 88
use Spring Boot Actuator for health, info, metrics, and readiness/liveness endpoints when observability is needed
- Distinctive: line 89
create custom health indicators near the component, feature, adapter, or integration whose health they expose
- Distinctive: line 90
create metrics with Micrometer and prefer OpenTelemetry-compatible naming and labels
- Distinctive: line 91
avoid high-cardinality metric tags such as user ids, request ids, emails, or raw URLs
- Distinctive: line 95
use Spring Security when authentication or authorization is needed
- Distinctive: line 96
keep authorization decisions close to controllers, handlers, or application use cases.
- Distinctive: line 97
prefer method security for use-case authorization when it improves readability and testability
- Distinctive: line 98
do not disable CSRF, CORS, authentication, or authorization globally unless the project context explicitly requires it and the user agrees
- Distinctive: line 99
never add secrets, tokens, passwords, or private keys to source files or test fixtures
- Distinctive: line 102
write unit tests for application/domain behavior without starting the Spring context when possible
- Very specific: line 103
write Spring MVC slice tests with @WebMvcTest for controller behavior and HTTP mapping
- Very specific: line 104
write persistence slice tests with @DataJpaTest when verifying repository/query behavior
- Very specific: line 105
write integration tests with @SpringBootTest only when the Spring container, configuration, wiring, or end-to-end behavior is the subject …
- Distinctive: line 106
use Testcontainers when external infrastructure is needed and the project already uses it or the user approves adding it
- Very specific: line 107
do not overuse @MockBean/@MockitoBean.
- Distinctive: line 112
create system tests as a separate module or clearly separated test source set when the project already has that convention or when the …
- Very specific: line 113
prefer HTTP clients already used by the project.
- Distinctive: line 115
avoid RestAssured unless the project already standardizes on it
- Distinctive: line 119
write brief, to-the-point README.md files for advanced developers
- Distinctive: line 120
use precise and concise language.
- Distinctive: line 121
do not include detailed project structure file/folder listings.
- Distinctive: line 122
do not list every REST endpoint in READMEs.
- Distinctive: line 123
if modules are listed, provide links
- Distinctive: line 124
do not use the term "Orchestrates".
- Distinctive: line 128
do not create or change files on opening existing projects.
- Distinctive: line 129
do not generate code initially in an empty project unless the user explicitly asks to scaffold or implement something
- Distinctive: line 130
always inspect existing package, test, build, and dependency conventions before adding code
- Distinctive: line 131
keep changes minimal and aligned with the project's current Spring Boot major version
- Distinctive: line 132
do not migrate between Spring Boot major versions unless the user explicitly requests a migration
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Composition
- compose with
java-conventionsfor all language-level Java rules (syntax, style, naming, visibility, interfaces/classes, methods/lambdas, streams/collections, exceptions, comments/JavaDoc) - compose with an architecture skill when architecture is specified or already present, such as
bce,sdd4j-bce,sdd4j-package-by-feature, orsdd4j-package-by-layer - when no architecture is specified, infer and preserve the existing project organization instead of introducing BCE, package-by-feature, or package-by-layer by default
- this skill specializes only the Spring Boot server stack and does not restate language-level Java or architecture-level rules
Dependencies
- prefer dependencies in this order: Java SE, Spring Boot starters already present in the project, Spring ecosystem modules already used by the project
- avoid adding dependencies for problems already solved by Spring Boot, Java SE, or the existing project stack
- ask before changing Maven
pom.xml, Gradle build files, dependency versions, Java version, Spring Boot version, or plugin configuration - do not introduce a second web stack; Spring MVC and WebFlux should not be mixed unless the existing project already does so deliberately
Architecture Fit
- treat Spring Boot as the application stack, not as the architecture
- preserve the architecture already used by the project, including package-by-feature, package-by-layer, BCE, hexagonal, clean architecture, modular monolith, or a local project convention
- do not rename packages, introduce architectural layers, or reorganize code solely because this skill is active
- when adding new code, place it where equivalent Spring components already live
- when no convention exists, choose the smallest clear structure for the requested change and avoid committing the project to a broad architecture prematurely
- keep Spring framework annotations at application entry points, application services, configuration, adapters, and persistence integration points; avoid leaking Spring concerns into domain code unless the project already follows an active-record or Spring-centric model
Web/API Entry Points
- place Spring MVC controllers, REST API DTO mapping, request/response models, scheduled entry points, messaging listeners, external API clients, health indicators, and protocol adapters according to the existing architecture
- name REST controllers in plural after the resource they expose, e.g.
SpeakersControllerrather thanSpeakerController - keep controllers coarse-grained and free of business logic; validate and translate HTTP input, then delegate to application services, handlers, or use cases
- use
@RestControllerfor JSON HTTP APIs and@Controlleronly when rendering views or redirects is intentional - declare request mappings at class level where it clarifies the resource path
- return
ResponseEntity<T>when status, headers, or empty responses matter; return DTOs directly only for straightforward successful responses - put
@Transactionalon request-sized use case methods when the transaction boundary is intentionally tied to that entry point - avoid calling repositories directly from controllers except for trivial generated code explicitly requested by the user
Application Logic
- implement procedural business logic and application use cases in the project's existing service/application/use-case location
- use Spring stereotypes such as
@Serviceor@Componentfor injectable application classes - keep application services independent of HTTP, servlet, controller, and JSON serialization details
- let application methods express use cases in domain terms rather than transport terms
- place
@Transactionalon application service/use-case methods when the transaction is intentionally scoped to reusable application logic - prefer constructor injection; avoid field injection
Domain And Data Model
- maintain domain objects, data classes, JPA entities, value objects, enums, and domain behavior in the project's existing model/domain/entity location
- entities maintain state and corresponding behavior
- model stable value objects as records or enums when appropriate
- direct references across independent modules, features, or components are allowed when they fit the existing architecture, but aim for maximal cohesion and minimal coupling
- if a relation exists in the database, the entity model must carry a corresponding reference, id field, or association; the DB schema is the source of truth when it already exists
- excessive cross-module references or shared configuration are refactoring signals; split, merge, or rebalance responsibilities to restore cohesion
- keep JPA annotations out of DTOs and controller request/response types
Repositories And Persistence
- place Spring Data repositories near the aggregate, feature, service, or persistence package that owns the persistent concept according to the existing architecture
- repositories may live in application, domain, persistence, infrastructure, adapter, feature, or entity packages depending on the project convention; follow that convention consistently
- do not expose Spring Data repositories directly as REST resources unless the project already uses Spring Data REST and the user explicitly wants that style
- avoid leaking
Pageable,Page,Specification, or persistence-specific types outside Spring-facing API/application code unless the existing API contract already exposes them - prefer explicit query methods or small custom queries over broad generic repository use in business logic
Exceptions And HTTP Errors
- represent domain failures with domain/application exceptions, not HTTP-specific exceptions in application or domain code
- map exceptions to HTTP status codes in the web/API layer with
@ControllerAdviceand@ExceptionHandler - use
ResponseStatusExceptiononly for small web/API-local cases; prefer centralized exception mapping for reusable APIs - for Spring Boot 3+, prefer
ProblemDetailfor structured API errors when the project already uses Spring Framework 6 error conventions or when adding a new API error format - never construct successful and error response payloads ad hoc across multiple controllers when a shared error format exists
JSON Serialization
- use Jackson as the default JSON mechanism in Spring Boot applications
- map JSON at the web/API edge to request/response DTOs or command/query objects; do not bind external API shapes directly to rich domain entities unless the API is intentionally internal
- prefer records for immutable request/response DTOs when validation, serialization, and project style allow it
- keep Jackson annotations at the DTO/API model level when possible; avoid polluting domain entities with transport-specific JSON annotations unless persistence/API compatibility requires it
- use
@JsonFormat,@JsonProperty, and custom serializers sparingly and only when the API contract requires them
Validation
- use Bean Validation on request DTOs for syntactic request validation
- place business validation in application/domain code so it remains independent of HTTP and can be tested without Spring MVC
- use
@Validor@Validatedat controller entry points when consuming validated request bodies or parameters - do not use validation annotations as the only enforcement for domain invariants that must hold outside HTTP requests
Configuration
- use
application.ymlorapplication.propertiesconsistently with the existing project - prefer typed
@ConfigurationPropertiesover scattered@Valuefields when more than one related property is used - keep environment-specific values in profiles, environment variables, or deployment configuration, not hardcoded in source
- do not introduce new profiles, property namespaces, or configuration files without checking existing conventions first
- avoid reading configuration directly from deep domain code; inject typed configuration into Spring-managed components or adapters that need it
Observability
- use Spring Boot Actuator for health, info, metrics, and readiness/liveness endpoints when observability is needed
- create custom health indicators near the component, feature, adapter, or integration whose health they expose
- create metrics with Micrometer and prefer OpenTelemetry-compatible naming and labels
- avoid high-cardinality metric tags such as user ids, request ids, emails, or raw URLs
- log at application edges for incoming/outgoing integration events and in application services for meaningful business milestones; do not log sensitive data
Security
- use Spring Security when authentication or authorization is needed
- keep authorization decisions close to controllers, handlers, or application use cases; do not scatter role checks through domain entities
- prefer method security for use-case authorization when it improves readability and testability
- do not disable CSRF, CORS, authentication, or authorization globally unless the project context explicitly requires it and the user agrees
- never add secrets, tokens, passwords, or private keys to source files or test fixtures
Testing
- write unit tests for application/domain behavior without starting the Spring context when possible
- write Spring MVC slice tests with
@WebMvcTestfor controller behavior and HTTP mapping - write persistence slice tests with
@DataJpaTestwhen verifying repository/query behavior - write integration tests with
@SpringBootTestonly when the Spring container, configuration, wiring, or end-to-end behavior is the subject under test - use Testcontainers when external infrastructure is needed and the project already uses it or the user approves adding it
- do not overuse
@MockBean/@MockitoBean; prefer smaller unit tests or focused slices when possible - integration tests should follow the project's naming convention; when there is no convention, use
*ITfor integration tests and keep unit tests as*Test - execute relevant tests after every meaningful change unless the user explicitly activates demo/showtime mode
System Tests
- create system tests as a separate module or clearly separated test source set when the project already has that convention or when the service is tested as a deployed process
- prefer HTTP clients already used by the project; otherwise use Spring
WebTestClient,RestClient, or JDKHttpClientdepending on the test boundary - system tests should exercise the running service through public interfaces, not through Spring internals
- avoid RestAssured unless the project already standardizes on it
- execute system tests after major service changes when feasible
README Guidelines
- write brief, to-the-point README.md files for advanced developers
- use precise and concise language; avoid generic adjectives like "simple" or "lightweight"
- do not include detailed project structure file/folder listings; high-level module descriptions are acceptable
- do not list every REST endpoint in READMEs; link to API docs when present
- if modules are listed, provide links
- do not use the term "Orchestrates"; use more specific alternatives
Project Management
- on opening existing projects, load
AGENTS.mdif present before making changes - do not create or change files on opening existing projects; stop after initialization and wait for instructions when the user only asked to inspect or initialize
- do not generate code initially in an empty project unless the user explicitly asks to scaffold or implement something
- always inspect existing package, test, build, and dependency conventions before adding code
- keep changes minimal and aligned with the project's current Spring Boot major version
- do not migrate between Spring Boot major versions unless the user explicitly requests a migration
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

