Training skill that generates and validates the java17-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 17 coding conventions.
This skill regenerates the java17-coding-conventions skill from reference material and validates it against test cases.
A SKILL.md at plugins/conventions/skills/java17-coding-conventions/SKILL.md that teaches Claude to write and review Java 17 code. This skill layers Java 17-specific conventions on top of the general java-coding-conventions skill.
Read references/conventions.md for the Java 17-specific conventions. Then write the output skill:
plugins/conventions/skills/java17-coding-conventions/SKILL.mdjava17-coding-conventions, user-invocable: false, model: haiku-4.5plugins/conventions/skills/java-coding-conventions/SKILL.mdvar, records, sealed types, pattern matching for instanceof, switch expressions with ->, text blocks, immutable collections + Stream.toList(), stream/Optional additions, helpful NPEs, new String methods, Files/HTTP, java.time.Key things the skill must make very clear:
List.copyOf defensive copiesfinal, sealed, or non-sealedinstanceof pattern matching with a final pattern variable instead of cast-after-check->; never use the old case X: + break formswitch is NOT in Java 17 — it's preview there, stable in 21""") for multi-line strings instead of concatenation with \nStream.toList() over Collectors.toUnmodifiableList() / Collectors.toList()final var for locals when the type is obviousswitch, record patterns, virtual threads, or sequenced collections (all Java 21)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/java17-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 17-specific assertions:
no-post-java17-features — no pattern matching for switch, record patterns, virtual threads, sequenced collectionsuses-records — data carriers should be recordsuses-pattern-matching — instanceof should use pattern matching with final pattern variablesuses-switch-expressions — switch uses arrow formuses-text-blocks — multi-line strings use """modern-collections — Stream.toList() / List.of / List.copyOfPlus general assertions (immutable fields, small methods, streams over loops, etc.).
PaymentResult hierarchy with a dispatcher that uses pattern matchingInput files for refactoring tests are in evals/files/.
The authoritative conventions are in references/conventions.md.