Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Java/Spring Boot 编码规范:用于编写、审查、重构和讲解 Java 代码。适用于 Java 风格、Spring Boot 架构、Controller/Service/Manager/DAO 分层、API 边界、Entity/VO/Form/DTO/BO 设计、MyBatis/MyBatis-Plus 持久化、事务、异常、日志、安全、性能、测试和 Java 代码评审等场景。默认结合 Google Java Style 与 Spring Boot 最佳实践,同时允许仓库内的 AGENTS.md、CLAUDE.md、Checkstyle、Spotless 以及相邻代码风格覆盖这些通用规则。
.claude/skills/snailclimb-java-coding-standards/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-13 | ✗→✓ | ▲ Improved | 59% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 19% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 105% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 60% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 27% | 0% |
将这个 skill 视为 Java 17+ / Spring Boot 项目的简明工作卡。SKILL.md 只保留流程和路由,具体规则按需加载 references/ 下的参考文件。
AGENTS.md、CLAUDE.md、本地格式化配置或相邻代码与本 skill 冲突,优先遵循仓库约定;只有当冲突会影响结果时,再明确指出。@RequiredArgsConstructor。Controller 负责路由、认证边界、校验注解和响应转换; Service 负责业务编排; Manager 负责事务和 DAO 组合; DAO/Mapper 负责持久化。
优先按这个结构回答:规则、原因、示例、以及仓库内是否存在本地覆盖约定。
| 需求 | 加载文件 | | --- | --- | | Java 格式、导入、括号、缩进、换行、switch、注解、修饰符、Javadoc、命名 | references/google-style.md | | 项目结构、JavaBean 后缀、Optional、Stream、泛型、不可变性、现代 Java 特性 | references/code-style.md | | 模块化目录、Controller/Service/Manager/DAO 分层、URL 规范、@Transactional、设计模式、统一响应 | references/architecture.md | | 异常、日志、性能、线程池、远程调用、安全、测试、数据库设计 | references/best-practices.md |
UpperCamelCase,方法/字段使用 lowerCamelCase,常量使用 UPPER_SNAKE_CASE,包名全小写且不用下划线,项目名全小写并使用中划线。Entity。请求用 Form,返回用 VO,跨层传输用 DTO,内部业务对象用 BO。BO 不应出现在 Controller API 中。xxxFlag / xxx_flag,避免 isXxx 字段,以免序列化和 RPC 映射歧义。GET/POST /module/submodule/action,并且把路由注解写在方法上,便于搜索。@ApiOperation,需要沿用既有 author 习惯;若项目使用 springdoc,则跟随本地 @Operation 写法。@Transactional(rollbackFor = Exception.class) 放在这里,负责 DAO 组合和第三方平台细节封装,并尽量缩小事务范围。@Transactional;应把事务方法移动到另一个 Spring Bean,通常是 Manager,或使用仓库既有代理方案。catch (Exception e) {};要么处理、要么带上下文包装、要么明确说明为何可以忽略。Executors.newFixedThreadPool() 或 newCachedThreadPool();要显式创建带边界队列、线程名、监控和关闭逻辑的 ThreadPoolExecutor Bean。架构与 API:
事务与持久化:
rollbackFor = Exception.class。数据模型与 Java 风格:
flag 规则是否正确。异常、日志与安全:
测试与验证:
维护这个 skill 时,遵循与优秀 CLAUDE.md / AGENTS.md 相同的原则:
SKILL.md 只承担路由和执行层角色;长示例和细则放入 references/。skill-creator 的验证流程再检查一遍。| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-13 | fail→pass | 11,916 | 7,985 | -33% | 1 | 1 | 0% | 2,036 | 3,229 | +59% | 0 | 0 | — |
case-01 | fail→fail | 18,052 | 4,171 | -77% | 1 | 1 | 0% | 1,672 | 2,610 | +56% | 0 | 0 | — |
case-02 | fail→pass | 25,951 | 25,369 | -2% | 1 | 1 | 0% | 6,055 | 7,235 | +19% | 0 | 0 | — |
case-03 | fail→pass | 10,803 | 10,021 | -7% | 1 | 1 | 0% | 1,833 | 3,751 | +105% | 0 | 0 | — |
case-04 | fail→pass | 14,267 | 13,185 | -8% | 1 | 1 | 0% | 2,643 | 4,236 | +60% | 0 | 0 | — |
case-05 | pass→pass | 17,011 | 12,964 | -24% | 1 | 1 | 0% | 2,493 | 4,290 | +72% | 0 | 0 | — |
case-11 | pass→pass | 13,252 | 11,057 | -17% | 1 | 1 | 0% | 2,159 | 3,576 | +66% | 0 | 0 | — |
case-06 | fail→pass | 14,293 | 6,679 | -53% | 1 | 1 | 0% | 2,356 | 2,981 | +27% | 0 | 0 | — |
case-07 | pass→pass | 15,082 | 16,187 | +7% | 1 | 1 | 0% | 2,500 | 5,053 | +102% | 0 | 0 | — |
case-08 | pass→pass | 15,338 | 13,400 | -13% | 1 | 1 | 0% | 2,625 | 4,212 | +60% | 0 | 0 | — |
case-09 | pass→pass | 12,970 | 10,874 | -16% | 1 | 1 | 0% | 2,252 | 3,762 | +67% | 0 | 0 | — |
case-10 | pass→pass | 13,685 | 10,721 | -22% | 1 | 1 | 0% | 2,040 | 3,489 | +71% | 0 | 0 | — |
case-12 | pass→pass | 13,069 | 10,400 | -20% | 1 | 1 | 0% | 2,060 | 3,583 | +74% | 0 | 0 | — |
case-14 | fail→fail | 10,803 | 10,873 | +1% | 1 | 1 | 0% | 1,963 | 3,934 | +100% | 0 | 0 | — |
case-15 | pass→pass | 10,012 | 10,902 | +9% | 1 | 1 | 0% | 1,657 | 3,753 | +126% | 0 | 0 | — |
case-16 | pass→pass | 15,825 | 12,750 | -19% | 1 | 1 | 0% | 2,430 | 3,973 | +63% | 0 | 0 | — |
case-17 | pass→pass | 13,348 | 3,381 | -75% | 1 | 1 | 0% | 2,152 | 2,425 | +13% | 0 | 0 | — |
case-18 | fail→pass | 13,232 | 7,785 | -41% | 1 | 1 | 0% | 1,966 | 3,129 | +59% | 0 | 0 | — |
case-19 | pass→pass | 11,090 | 10,204 | -8% | 1 | 1 | 0% | 1,763 | 3,374 | +91% | 0 | 0 | — |
case-20 | pass→pass | 15,092 | 15,043 | -0% | 1 | 1 | 0% | 2,825 | 4,705 | +67% | 0 | 0 | — |
case-21 | pass→pass | 14,138 | 15,981 | +13% | 1 | 1 | 0% | 2,594 | 4,844 | +87% | 0 | 0 | — |
case-22 | pass→pass | 6,568 | 8,080 | +23% | 1 | 1 | 0% | 1,232 | 3,335 | +171% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +27 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.