/java-core:java-refactor [paste code or select in editor]from java-core
Refactors Java code with version-gated suggestions (lambdas, streams, records, pattern matching). Detects target version from build files and applies safe refactorings like extract method, rename, and dead code removal.
Ships in java-core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Refactor the Java code I've selected or provided. Follow these steps:
Check pom.xml (<java.version> or <maven.compiler.source>) or build.gradle (sourceCompatibility). If not found, ask: "What Java version are you targeting? (8, 11, 17, 21, or other)"
These refactorings are safe regardless of Java version:
static final constantsState the minimum Java version required for each suggestion:
new Comparator<String>() { ... } → (a, b) -> a.compareTo(b)list.stream().filter(...).collect(Collectors.toList())return null → return Optional.empty()new ArrayList<>(Arrays.asList(...)) → List.of(...)recordif (obj instanceof String) { String s = (String) obj; } → if (obj instanceof String s)For each refactoring:
Then offer: "Want me to apply these changes to the file?"
After completing refactoring:
/java-test to generate tests/java-docs to update Javadocmvn compile -q or ./gradlew build -qWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ducpm2303/claude-java-plugins --plugin java-core14 skills in this plugin
/java-adr/java-adr — Architecture Decision RecordsCreates, lists, and manages Architecture Decision Records for Java projects. Use when user asks to "create an ADR", "document this decision", "write an architecture decision", "add ADR", "list decisions", "show ADRs", or "record this architectural choice"./java-api-reviewStep 1 — HTTP method and status code correctnessReviews Java REST API design including HTTP methods, status codes, naming, and versioning. Use when user asks to "review my API", "check REST design", "is this good REST", "review endpoints", "API design review", "check my controller", or "review HTTP API"./java-Other plugins' skills for the same job