跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
效率与协作

spring-boot-3-expert

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

Marisha-Sahay · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add Marisha-Sahay/awesome-java-agent-skills --skill spring-boot-3-expert

技能说明


name: spring-boot-3-expert description: Teaches an agent how to write modern Spring Boot 3 applications.

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:

@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:

@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:

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:

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