$npx -y skills add Jeffallan/claude-skills --skill spring-boot-engineerGenerates Spring Boot 3.x configurations, creates REST controllers, implements Spring Security 6 authentication flows, sets up Spring Data JPA repositories, and configures reactive WebFlux endpoints. Use when building Spring Boot 3.x applications, microservices, or reactive Java
| 1 | # Spring Boot Engineer |
| 2 | |
| 3 | ## Core Workflow |
| 4 | |
| 5 | 1. **Analyze requirements** — Identify service boundaries, APIs, data models, security needs |
| 6 | 2. **Design architecture** — Plan microservices, data access, cloud integration, security; confirm design before coding |
| 7 | 3. **Implement** — Create services with constructor injection and layered architecture (see Quick Start below) |
| 8 | 4. **Secure** — Add Spring Security, OAuth2, method security, CORS configuration; verify security rules compile and pass tests. If compilation or tests fail: review error output, fix the failing rule or configuration, and re-run before proceeding |
| 9 | 5. **Test** — Write unit, integration, and slice tests; run `./mvnw test` (or `./gradlew test`) and confirm all pass before proceeding. If tests fail: review the stack trace, isolate the failing assertion or component, fix the issue, and re-run the full suite |
| 10 | 6. **Deploy** — Configure health checks and observability via Actuator; validate `/actuator/health` returns `UP`. If health is `DOWN`: check the `components` detail in the response, resolve the failing component (e.g., datasource, broker), and re-validate |
| 11 | |
| 12 | ## Reference Guide |
| 13 | |
| 14 | Load detailed guidance based on context: |
| 15 | |
| 16 | | Topic | Reference | Load When | |
| 17 | |-------|-----------|-----------| |
| 18 | | Web Layer | `references/web.md` | Controllers, REST APIs, validation, exception handling | |
| 19 | | Data Access | `references/data.md` | Spring Data JPA, repositories, transactions, projections | |
| 20 | | Security | `references/security.md` | Spring Security 6, OAuth2, JWT, method security | |
| 21 | | Cloud Native | `references/cloud.md` | Spring Cloud, Config, Discovery, Gateway, resilience | |
| 22 | | Testing | `references/testing.md` | @SpringBootTest, MockMvc, Testcontainers, test slices | |
| 23 | |
| 24 | ## Quick Start — Minimal Working Structure |
| 25 | |
| 26 | A standard Spring Boot feature consists of these layers. Use these as copy-paste starting points. |
| 27 | |
| 28 | ### Entity |
| 29 | |
| 30 | ```java |
| 31 | @Entity |
| 32 | @Table(name = "products") |
| 33 | public class Product { |
| 34 | @Id |
| 35 | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| 36 | private Long id; |
| 37 | |
| 38 | @NotBlank |
| 39 | private String name; |
| 40 | |
| 41 | @DecimalMin("0.0") |
| 42 | private BigDecimal price; |
| 43 | |
| 44 | // getters / setters or use @Data (Lombok) |
| 45 | } |
| 46 | ``` |
| 47 | |
| 48 | ### Repository |
| 49 | |
| 50 | ```java |
| 51 | public interface ProductRepository extends JpaRepository<Product, Long> { |
| 52 | List<Product> findByNameContainingIgnoreCase(String name); |
| 53 | } |
| 54 | ``` |
| 55 | |
| 56 | ### Service (constructor injection) |
| 57 | |
| 58 | ```java |
| 59 | @Service |
| 60 | public class ProductService { |
| 61 | private final ProductRepository repo; |
| 62 | |
| 63 | public ProductService(ProductRepository repo) { // constructor injection — no @Autowired |
| 64 | this.repo = repo; |
| 65 | } |
| 66 | |
| 67 | @Transactional(readOnly = true) |
| 68 | public List<Product> search(String name) { |
| 69 | return repo.findByNameContainingIgnoreCase(name); |
| 70 | } |
| 71 | |
| 72 | @Transactional |
| 73 | public Product create(ProductRequest request) { |
| 74 | var product = new Product(); |
| 75 | product.setName(request.name()); |
| 76 | product.setPrice(request.price()); |
| 77 | return repo.save(product); |
| 78 | } |
| 79 | } |
| 80 | ``` |
| 81 | |
| 82 | ### REST Controller |
| 83 | |
| 84 | ```java |
| 85 | @RestController |
| 86 | @RequestMapping("/api/v1/products") |
| 87 | @Validated |
| 88 | public class ProductController { |
| 89 | private final ProductService service; |
| 90 | |
| 91 | public ProductController(ProductService service) { |
| 92 | this.service = service; |
| 93 | } |
| 94 | |
| 95 | @GetMapping |
| 96 | public List<Product> search(@RequestParam(defaultValue = "") String name) { |
| 97 | return service.search(name); |
| 98 | } |
| 99 | |
| 100 | @PostMapping |
| 101 | @ResponseStatus(HttpStatus.CREATED) |
| 102 | public Product create(@Valid @RequestBody ProductRequest request) { |
| 103 | return service.create(request); |
| 104 | } |
| 105 | } |
| 106 | ``` |
| 107 | |
| 108 | ### DTO (record) |
| 109 | |
| 110 | ```java |
| 111 | public record ProductRequest( |
| 112 | @NotBlank String name, |
| 113 | @DecimalMin("0.0") BigDecimal price |
| 114 | ) {} |
| 115 | ``` |
| 116 | |
| 117 | ### Global Exception Handler |
| 118 | |
| 119 | ```java |
| 120 | @RestControllerAdvice |
| 121 | public class GlobalExceptionHandler { |
| 122 | @ExceptionHandler(MethodArgumentNotValidException.class) |
| 123 | @ResponseStatus(HttpStatus.BAD_REQUEST) |
| 124 | public Map<String, String> handleValidation(MethodArgumentNotValidException ex) { |
| 125 | return ex.getBindingResult().getFieldErrors().stream() |
| 126 | .collect(Collectors.toMap( |