/java:javafrom java
Writes, reviews, debugs and upgrades modern Java (17+): records, sealed types, pattern-matching switch, Optional, executors, CompletableFuture, virtual threads, JDK upgrades and javax.* to jakarta.* migration. Use when editing or debugging *.java, such as a MatchException or non-exhaustive switch over a sealed type, javax.servlet imports that no longer compile on Jakarta EE 9+, a record whose List changes after construction, a thread-pool or interrupt bug, or "review this Java class".
Ships in java. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Keep the existing observable contract (public API, exception behavior, thread-safety guarantees) unless the request changes it.
Not for: Maven POM and dependency work (maven), Gradle builds (gradle), JUnit, Mockito and Testcontainers (java-testing), Spring Boot code (spring-boot), Play controllers (play-framework), Kotlin (kotlin), Android framework code (android).
maven.compiler.release or <release> in pom.xml, java.toolchain.languageVersion in build.gradle*, .java-version or .sdkmanrc, and the CI JDK. Use no API or syntax newer than that level, whatever JDK is installed.com.android.* plugin, the language level comes from compileOptions and the runtime from minSdk plus desugaring, not from the installed JDK. Use no virtual threads, and no API above minSdk without a version check (java.time on minSdk below 26 needs core library desugaring).--enable-preview).search_graph and trace_path; otherwise Grep or the LSP.this.items = List.copyOf(items); (also rejects null elements). Arrays and Date need a clone in the constructor and the accessor. Validate in a compact constructor.sealed interface with record permits. Switch over it with no default, so adding a variant breaks compilation instead of throwing MatchException at runtime. A default branch on a sealed switch is a defect unless the type is open.when guards for conditions. Put the more specific case before the general one, and handle null explicitly (case null) when input can be null.var only where the right side names the type. No raw types; do not suppress unchecked without a comment saying why it is safe.equals and hashCode together, from the same fields. Prefer a record. Never put a mutable field in a hash key.Optional is a return type only. Never a field, parameter or collection element. No get() without a check; use map, orElseThrow, ifPresentOrElse.null.stream().toList() returns an unmodifiable list; Collectors.toList() makes no promise. Use Collectors.toCollection(ArrayList::new) when the caller must mutate.forEach, nested or checked exceptions. Parallel streams only for measured CPU-bound work on large data.removeIf. Atomic map updates use computeIfAbsent or merge, not containsKey then put.List.of, Set.of, Map.of, List.copyOf. They reject null and Set.of/Map.of reject duplicates.AutoCloseable in try-with-resources. Never close in finally by hand.catch (Throwable). Rethrow with the cause attached (new XException("op failed", e)), and log once at the boundary with the stack trace.InterruptedException: restore with Thread.currentThread().interrupt() or rethrow. Never swallow it.@param/@return only when they add information.java.util.concurrent. Replace shared HashMap with ConcurrentHashMap, hand-rolled counters with Atomic* or LongAdder.new Thread or an unbounded pool in a long-lived service. Every ExecutorService has an owner that calls shutdown() (then awaitTermination, then shutdownNow()), or is created in try-with-resources (an ExecutorService is AutoCloseable from Java 19).Executors.newVirtualThreadPerTaskExecutor(). Never pool them, and limit concurrency with a Semaphore, not pool size. They give nothing for CPU-bound work.CompletableFuture: a failure nobody observes vanishes, so end every chain with exceptionally, handle or whenComplete, or return the future to someone who will. Pass an explicit executor to *Async methods for blocking work. Add orTimeout.CompletableFuture chain or virtual-thread code, and when debugging a race, deadlock, pinning or shutdown hang.Verified on 2026-10-20 (openjdk.org): JDK 25 is an LTS. Virtual threads no longer pin the carrier inside synchronized from JDK 24 (JEP 491); on 21 to 23, prefer ReentrantLock around blocking calls. ScopedValue is final in 25 (JEP 506); StructuredTaskScope is still preview there (JEP 505).
./mvnw -q compile, ./gradlew compileJava), then the narrowest test that proves the change.-Xlint:all or the repo's static analysis (SpotBugs, Error Prone, Checkstyle) when configured, and fix new warnings you introduced.javax.* Jakarta EE packages to jakarta.*.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub adminhead/claude-plugins --plugin java