Spring Boot Engineer
When to Use / When Not to Use
Use when:
- Building REST controllers, JPA repositories, or service layers in Spring Boot 3.x
- Configuring Spring Security 6, OAuth2, or JWT authentication
- Setting up Actuator, health probes, or Spring Cloud components
Do not use when:
- Architecture-level service decomposition decisions (use
microservices-architect)
- Kotlin-idiomatic concerns (pair with
kotlin-specialist)
Process
- Analyze requirements — Identify service boundaries, APIs, data models, security needs
- Design architecture — Plan data access, cloud integration, security; confirm before coding
- Implement — Create services with constructor injection and layered architecture
- Secure — Add Spring Security, OAuth2, method security, CORS; verify security rules compile and tests pass
- Test — Write unit, integration, and slice tests; run
./mvnw test and confirm all pass
- Deploy — Configure Actuator health checks; validate
/actuator/health returns UP
Output Template
For each Spring Boot feature, provide:
- Entity with validation annotations
- Repository interface extending JpaRepository
- Service with constructor injection and
@Transactional
- REST controller with
@Valid input and @RestControllerAdvice
- Test slice (
@WebMvcTest or @DataJpaTest)
What Claude Does / What You Do
| Claude |
You |
| Generates layered architecture scaffolding |
Provide domain requirements and data model |
| Configures Spring Security rules and JWT setup |
Verify auth behavior in your environment |
Writes @Transactional boundaries and JPA queries |
Run tests and confirm correct data behavior |
| Sets up Actuator endpoints and health indicators |
Connect to your monitoring stack |
Generates @WebMvcTest and Testcontainers test slices |
Run the full test suite and fix failures |
Reference Guide
| Topic |
Reference |
Load When |
| Web Layer |
references/web.md |
Controllers, REST APIs, validation, exception handling |
| Data Access |
references/data.md |
Spring Data JPA, repositories, transactions, projections |
| Security |
references/security.md |
Spring Security 6, OAuth2, JWT, method security |
| Cloud Native |
references/cloud.md |
Spring Cloud, Config, Discovery, Gateway, resilience |
| Testing |
references/testing.md |
@SpringBootTest, MockMvc, Testcontainers, test slices |
Quick Start — Minimal Working Structure
Entity
@Entity
@Table(name = "products")
public class Product {
@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@NotBlank private String name;
@DecimalMin("0.0") private BigDecimal price;
}
Repository
public interface ProductRepository extends JpaRepository<Product, Long> {
List<Product> findByNameContainingIgnoreCase(String name);
}
Service (constructor injection)
@Service
public class ProductService {
private final ProductRepository repo;
public ProductService(ProductRepository repo) { this.repo = repo; }
@Transactional(readOnly = true)
public List<Product> search(String name) {
return repo.findByNameContainingIgnoreCase(name);
}
}
REST Controller
@RestController
@RequestMapping("/api/v1/products")
@Validated
public class ProductController {
private final ProductService service;
public ProductController(ProductService service) { this.service = service; }
@PostMapping
@ResponseStatus(HttpStatus.CREATED)
public Product create(@Valid @RequestBody ProductRequest request) {
return service.create(request);
}
}
DTO (record)
public record ProductRequest(
@NotBlank String name,
@DecimalMin("0.0") BigDecimal price
) {}
Constraints
MUST DO:
| Rule |
Correct Pattern |
| Constructor injection |
public MyService(Dep dep) { this.dep = dep; } |
| Validate API input |
@Valid @RequestBody on every mutating endpoint |
| Type-safe config |
@ConfigurationProperties(prefix = "app") |
| Transaction scope |
@Transactional on multi-step writes; readOnly = true on reads |
| Externalize secrets |
Environment variables or Spring Cloud Config — never in application.properties |
MUST NOT DO:
- Field injection (
@Autowired on fields)
- Skip input validation on API endpoints
- Mix blocking and reactive code (no
.block() inside WebFlux chains)
- Use deprecated Spring Boot 2.x patterns (e.g.,
WebSecurityConfigurerAdapter)
Related Skills
microservices-architect — for architecture decisions before implementation
database-optimizer — for JPA query performance and index tuning
transaction-boundary-reviewer — for @Transactional boundary analysis
kotlin-specialist — for Kotlin-idiomatic patterns in Spring services
1---2name: spring-boot-engineer3description: Use when someone needs to build or extend a Java backend using the Spring ecosystem — wiring up a new REST API, configuring security and authentication, connecting to a database via JPA, or setting up reactive endpoints with Spring Boot 3.x.4license: MIT5---67# Spring Boot Engineer89## When to Use / When Not to Use1011**Use when:**12- Building REST controllers, JPA repositories, or service layers in Spring Boot 3.x13- Configuring Spring Security 6, OAuth2, or JWT authentication14- Setting up Actuator, health probes, or Spring Cloud components1516**Do not use when:**17- Architecture-level service decomposition decisions (use `microservices-architect`)18- Kotlin-idiomatic concerns (pair with `kotlin-specialist`)1920## Process21221. **Analyze requirements** — Identify service boundaries, APIs, data models, security needs232. **Design architecture** — Plan data access, cloud integration, security; confirm before coding243. **Implement** — Create services with constructor injection and layered architecture254. **Secure** — Add Spring Security, OAuth2, method security, CORS; verify security rules compile and tests pass265. **Test** — Write unit, integration, and slice tests; run `./mvnw test` and confirm all pass276. **Deploy** — Configure Actuator health checks; validate `/actuator/health` returns `UP`2829## Output Template3031For each Spring Boot feature, provide:321. Entity with validation annotations332. Repository interface extending JpaRepository343. Service with constructor injection and `@Transactional`354. REST controller with `@Valid` input and `@RestControllerAdvice`365. Test slice (`@WebMvcTest` or `@DataJpaTest`)3738## What Claude Does / What You Do3940| Claude | You |41|--------|-----|42| Generates layered architecture scaffolding | Provide domain requirements and data model |43| Configures Spring Security rules and JWT setup | Verify auth behavior in your environment |44| Writes `@Transactional` boundaries and JPA queries | Run tests and confirm correct data behavior |45| Sets up Actuator endpoints and health indicators | Connect to your monitoring stack |46| Generates `@WebMvcTest` and Testcontainers test slices | Run the full test suite and fix failures |4748## Reference Guide4950| Topic | Reference | Load When |51|-------|-----------|-----------|52| Web Layer | `references/web.md` | Controllers, REST APIs, validation, exception handling |53| Data Access | `references/data.md` | Spring Data JPA, repositories, transactions, projections |54| Security | `references/security.md` | Spring Security 6, OAuth2, JWT, method security |55| Cloud Native | `references/cloud.md` | Spring Cloud, Config, Discovery, Gateway, resilience |56| Testing | `references/testing.md` | @SpringBootTest, MockMvc, Testcontainers, test slices |5758## Quick Start — Minimal Working Structure5960### Entity61```java62@Entity63@Table(name = "products")64public class Product {65 @Id @GeneratedValue(strategy = GenerationType.IDENTITY)66 private Long id;67 @NotBlank private String name;68 @DecimalMin("0.0") private BigDecimal price;69}70```7172### Repository73```java74public interface ProductRepository extends JpaRepository<Product, Long> {75 List<Product> findByNameContainingIgnoreCase(String name);76}77```7879### Service (constructor injection)80```java81@Service82public class ProductService {83 private final ProductRepository repo;84 public ProductService(ProductRepository repo) { this.repo = repo; }8586 @Transactional(readOnly = true)87 public List<Product> search(String name) {88 return repo.findByNameContainingIgnoreCase(name);89 }90}91```9293### REST Controller94```java95@RestController96@RequestMapping("/api/v1/products")97@Validated98public class ProductController {99 private final ProductService service;100 public ProductController(ProductService service) { this.service = service; }101102 @PostMapping103 @ResponseStatus(HttpStatus.CREATED)104 public Product create(@Valid @RequestBody ProductRequest request) {105 return service.create(request);106 }107}108```109110### DTO (record)111```java112public record ProductRequest(113 @NotBlank String name,114 @DecimalMin("0.0") BigDecimal price115) {}116```117118## Constraints119120**MUST DO:**121122| Rule | Correct Pattern |123|------|----------------|124| Constructor injection | `public MyService(Dep dep) { this.dep = dep; }` |125| Validate API input | `@Valid @RequestBody` on every mutating endpoint |126| Type-safe config | `@ConfigurationProperties(prefix = "app")` |127| Transaction scope | `@Transactional` on multi-step writes; `readOnly = true` on reads |128| Externalize secrets | Environment variables or Spring Cloud Config — never in `application.properties` |129130**MUST NOT DO:**131- Field injection (`@Autowired` on fields)132- Skip input validation on API endpoints133- Mix blocking and reactive code (no `.block()` inside WebFlux chains)134- Use deprecated Spring Boot 2.x patterns (e.g., `WebSecurityConfigurerAdapter`)135136## Related Skills137138- `microservices-architect` — for architecture decisions before implementation139- `database-optimizer` — for JPA query performance and index tuning140- `transaction-boundary-reviewer` — for `@Transactional` boundary analysis141- `kotlin-specialist` — for Kotlin-idiomatic patterns in Spring services