
Java Dev
This is a comprehensive Java development guide that enforces Google and Alibaba style conventions with some hard rules that'll save you from production fires. It mandates Lombok for all DTOs (no hand-written getters), caps IN clauses at 500 parameters with batch utilities, and blocks read-modify-write patterns in favor of atomic SQL updates. The N+1 query section alone is worth it, showing exactly how to refactor forEach repository calls into batch queries with Maps. Spring Boot 3.x gets special attention around constructor injection and circular dependency traps when extracting services. There's also auth filter degradation rules and 0-based pagination alignment across the stack. It's opinionated in the right places, like refusing partial credentials that give worse UX than anonymous access.
- skills.sh installs
- 465
- GitHub stars
- 1.1K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add doccker/cc-use-exp --skill java-dev --agent claude-codeInstalls into .claude/skills of the current project.
Files
Java 开发规范
参考来源: Google Java Style Guide、阿里巴巴 Java 开发手册
工具链
# Maven
mvn clean compile # 编译
mvn test # 运行测试
mvn verify # 运行所有检查
# Gradle
./gradlew build # 构建
./gradlew test # 运行测试
命名约定
| 类型 | 规则 | 示例 |
|---|---|---|
| 包名 | 全小写,域名反转 | com.example.project |
| 类名 | 大驼峰,名词/名词短语 | UserService, HttpClient |
| 方法名 | 小驼峰,动词开头 | findById, isValid |
| 常量 | 全大写下划线分隔 | MAX_RETRY_COUNT |
| 布尔返回值 | is/has/can 前缀 | isActive(), hasPermission() |
类成员顺序
public class Example {
// 1. 静态常量
public static final String CONSTANT = "value";
// 2. 静态变量
private static Logger logger = LoggerFactory.getLogger(Example.class);
// 3. 实例变量
private Long id;
// 4. 构造函数
public Example() { }
// 5. 静态方法
public static Example create() { return new Example(); }
// 6. 实例方法(公共 → 私有)
public void doSomething() { }
private void helperMethod() { }
// 7. getter/setter(或使用 Lombok)
}
DTO/VO 类规范
Sponsors
Details
- Repository
- github.com/doccker/cc-use-exp
- Category
- Java & JVM
- First seen
- Jun 3, 2026