Training skill that generates and validates the java21-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 21 coding conventions.
This skill regenerates the java21-coding-conventions skill from reference material and validates it against test cases.
A SKILL.md at plugins/conventions/skills/java21-coding-conventions/SKILL.md that teaches Claude to write and review Java 21 code. This skill layers Java 21-specific conventions on top of the general java-coding-conventions skill.
Read references/conventions.md for the Java 21-specific conventions. Then write the output skill:
plugins/conventions/skills/java21-coding-conventions/SKILL.mdjava21-coding-conventions, user-invocable: false, model: haiku-4.5var, records + sealed, pattern matching for switch, record patterns, virtual threads, sequenced collections, streams/Optional, text blocks, helpful NPEs, java.time.Key things the skill must make very clear:
switch over sealed types; rely on exhaustiveness instead of defaultExecutors.newVirtualThreadPerTaskExecutor, Thread.ofVirtual) for blocking IO; one per task, never pooledgetFirst/getLast/reversed) instead of list.get(0) and Collections.reversefinalSTR."..."), unnamed patterns, or Java 22+ featuresAfter 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/java21-coding-conventions/SKILL.mdThen run the shared grading script:
cd plugins/training
python -m shared.grade <workspace-dir>
The script checks Java 21-specific assertions:
no-post-java21-features — no string templates, unnamed patterns, flexible constructor bodiesuses-records, uses-sealed, uses-pattern-matching, uses-switch-expressions, uses-text-blocks, modern-collectionsPlus general assertions (immutable fields, small methods, streams over loops, etc.).
PaymentResult hierarchy + dispatcher using pattern matching for switchInput files for refactoring tests are in evals/files/.
The authoritative conventions are in references/conventions.md.