/java-fix
Diagnoses and fixes Java compile errors, runtime exceptions, and stack traces. Use when user asks to "fix this error", "this won't compile", "I'm getting an exception", "debug this", or "build is failing".
$ npx -y skills add ducpm2303/claude-java-plugins --skill java-fix --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/java-fix
Context preview
The summary Claude sees to decide when to auto-load this skill.
Diagnoses and fixes Java compile errors, runtime exceptions, and stack traces. Use when user asks to "fix this error", "this won't compile", "I'm getting an exception", "debug this", or "build is failing".
SKILL.md
java-fix.SKILL.mddescription: Diagnoses and fixes Java compile errors, runtime exceptions, and stack traces. Use when user asks to "fix this error", "this won't compile", "I'm getting an exception", "debug this", or "build is failing".
argument-hint: "[paste error message or stack trace]"
Diagnose the Java error or stack trace I've provided and propose a fix. Be specific — do not give generic advice.
Step 1 — Identify the error type
**Compile errors (javac / Maven / Gradle output):**
- `cannot find symbol` → missing import, misspelled name, or wrong scope
- `incompatible types` → type mismatch; check generics, autoboxing, widening
- `method X is not applicable` → wrong number or types of arguments
- `variable X might not have been initialized` → missing initialisation on all code paths
- `reached end of file while parsing` → unmatched `{` or `}`
- `class X is public, should be declared in a file named X.java` → filename mismatch
**Runtime exceptions (stack traces):**
- `NullPointerException` → identify the line; determine which reference is null; suggest a null check or Optional
- `ClassCastException` → show the actual vs expected type; fix the cast or use instanceof first
- `ArrayIndexOutOfBoundsException` → check loop bounds and array length
- `StackOverflowError` → identify the recursive call; check base case
- `ConcurrentModificationException` → iterating and modifying a collection simultaneously; suggest iterator.remove() or a copy
- `IllegalArgumentException` / `IllegalStateException` → read the message; check the API contract
Step 2 — Find the root cause
Read the full error message carefully. The root cause is usually the last "Caused by:" in a stack trace. Show the user: 1. The exact line causing the error (if visible in the stack trace) 2. Why that line fails
Step 3 — Propose the fix
Show: 1. The problematic code (before) 2. The corrected code (after) 3. One sentence explaining what was wrong
If the fix requires reading a file not currently shown, ask for it: "Can you share the contents of `ClassName.java`? I need to see [specific thing]."
Step 4 — Prevent recurrence
Add one short note on how to avoid this class of error in the future (e.g., "Use `Objects.requireNonNull()` at method entry to catch nulls early").
Next Steps
After applying the fix:
- Suggest running the build to verify: `mvn compile -q` or `./gradlew build -q`
- If the fix changed business logic → suggest running `/java-test` to verify behaviour is preserved
- If the root cause was a design problem → suggest running `/java-review` on the surrounding code
Read more
description: Diagnoses and fixes Java compile errors, runtime exceptions, and stack traces. Use when user asks to "fix this error", "this won't compile", "I'm getting an exception", "debug this", or "build is failing". argument-hint: "[paste error message or stack trace]"
Diagnose the Java error or stack trace I've provided and propose a fix. Be specific — do not give generic advice.
Step 1 — Identify the error type
**Compile errors (javac / Maven / Gradle output):**
- `cannot find symbol` → missing import, misspelled name, or wrong scope
- `incompatible types` → type mismatch; check generics, autoboxing, widening
- `method X is not applicable` → wrong number or types of arguments
- `variable X might not have been initialized` → missing initialisation on all code paths
- `reached end of file while parsing` → unmatched `{` or `}`
- `class X is public, should be declared in a file named X.java` → filename mismatch
**Runtime exceptions (stack traces):**
- `NullPointerException` → identify the line; determine which reference is null; suggest a null check or Optional
- `ClassCastException` → show the actual vs expected type; fix the cast or use instanceof first
- `ArrayIndexOutOfBoundsException` → check loop bounds and array length
- `StackOverflowError` → identify the recursive call; check base case
- `ConcurrentModificationException` → iterating and modifying a collection simultaneously; suggest iterator.remove() or a copy
- `IllegalArgumentException` / `IllegalStateException` → read the message; check the API contract
Step 2 — Find the root cause
Read the full error message carefully. The root cause is usually the last "Caused by:" in a stack trace. Show the user: 1. The exact line causing the error (if visible in the stack trace) 2. Why that line fails
Step 3 — Propose the fix
Show: 1. The problematic code (before) 2. The corrected code (after) 3. One sentence explaining what was wrong
If the fix requires reading a file not currently shown, ask for it: "Can you share the contents of `ClassName.java`? I need to see [specific thing]."
Step 4 — Prevent recurrence
Add one short note on how to avoid this class of error in the future (e.g., "Use `Objects.requireNonNull()` at method entry to catch nulls early").
Next Steps
After applying the fix:
- Suggest running the build to verify: `mvn compile -q` or `./gradlew build -q`
- If the fix changed business logic → suggest running `/java-test` to verify behaviour is preserved
- If the root cause was a design problem → suggest running `/java-review` on the surrounding code
A Claude Code plugin marketplace with 3 focused plugins for Java developers. All plugins support Java 8 through Java 21 and tailor advice to your target Java version.
Other skills on claude-java-plugins.
- /java-adr
Creates, 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".
Open skill - /java-api-review
Reviews 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".
Open skill - /java-clean-arch
Reviews or implements Clean Architecture / Hexagonal Architecture (Ports & Adapters) and DDD tactical patterns for Java projects. Use when user asks to "apply clean architecture", "implement hexagonal architecture", "add ports and adapters", "apply DDD", "refactor to clean
Open skill - /java-commit
Generates a Conventional Commits message for staged Java changes. Use when user asks to "write a commit message", "help me commit", "what should my commit say", "summarize my changes", "draft a commit", or "create commit message".
Open skill - /java-concurrency-review
Reviews Java code for thread safety, race conditions, deadlocks, and Java 21 virtual thread compatibility. Use when user asks to "review concurrency", "is this thread safe", "check for race conditions", "concurrency issues", or "virtual thread compatible".
Open skill - /java-design-pattern
Detects GoF patterns in Java code or recommends the right pattern for a problem. Use when user asks to "what pattern is this", "detect design patterns", "suggest a pattern", "should I use factory", "which design pattern", or "recommend a pattern for".
Open skill

