Training skill that generates and validates the java11-coding-conventions skill. Run this skill to regenerate the conventions from reference material and verify them against test cases. Use when updating or re-tuning Java 11 coding conventions.
This skill regenerates the java11-coding-conventions skill from reference material and validates it against test cases.
A SKILL.md at plugins/conventions/skills/java11-coding-conventions/SKILL.md that teaches Claude to write and review Java 11 code. This skill layers Java 11-specific conventions on top of the general java-coding-conventions skill.
Read references/conventions.md for the Java 11-specific conventions. Then write the output skill:
plugins/conventions/skills/java11-coding-conventions/SKILL.mdjava11-coding-conventions, user-invocable: false, model: haiku-4.5plugins/conventions/skills/java-coding-conventions/SKILL.mdvar, immutable collection factories (List.of/copyOf, Collectors.toUnmodifiableList), stream/Optional additions (Java 9/11), Predicate.not, new String methods (isBlank/strip/lines/repeat), Files.readString/writeString, HttpClient, java.time.Key things the skill must make very clear (these are the conventions models don't follow without explicit instruction):
final var for locals when the type is obvious from the RHS — never bare varList.of/Map.of/Set.of for small immutable collections, and List.copyOf etc. for defensive copies (replaces the Java 8 unmodifiableList(new ArrayList<>(...)) pattern)Collectors.toUnmodifiableList() — Stream.toList() is Java 16 and must not appearOptional.isEmpty(), Optional.or, ifPresentOrElse, Optional.stream(), Stream.ofNullablePredicate.not(String::isBlank) style negationString.isBlank/strip/lines/repeat instead of trim().isEmpty() and similar workaroundsFiles.readString / Files.writeString with the default UTF-8java.net.http.HttpClient for HTTP calls->, or Stream.toList()After regenerating, validate the skill using the test cases in evals/evals.json.
For each test case, spawn a subagent that:
plugins/conventions/skills/java-coding-conventions/SKILL.mdplugins/conventions/skills/java11-coding-conventions/SKILL.mdThen run the shared grading script against the outputs:
cd plugins/training
python -m shared.grade <workspace-dir>
The script checks Java 11-specific assertions:
no-post-java11-features — no records/sealed/pattern matching/text blocks/switch expressions/Stream.toList()unmodifiable-collections-java11 — List.of/copyOf or Collections.unmodifiable*streams-over-loops, optional-for-findall-vars-final-or-var — allows final var alongside finalPlus general assertions (immutable fields, small methods, etc.) to verify the general skill inclusion works correctly.
All assertions should pass for all test cases. If any fail, the conventions in the skill need strengthening in that area.
The test cases in evals/evals.json cover:
Input files for refactoring tests are in evals/files/.
The authoritative conventions are in references/conventions.md. Always read that file when regenerating — it is the single source of truth for what Java 11-specific rules to include.