From tech-skills
Java development workflow — build tooling, testing, code style, and common patterns.
How this skill is triggered — by the user, by Claude, or both
Slash command
/tech-skills:java-langThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You assist with Java development following modern Java conventions and standard build tooling.
You assist with Java development following modern Java conventions and standard build tooling.
mvn clean compile
./gradlew build
./gradlew) — never a system-installed Gradle--console=plain in CI for clean log output# Maven
mvn test
# Gradle
./gradlew test
org.junit.jupiter) — not JUnit 4@DisplayName for readable test names@Nested classes to group related tests@ParameterizedTest with @CsvSource, @MethodSource, or @EnumSource for table-driven testsassertThat(result).isEqualTo(expected)@Nested
@DisplayName("UserService.create")
class Create {
@Test
@DisplayName("creates user with valid input")
void createsUserWithValidInput() {
var input = new CreateUserRequest("alice", "[email protected]");
var result = service.create(input);
assertThat(result.name()).isEqualTo("alice");
}
@Test
@DisplayName("rejects duplicate email")
void rejectsDuplicateEmail() {
service.create(new CreateUserRequest("alice", "[email protected]"));
assertThatThrownBy(() -> service.create(new CreateUserRequest("bob", "[email protected]")))
.isInstanceOf(DuplicateEmailException.class);
}
}
@TempDir for filesystem isolationsrc/integrationTest/java)Use a consistent formatter configured once for the project:
mvn com.spotify.fmt:fmt-maven-plugin:format./gradlew spotlessApply.editorconfig and shared code style XMLFix issues directly rather than suppressing warnings unless there's a genuine false positive.
<dependencyManagement>
<dependencies>
<!-- Pin versions here -->
</dependencies>
</dependencyManagement>
dependencies {
implementation(platform("org.springframework.boot:spring-boot-dependencies:3.x.x"))
}
project/
├── src/
│ ├── main/java/com/example/project/
│ │ ├── domain/ # Domain objects, business rules
│ │ ├── service/ # Business logic, orchestration
│ │ ├── repository/ # Data access
│ │ ├── controller/ # API endpoints
│ │ └── config/ # Configuration classes
│ ├── main/resources/
│ │ └── application.yml
│ └── test/java/com/example/project/
│ └── (mirrors main structure)
├── pom.xml / build.gradle.kts
└── .editorconfig
com.example.project.order contains the controller, service, repository, and domain objects for ordersUse records for immutable data carriers:
public record CreateUserRequest(String name, String email) {}
Use sealed interfaces for closed type hierarchies:
public sealed interface Result<T> {
record Success<T>(T value) implements Result<T> {}
record Failure<T>(String error) implements Result<T> {}
}
Optional<T> from methods that may not have a result — never return nullOptional as a method parameter or field — it's for return typesorElseThrow() with a descriptive exception, not get()RuntimeExceptionthrow new OrderCreationException("Failed to create order for user " + userId, cause)Exception broadly — catch specific typesAutoCloseable resources@Nullable / @NonNull (JetBrains or Jakarta annotations)Objects.requireNonNull(param, "param must not be null")List.of() not nullvar for local variables where the type is obvious from context""") for multi-line stringsswitch expressions with pattern matching (Java 21+)Stream API for collection transformations, but keep pipelines short and readableStandard CI jobs:
mvn compile / ./gradlew compileJavamvn test / ./gradlew testUse the project's Java version via a .java-version file or toolchains configuration.
npx claudepluginhub eyelock/assistants --plugin tech-skillsMaster Maven and Gradle - build configuration, dependencies, plugins, CI/CD
Enforces Java coding standards for Spring Boot and Quarkus services: naming, immutability, Optional, streams, exceptions, generics, CDI, reactive patterns, and project layout.