用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/xenoterracide/gradle-semver --skill java命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | java |
| license | CC-BY-NC-SA-4.0 |
| description | Write code in the Java programming language. |
Use for writing Java code.
Let your domain language define the responsibilities in your system. Build each unit—object, function, or module—around a single responsibility derived from that language. Encapsulate behavior so it's polymorphic, letting the unit decide how to act rather than orchestrating externally. If you follow these principles, your code will naturally be composable, clear, and aligned with the domain.
final for fields unless they need to be mutable.record classes for simple data carriers.var strings = List.of("foo"); over var strings = new ArrayList<String>(); strings.add("foo");@Var and justify why mutability is necessary.@Nullable. This helps prevent null pointer exceptions and makes it clear when a value can be null. Optional is preferred when mapping or filtering would be clearer than procedural logic.prefer var keyword to explicit local variable type declaration. using var reduces quantity of code but more importantly coupling as sometimes it means classes no longer have to be imported and thus class name changes do not impact client code in some cases.
note: @Var is unrelated to this.
Examples:
var x = 1;var foo = "foo"var list = new ArrayList<Foo>();int x = 1;String foo = "foo";List<Foo> list = new ArrayList<>();Supplier<Foo> fooSupplier = () -> new Foo(); // not using var is better than castingvar fooSupplier = (Supplier<Foo>) () -> new Foo(); // casting is bad and should be avoided.Relying on a static method or variable can often be better than either even though it's more verbose.
static Supplier<Foo> fooSupplier() {
return () -> new Foo();
}
import statements unless it would result in conflicts.static import for test helpers that maintain clarity such as assertThat for AssertJ and given or mock from Mockito. Avoid static imports if it makes code comprehension.Avoid private except with fields. prefer the default "package protected" unless must be public or is useful for subclasses.
private is only necessary to prevent access from other classes in the same package, which is uncommon and should be avoided.@Builder and a static factory. e.g.import org.immutables.builder.Builder;
@Builder
record Bar(String foo) {
public static BarBuilder builder() {
return new BarBuilder();
}
}
SPDX-FileCopyrightText: Copyright © 2026 Caleb Cushing
SPDX-License-Identifier: CC-BY-NC-SA-4.0