Skip to content
Skills Library
Programming · Building & coding

modernize-java

/modernize-java

Update Java code to modern language features — records, switch expressions, pattern matching, virtual threads, sealed classes, text blocks, and current collection idioms. Triggers on Java source files.

Licence
MIT
Last repository change
21.10.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 21.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Update Java code to modern language features — records, switch expressions, pattern matching, virtual threads, sealed classes, text blocks, and current collection idioms. Triggers on Java source files.

Original author description

Update Java code to modern language features — records, switch expressions, pattern matching, virtual threads, sealed classes, text blocks, and current collection idioms. Triggers on Java source files.

How it works

  1. Constraints
Original SKILL.md headings · 22 lines, 170 words
SKILL.md preview
---
name: modernize-java
description: Update Java code to modern language features — records, switch expressions, pattern matching, virtual threads, sealed classes, text blocks, and current collection idioms. Triggers on Java source files.
paths:
  - "**/*.java"
effort: medium
user-invocable: true
---

# Modernize Java Code

Update the target code to use modern Java features:

- **Records** instead of mutable POJOs where the type is a value carrier
- **Switch expressions** with arrow syntax and exhaustiveness checking
- **Pattern matching** for `instanceof` and `switch`
- **Local variable type inference** (`var`) where it helps readability
- **Virtual threads** (Java 21+) for I/O-bound operations — `Executors.newVirtualThreadPerTaskExecutor()`
- **Sealed classes** when the type hierarchy is closed
- **Text blocks** for multiline strings
- **Sequenced collections** (Java 21+) where ordered access matters
- **Collection factory methods** (`List.of`, `Map.of`, `Map.entry`)

## Constraints

- Don't change behavior — preserve the public API and observable semantics.
- Don't apply `var` where the inferred type would harm readability (e.g., factory results that could be any of several types).
- If the project's target Java version is below 21, skip the 21+ features and note it in your summary.
- Run the test suite after non-trivial changes; if tests don't exist, surface that as a follow-up rather than as a blocker.

Versions

The database has no other skills named modernize-java.

Identical content appears in 1 other GitHub folders. We show one copy with the highest score.

Database snapshot: 13.11.2026 · package version 550e3778bf90 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100java-expert
    Expert knowledge of Java 25 features including virtual threads, pattern matching, records, sealed classes, value types, and Project Loom/Valhalla features. Use when the user asks about Java programming, Java 25 features, concurrency, performance optimization, or modern Java idioms.
  • 100java-modern
    Java 21+ features for Quarkus - records, sealed classes, pattern matching, virtual threads, text blocks. Use when user asks about modern Java, Java 21 features, or when modernizing existing code.
  • 100java-modern
    Java 21+ features for Spring Boot - records, sealed classes, pattern matching, virtual threads, text blocks. Use when user asks about modern Java, Java 21 features, or when modernizing existing code.
  • 100java-upgrade
    Upgrade a Java project to a newer JDK (11 to 17, 17 to 21, 21 to 25) and adopt the new language and library features. Detects the current Java version from the build files, then loads only the matching per-version guide. Use when the user asks to upgrade Java, modernize Java…
  • 100java-upgrade
    Upgrade a Java project to a newer JDK (11 to 17, 17 to 21, 21 to 25) and adopt the new language and library features. Detects the current Java version from the build files, then loads only the matching per-version guide. Use when the user asks to upgrade Java, modernize Java…
  • 100java-language
    Modern Java 21+ language standards including Records, Pattern Matching, and Virtual Threads. Use for Java language constructs or Java-to-Java upgrades; defer Kotlin, tests, formatting/build tools, CompletableFuture, builder patterns, and isolated null-handling questions.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.