# Spring Boot 3 Expert

> Teaches an agent how to write modern Spring Boot 3 applications.

- Skill: `marisha-sahay/spring-boot-3-expert` (Agent Skill)
- Install (CLI): `npx skillmds@latest add marisha-sahay/spring-boot-3-expert`
- Raw SKILL.md: https://api.skillmd.com/api/skills/marisha-sahay/spring-boot-3-expert/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: Marisha-Sahay (https://skillmd.com/u/marisha-sahay)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/marisha-sahay/spring-boot-3-expert

---


# Spring Boot 3 Expert Skill

This skill provides guidelines and best practices for developing modern Spring Boot 3 applications.

## Dependency Injection
Strictly forbid field injection (using `@Autowired` on fields). You must mandate constructor injection. Use `final` fields and Lombok's `@RequiredArgsConstructor` when appropriate to reduce boilerplate code.

**Example Context:**
```java
@Service
@RequiredArgsConstructor
public class OrderService {
    private final OrderRepository orderRepository;
    private final PaymentClient paymentClient;

    // No @Autowired needed; constructor generated by Lombok
}
```

## Architecture
Enforce a strict layered architecture:
- **Controller Layer**: Responsible only for HTTP request mapping and delegating to services.
- **Service Layer**: Contains the core business logic.
- **Repository Layer**: Handles data access and interactions with the database.

**Example Context:**
```java
@RestController
@RequestMapping("/api/v1/orders")
@RequiredArgsConstructor
public class OrderController {
    private final OrderService orderService;

    @PostMapping
    public ResponseEntity<OrderResponse> createOrder(@RequestBody @Valid OrderRequest request) {
        return ResponseEntity.ok(orderService.processOrder(request));
    }
}
```

## Data Modeling
Mandate the use of Java 14+ `record` types for all DTOs (Data Transfer Objects), Requests, and Responses. This ensures immutability and concise class definitions.

**Example Context:**
```java
public record OrderRequest(
    @NotBlank String customerId,
    @Positive BigDecimal amount,
    @NotEmpty List<String> itemIds
) {}
```

## Configuration
Emphasize the use of `@ConfigurationProperties` for managing application configuration over scattered `@Value` annotations to provide strongly-typed configuration.

**Example Context:**
```java
@ConfigurationProperties(prefix = "app.payment")
public record PaymentProperties(
    @NotBlank String apiUrl,
    @Min(1000) int timeoutMs,
    int maxRetries
) {}
```

