一键导入
java-best-practices
Java coding best practices. Use when writing or reviewing Java code (17+). Covers modern features, error handling, and patterns.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Java coding best practices. Use when writing or reviewing Java code (17+). Covers modern features, error handling, and patterns.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Hybrid architecture combining Ralph's PRD format with Planning-with-Files' structured approach. Auto-generates PRDs from task descriptions, manages parallel story execution with dependency resolution, and provides context-filtered agents for efficient multi-story development.
Project-level multi-task orchestration system. Manages multiple hybrid:worktree features in parallel with dependency resolution, coordinated PRD generation, and unified merge workflow.
Implements Manus-style file-based planning for complex tasks. Creates task_plan.md, findings.md, and progress.md. Use when starting complex multi-step tasks, research projects, or any task requiring >5 tool calls. Now with automatic session recovery after /clear and optional Git worktree mode.
Go coding best practices. Use when writing or reviewing Go code. Covers error handling, concurrency, and idiomatic patterns.
Python coding best practices. Use when writing or reviewing Python code. Covers type hints, error handling, and common patterns.
TypeScript/Node.js best practices. Use when writing or reviewing TypeScript code. Covers type safety, async patterns, and error handling.
| name | java-best-practices |
| description | Java coding best practices. Use when writing or reviewing Java code (17+). Covers modern features, error handling, and patterns. |
| license | MIT |
| metadata | {"author":"plan-cascade","version":"1.0.0"} |
| Rule | Guideline |
|---|---|
| Formatter | google-java-format |
| Analysis | SpotBugs, Error Prone |
| Naming | Clear, no abbreviations |
| Feature | Usage |
|---|---|
| Records | Immutable data carriers |
| Sealed classes | Restricted hierarchies |
| Pattern matching | instanceof with binding |
var | Local type inference |
public record User(String id, String name) {}
if (obj instanceof String s && !s.isEmpty()) { process(s); }
public sealed interface Result<T> permits Success, Failure {}
record Success<T>(T value) implements Result<T> {}
record Failure<T>(Exception error) implements Result<T> {}
| Rule | Guideline |
|---|---|
| Specific exceptions | Not bare Exception |
| Try-with-resources | For AutoCloseable |
try (var reader = new BufferedReader(new FileReader(path))) {
return reader.lines().toList();
} catch (IOException e) {
throw new ConfigException("Failed: " + path, e);
}
src/main/java/com/example/{domain,service}/
src/test/java/
pom.xml or build.gradle
| Pattern | Usage |
|---|---|
| Optional | Null-safe returns |
| Stream API | Functional collections |
| Builder | Complex construction |
public Optional<User> findById(String id) {
return Optional.ofNullable(users.get(id));
}
| Avoid | Use Instead |
|---|---|
| Returning null | Optional<T> |
| Mutable data | Records |
instanceof chains | Pattern matching |
@Test void shouldProcess() {
var service = new Service(mockRepo);
var result = service.process(input);
assertThat(result.status()).isEqualTo(SUCCESS);
}