← 返回 Skills 市场
187
总下载
0
收藏
2
当前安装
1
版本数
在 OpenClaw 中安装
/install java-spring-boot
功能描述
Build production Spring Boot applications - REST APIs, Security, Data, Actuator
使用说明 (SKILL.md)
Java Spring Boot Skill
Build production-ready Spring Boot applications with modern best practices.
Overview
This skill covers Spring Boot development including REST APIs, security configuration, data access, actuator monitoring, and cloud integration. Follows Spring Boot 3.x patterns with emphasis on production readiness.
When to Use This Skill
Use when you need to:
- Create REST APIs with Spring MVC/WebFlux
- Configure Spring Security (OAuth2, JWT)
- Set up database access with Spring Data
- Enable monitoring with Actuator
- Integrate with Spring Cloud
Topics Covered
Spring Boot Core
- Auto-configuration and starters
- Application properties and profiles
- Bean lifecycle and configuration
- DevTools and hot reload
REST API Development
- @RestController and @RequestMapping
- Request/response handling
- Validation with Bean Validation
- Exception handling with @ControllerAdvice
Spring Security
- SecurityFilterChain configuration
- OAuth2 and JWT authentication
- Method security (@PreAuthorize)
- CORS and CSRF configuration
Spring Data JPA
- Repository pattern
- Query methods and @Query
- Pagination and sorting
- Auditing and transactions
Actuator & Monitoring
- Health checks and probes
- Metrics with Micrometer
- Custom endpoints
- Prometheus integration
Quick Reference
// REST Controller
@RestController
@RequestMapping("/api/users")
@Validated
public class UserController {
@GetMapping("/{id}")
public ResponseEntity\x3CUser> getUser(@PathVariable Long id) {
return userService.findById(id)
.map(ResponseEntity::ok)
.orElse(ResponseEntity.notFound().build());
}
@PostMapping
public ResponseEntity\x3CUser> createUser(@Valid @RequestBody UserRequest request) {
User user = userService.create(request);
URI location = URI.create("/api/users/" + user.getId());
return ResponseEntity.created(location).body(user);
}
}
// Security Configuration
@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();
}
}
// Exception Handler
@RestControllerAdvice
public class GlobalExceptionHandler {
@ExceptionHandler(EntityNotFoundException.class)
public ProblemDetail handleNotFound(EntityNotFoundException ex) {
return ProblemDetail.forStatusAndDetail(NOT_FOUND, ex.getMessage());
}
}
Configuration Templates
# 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
Common Patterns
Layer Architecture
Controller → Service → Repository → Database
↓ ↓ ↓
DTOs Entities Entities
Validation Patterns
public record CreateUserRequest(
@NotBlank @Size(max = 100) String name,
@Email @NotBlank String email,
@NotNull @Min(18) Integer age
) {}
Troubleshooting
Common Issues
| Problem | Cause | Solution |
|---|---|---|
| Bean not found | Missing @Component | Add annotation or @Bean |
| Circular dependency | Constructor injection | Use @Lazy or refactor |
| 401 Unauthorized | Security config | Check permitAll paths |
| Slow startup | Heavy auto-config | Exclude unused starters |
Debug Properties
debug=true
logging.level.org.springframework.security=DEBUG
spring.jpa.show-sql=true
Debug Checklist
□ Check /actuator/conditions
□ Verify active profiles
□ Review security filter chain
□ Check bean definitions
□ Test health endpoints
Usage
Skill("java-spring-boot")
Related Skills
java-testing- Spring test patternsjava-jpa-hibernate- Data access
安全使用建议
This skill appears coherent and light-weight: it provides docs, patterns, a config schema, and a local validation script. It does not ask for credentials or install external code. However, because it declares tooling permissions (Read, Write, Bash), an agent using the skill could read or modify files in your project workspace or run shell commands; only install/use it from authors you trust and avoid giving it access to sensitive directories. If you need stricter limits, ask for a version that omits Bash/write permissions or review/ sandbox its actions before allowing automated invocation.
功能分析
Type: OpenClaw Skill
Name: java-spring-boot
Version: 1.0.0
The skill bundle is a standard development toolkit for Java Spring Boot. It contains legitimate code templates, configuration schemas, and a validation script (scripts/validate.py) that uses safe practices like yaml.safe_load. No indicators of data exfiltration, malicious execution, or prompt injection were found.
能力评估
Purpose & Capability
Name/description (Spring Boot development) align with included files (detailed SKILL.md, guidance, patterns, config schema) and the small validation script. There are no unrelated credentials, binaries, or install steps.
Instruction Scope
SKILL.md is documentation and examples for building Spring Boot apps and does not instruct reading sensitive system paths or env vars. It does list allowed-tools including Read, Write, and Bash — reasonable for a coding/authoring skill but means an agent using this skill could read/write project files or run shell commands. The documentation example suggests analyzing the current implementation, which implies access to workspace files; this is expected but worth noting.
Install Mechanism
No install spec is present (instruction-only plus small scripts). No downloads or external installers — low installation risk.
Credentials
The skill requests no environment variables or credentials. The contained code and docs do not reference hidden secrets or unrelated services.
Persistence & Privilege
always is false and the skill does not request system-wide persistence or modify other skills. Autonomous invocation is allowed by default but not combined with any elevated privileges here.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install java-spring-boot - 安装完成后,直接呼叫该 Skill 的名称或使用
/java-spring-boot触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of java-spring-boot skill.
- Build production-ready Spring Boot applications: REST APIs, Security, Data, Actuator.
- Supports Spring Boot 3.x features and best practices.
- Includes guides and code snippets for REST, Security, Data JPA, and Actuator integration.
- Parameter validation for spring_version and module focus.
- Troubleshooting section with common Spring Boot issues and debug tips.
元数据
常见问题
Java Spring Boot 是什么?
Build production Spring Boot applications - REST APIs, Security, Data, Actuator. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 187 次。
如何安装 Java Spring Boot?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install java-spring-boot」即可一键安装,无需额外配置。
Java Spring Boot 是免费的吗?
是的,Java Spring Boot 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Java Spring Boot 支持哪些平台?
Java Spring Boot 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Java Spring Boot?
由 nacy(@watermelon11)开发并维护,当前版本 v1.0.0。
推荐 Skills