spring-boot

Implements Spring Boot 3.x REST APIs with JPA, Security, testing, and cloud-native patterns.

Updated Dec 23, 2025
One-click install
npx skills add https://github.com/zuldare/apuntesIA --skill spring-boot-zuldare
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: spring-boot
Source: https://github.com/zuldare/apuntesIA/tree/main/skills/spring-boot
Command: npx skills add https://github.com/zuldare/apuntesIA --skill spring-boot-zuldare

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building enterprise Java backends requires coordinating many Spring components—controllers, JPA repositories, security filters, transactions, and tests—and mistakes like field injection, missing validation, or N+1 queries lead to fragile applications. This Skill provides structured workflows and production-tested code templates for Spring Boot 3.x development. ## Core Features & Use Cases - Layered REST API Templates: Ready-to-use patterns for entities, repositories, services, controllers, DTOs, and global exception handling following clean architecture. - Security & Data References: Detailed guides for Spring Security 6 with JWT/OAuth2, method security, Spring Data JPA transactions, specifications, and query optimization. - Cloud-Native & Testing Patterns: Coverage of Spring Cloud Config, Gateway, Resilience4j circuit breakers, Kubernetes deployment, plus JUnit 5, MockMvc, and Testcontainers testing strategies. - Use Case: When asked to build a product catalog microservice, the Skill generates a validated REST controller, transactional service layer, JPA repository, JWT security configuration, and slice tests that pass with ./mvnw test. ## Quick Start Ask the AI to create a Spring Boot REST API for managing products with JPA persistence, JWT security, and integration tests.

Frequently Asked Questions about spring-boot

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a REST API with Spring Boot 3?▼

Create a @RestController with constructor-injected services, validate request bodies with @Valid, and return DTO records. Layer the application as Controller → Service → Repository, and handle errors globally with @RestControllerAdvice.

How to implement JWT authentication in Spring Security 6?▼

Configure a SecurityFilterChain bean with stateless sessions, add a JwtAuthenticationFilter before UsernamePasswordAuthenticationFilter, and use a JwtService to generate and validate HS256 tokens. Alternatively, configure an OAuth2 resource server with a JwtDecoder pointing to your issuer.

Should I use field injection or constructor injection in Spring?▼

Constructor injection is the required pattern. It makes dependencies explicit, enables final fields, simplifies unit testing with mocks, and avoids the hidden-dependency problems of @Autowired field injection.

How do I test Spring Boot controllers with MockMvc?▼

Use @WebMvcTest targeting your controller, mock the service layer with @MockBean, and perform requests with MockMvc verifying status codes and JSON paths. Add @WithMockUser to test security rules without real authentication.

Does Spring Data JPA support integration testing with real databases?▼

Yes, Testcontainers runs a real PostgreSQL container during tests. Declare a @Container PostgreSQLContainer, wire its JDBC URL via @DynamicPropertySource, and run @SpringBootTest against the actual database.

How do I fix N+1 query problems in Spring Data JPA?▼

Use JOIN FETCH in JPQL queries, @EntityGraph with attributePaths, or @BatchSize on collections to load associations in batches. Combine with pagination to avoid loading entire datasets into memory.