con un clic
java-spring-boot
构建生产级 Spring Boot 应用 - REST API、Security、Data、Actuator
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
构建生产级 Spring Boot 应用 - REST API、Security、Data、Actuator
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
Execute Story design review for an Epic or single Story using parallel three-layer adversarial analysis (Structure Hunter, Consistency Checker, Contract Auditor) with four-bucket triage, and save review summary to a structured result file. Use when user mentions 'SR', 'story review', 'story design review', 'epic review', 'story check', 'design review', 'Story 审查', 'SR 审查', '设计审查', 'Story 设计审查', 'Epic 审查', '审查 Story', '审查 Epic', or wants to review Story design documents before development. Capable of dual-granularity review (Epic-level or single-Story), parallel three-layer adversarial analysis, four-bucket triage, auto-detecting review history, batch processing, and generating structured review result documents with round numbering.
Evaluate Story design review results and generate a structured evaluation document. Use when user mentions 'SR evaluate', 'SR evaluation', 'evaluate SR', 'story review evaluation', 'design review evaluation', '评估 SR', '评估审查结果', 'SR 评估', '设计审查评估', 'Story 审查评估', '评估 Story 审查', or wants to assess Story design review findings. Capable of reading latest review results, assessing finding validity with source and bucket awareness, and producing evaluation documents with round numbering.
Execute Story document revisions based on SR evaluation conclusions and append revision summary to the evaluation document. Use when user mentions 'SR fix', 'SR revise', 'story revision', 'apply SR fixes', 'story review fix', 'design fix', '执行修订', 'SR 修订', '修订 Story', '执行 SR 修正', 'Story 设计修订', '修订 Story 文档', or wants to implement revisions from SR evaluation. Capable of reading evaluation conclusions, executing targeted document revisions, and recording revision summaries in evaluation documents.
Execute cross-LLM code review for a Story using parallel adversarial review layers (Blind Hunter, Edge Case Hunter, Acceptance Auditor) with structured triage, and save review summary to a structured result file. Use when user mentions 'CR', 'code review', 'crossllm review', 're-review', 'code review summary', '代码审查', 'CR 审查', '跨模型审查', '代码复审', '代码评审', '审查代码', or wants to review Story code changes. Capable of first-round and subsequent-round code reviews, parallel three-layer adversarial analysis, four-bucket triage, auto-detecting review history, and generating structured review result documents with round numbering.
Evaluate code review results from a cross-LLM review round and generate a structured evaluation document. Use when user mentions 'CR evaluate', 'CR evaluation', 'evaluate CR', 'review assessment', 'code review evaluation', '评估审查结果', '评估 CR', '评估 CR 结果', 'CR 评估', '审查结果评估', 'CR 结果评估', '代码审查评估', or wants to assess code review findings. Capable of reading latest review results, assessing finding validity, and producing evaluation documents with round numbering.
Execute code fixes based on code review evaluation conclusions and append fix summary to the evaluation document. Use when user mentions 'CR fix', 'CR repair', 'execute fix', 'apply CR fixes', 'code review fix', '执行修复', 'CR 修复', '修复 CR 问题', '执行 CR 修正', '代码审查修复', or wants to implement fixes from CR evaluation. Capable of reading evaluation conclusions, executing targeted code fixes, and recording fix summaries in evaluation documents.
| name | java-spring-boot |
| description | 构建生产级 Spring Boot 应用 - REST API、Security、Data、Actuator |
| sasmp_version | 1.3.0 |
| version | 3.0.0 |
| bonded_agent | 03-java-spring |
| bond_type | PRIMARY_BOND |
| allowed-tools | Read, Write, Bash, Glob, Grep |
| parameters | {"spring_version":{"type":"string","default":"3.2","description":"Spring Boot 版本"},"module":{"type":"string","enum":["web","security","data","actuator","cloud"],"description":"Spring 模块聚焦方向"}} |
使用现代最佳实践构建生产就绪的 Spring Boot 应用。
本技能涵盖 Spring Boot 开发,包括 REST API、安全配置、数据访问、Actuator 监控和云集成。遵循 Spring Boot 3.x 模式,着重于生产就绪性。
当你需要:
// REST 控制器
@RestController
@RequestMapping("/api/users")
@Validated
public class UserController {
@GetMapping("/{id}")
public ResponseEntity<User> getUser(@PathVariable Long id) {
return userService.findById(id)
.map(ResponseEntity::ok)
.orElse(ResponseEntity.notFound().build());
}
@PostMapping
public ResponseEntity<User> createUser(@Valid @RequestBody UserRequest request) {
User user = userService.create(request);
URI location = URI.create("/api/users/" + user.getId());
return ResponseEntity.created(location).body(user);
}
}
// 安全配置
@Configuration
@EnableWebSecurity
public class SecurityConfig {
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
return http
.csrf(csrf -> csrf.disable())
.sessionManagement(s -> s.sessionCreationPolicy(STATELESS))
.authorizeHttpRequests(auth -> auth
.requestMatchers("/actuator/health/**").permitAll()
.requestMatchers("/api/public/**").permitAll()
.anyRequest().authenticated())
.oauth2ResourceServer(oauth2 -> oauth2.jwt(Customizer.withDefaults()))
.build();
}
}
// 全局异常处理器
@RestControllerAdvice
public class GlobalExceptionHandler {
@ExceptionHandler(EntityNotFoundException.class)
public ProblemDetail handleNotFound(EntityNotFoundException ex) {
return ProblemDetail.forStatusAndDetail(NOT_FOUND, ex.getMessage());
}
}
# application.yml
spring:
application:
name: ${APP_NAME:my-service}
profiles:
active: ${SPRING_PROFILES_ACTIVE:local}
jpa:
open-in-view: false
properties:
hibernate:
jdbc.batch_size: 50
management:
endpoints:
web:
exposure:
include: health,info,metrics,prometheus
endpoint:
health:
probes:
enabled: true
server:
error:
include-stacktrace: never
Controller → Service → Repository → Database
↓ ↓ ↓
DTOs Entities Entities
public record CreateUserRequest(
@NotBlank @Size(max = 100) String name,
@Email @NotBlank String email,
@NotNull @Min(18) Integer age
) {}
| 问题 | 原因 | 解决方案 |
|---|---|---|
| Bean 未找到 | 缺少 @Component | 添加注解或 @Bean |
| 循环依赖 | 构造器注入 | 使用 @Lazy 或重构 |
| 401 未授权 | Security 配置问题 | 检查 permitAll 路径 |
| 启动缓慢 | 过多自动配置 | 排除未使用的 Starter |
debug=true
logging.level.org.springframework.security=DEBUG
spring.jpa.show-sql=true
□ 检查 /actuator/conditions
□ 验证活跃的 Profiles
□ 审查 Security Filter Chain
□ 检查 Bean 定义
□ 测试健康检查端点
Skill("java-spring-boot")
java-testing - Spring 测试模式java-jpa-hibernate - 数据访问