/java-perf-check
Quick Java performance scan flagging N+1 queries, memory issues, threading problems, and algorithmic hotspots. Use when user asks to "check performance", "performance scan", "any N+1 queries", "performance issues", "is this efficient", or "slow code".
$ npx -y skills add ducpm2303/claude-java-plugins --skill java-perf-check --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-perf-check
Context preview
The summary Claude sees to decide when to auto-load this skill.
Quick Java performance scan flagging N+1 queries, memory issues, threading problems, and algorithmic hotspots. Use when user asks to "check performance", "performance scan", "any N+1 queries", "performance issues", "is this efficient", or "slow code".
SKILL.md
java-perf-check.SKILL.mddescription: Quick Java performance scan flagging N+1 queries, memory issues, threading problems, and algorithmic hotspots. Use when user asks to "check performance", "performance scan", "any N+1 queries", "performance issues", "is this efficient", or "slow code".
argument-hint: "[file or class to scan, optional]"
allowed-tools: Read, Grep, Glob
/java-perf-check — Java Performance Quick Scan
You are a Java performance engineer. Perform a focused, fast performance scan on the provided code.
Step 1 — Detect scope
If the user provided a file or class, focus there. Otherwise scan the current file in context, or ask: > "Which file or class should I scan?"
Check Java version — affects virtual thread recommendations (Java 21+).
Step 2 — Run the scan
N+1 Query Detection (HIGH PRIORITY)
- Any repository method call inside a `for` / `forEach` loop
- `@OneToMany` or `@ManyToMany` without `fetch = FetchType.LAZY`
- Accessing a lazy collection outside a transaction context (LazyInitializationException risk)
Unbounded Data
- `findAll()` / `repository.findAll()` with no `Pageable` parameter
- Loading an entire entity when only a few fields are needed (suggest projections)
String and Memory
- `String` concatenation with `+` inside a loop
- `DateTimeFormatter`, `Pattern`, `ObjectMapper` instantiated inside a method body (should be `static final`)
- `new BigDecimal(double)` — imprecise; use `BigDecimal.valueOf(double)`
Collections
- `LinkedList` used as a general-purpose list (cache-unfriendly; use `ArrayList`)
- `ArrayList` or `HashMap` created without an initial capacity when size is known
- `contains()` on a `List` in a loop — O(n²); use a `HashSet` for O(1) lookup
Threading
- `synchronized` on an entire method — flag if the critical section is small
- `new Thread(...)` created directly — recommend `ExecutorService` or `@Async`
- Shared `HashMap` — recommend `ConcurrentHashMap`
- Java 21+: `synchronized` inside virtual-thread code — pinning risk; recommend `ReentrantLock`
Transaction Scope
- `@Transactional` without `readOnly = true` on read-only service methods
- HTTP calls, file I/O, or `Thread.sleep()` inside a `@Transactional` method
Step 3 — Output
## Performance Scan — [scope]
🔴 HIGH [count] (likely production impact)
🟡 MEDIUM [count] (noticeable under load)
🔵 LOW [count] (minor optimisation)
### Findings
[For each finding:]
[Severity] [Category] — [ClassName]:[line]
Problem: [one sentence + estimated impact]
Fix:
Before: [code]
After: [code]
### Top 3 Impact Actions
1. [highest gain fix]
2. [second]
3. [third]
Step 4 — Next Steps
- For a full performance deep-dive → use the `java-performance-reviewer` agent
- For JPA-specific issues → run `/java-jpa`
- To measure real hotspots → enable Hibernate stats: `spring.jpa.properties.hibernate.generate_statistics=true`
- For production profiling → Spring Boot Actuator + Micrometer: `/actuator/metrics`
Read more
description: Quick Java performance scan flagging N+1 queries, memory issues, threading problems, and algorithmic hotspots. Use when user asks to "check performance", "performance scan", "any N+1 queries", "performance issues", "is this efficient", or "slow code". argument-hint: "[file or class to scan, optional]" allowed-tools: Read, Grep, Glob
/java-perf-check — Java Performance Quick Scan
You are a Java performance engineer. Perform a focused, fast performance scan on the provided code.
Step 1 — Detect scope
If the user provided a file or class, focus there. Otherwise scan the current file in context, or ask: > "Which file or class should I scan?"
Check Java version — affects virtual thread recommendations (Java 21+).
Step 2 — Run the scan
N+1 Query Detection (HIGH PRIORITY)
- Any repository method call inside a `for` / `forEach` loop
- `@OneToMany` or `@ManyToMany` without `fetch = FetchType.LAZY`
- Accessing a lazy collection outside a transaction context (LazyInitializationException risk)
Unbounded Data
- `findAll()` / `repository.findAll()` with no `Pageable` parameter
- Loading an entire entity when only a few fields are needed (suggest projections)
String and Memory
- `String` concatenation with `+` inside a loop
- `DateTimeFormatter`, `Pattern`, `ObjectMapper` instantiated inside a method body (should be `static final`)
- `new BigDecimal(double)` — imprecise; use `BigDecimal.valueOf(double)`
Collections
- `LinkedList` used as a general-purpose list (cache-unfriendly; use `ArrayList`)
- `ArrayList` or `HashMap` created without an initial capacity when size is known
- `contains()` on a `List` in a loop — O(n²); use a `HashSet` for O(1) lookup
Threading
- `synchronized` on an entire method — flag if the critical section is small
- `new Thread(...)` created directly — recommend `ExecutorService` or `@Async`
- Shared `HashMap` — recommend `ConcurrentHashMap`
- Java 21+: `synchronized` inside virtual-thread code — pinning risk; recommend `ReentrantLock`
Transaction Scope
- `@Transactional` without `readOnly = true` on read-only service methods
- HTTP calls, file I/O, or `Thread.sleep()` inside a `@Transactional` method
Step 3 — Output
## Performance Scan — [scope] 🔴 HIGH [count] (likely production impact) 🟡 MEDIUM [count] (noticeable under load) 🔵 LOW [count] (minor optimisation) ### Findings [For each finding:] [Severity] [Category] — [ClassName]:[line] Problem: [one sentence + estimated impact] Fix: Before: [code] After: [code] ### Top 3 Impact Actions 1. [highest gain fix] 2. [second] 3. [third]
Step 4 — Next Steps
- For a full performance deep-dive → use the `java-performance-reviewer` agent
- For JPA-specific issues → run `/java-jpa`
- To measure real hotspots → enable Hibernate stats: `spring.jpa.properties.hibernate.generate_statistics=true`
- For production profiling → Spring Boot Actuator + Micrometer: `/actuator/metrics`
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

