Use when you need to refactor Java code to adopt modern Java features (Java 8+) — including migrating anonymous classes to lambdas, replacing Iterator loops with Stream API, adopting Optional for null safety, switching from legacy Date/Calendar to java.time, using collection factory methods, applying text blocks, var inference, or leveraging Java 25 features like flexible constructor bodies and module import declarations. This should trigger for requests such as Review Java code for modern Java
NewMaintained
Automatic
◆Coding pack
Last verified 8/20/2026
What it changes
Passed 9 of 16 test cases with the skill, and 10 of 16 without it.
Without skill64%
With skill59%
Checks it passed that the model alone missed
Executes Maven compile before applying refactorings
Refers to the modern Java reference documentation in references/141-java-refactoring-with-modern-features.md
2 fixed11 passed either way6 still failing3 broke
Pass-rate lift
-5 pp
Tokens
+11%
Agent turns
0%
Response time
-32%
Model gemini-3.6-flashMeasured 8/20/2026v113 of 22 cases passed with skill · 16 comparable
Tokens, turns and time describe resource use, not a dollar price.
See it in action
One of 2 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 2
Prompt
Before applying modern Java refactoring to `AccountService.java`, what specific Maven command must be executed first?
What was checked, without and with the skill
Checked
Without skill
With skill
Executes Maven compile before applying refactorings
Missed
Passed
case-18 · gemini-3.6-flash · 8/20/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md58 lines2 files
Modern Java Development Guidelines (Java 8+)
Identify and apply modern Java (Java 8+) refactoring opportunities to improve readability, maintainability, and performance.
What is covered in this Skill?
Lambda expressions and method references (over anonymous classes)
Scope: The reference is organized by examples (good/bad code patterns) for each core area. Apply recommendations based on applicable examples.
Constraints
Before applying any modern Java refactoring, ensure the project compiles. If compilation fails, stop immediately — do not proceed until the project compiles successfully. After applying improvements, run full verification.
MANDATORY: Run ./mvnw compile or mvn compile before applying any changes
SAFETY: If compilation fails, stop immediately — do not proceed until the project compiles successfully
VERIFY: Run ./mvnw clean verify or mvn clean verify after applying improvements
BEFORE APPLYING: Read the reference for detailed good/bad examples, constraints, and safeguards for each modern Java feature
EDGE CASE: If request scope is ambiguous, stop and ask a clarifying question before applying changes
EDGE CASE: If required inputs, files, or tooling are missing, report what is missing and ask whether to proceed with setup guidance
When to use this skill
Review Java code for modern Java development
Apply best practices for modern Java development in Java code
Modernize Java code with records pattern matching or switch expressions
Use when you need to refactor Java code for high performance — including memory/allocation reduction, CPU hot-path optimization, and syntax/API/control-flow improvements. This should trigger for requests such as Review Java code for high performance; Optimize Java hot path; Reduce Java allocations; Improve Java latency/throughput. Part of Plinth Toolkit