java-concurrency — Claude Code skill: threads, pools
A skill that gives your coding agent a Java concurrency reference: threads, executors, locks, CompletableFuture and virtual threads.
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-concurrency -a claude-codeWhat java-concurrency does
The skill walks through Java concurrency from the ground up. Thread lifecycle, daemon versus user threads, interrupt handling, then synchronized, volatile, ReentrantLock and atomic operations. Executors come next: ThreadPoolExecutor configuration, ForkJoinPool, and virtual threads from Java 21. A separate section covers CompletableFuture — async execution, chaining, exception handling.
Two reference tables do most of the practical work. One sizes thread pools: for CPU-bound work it suggests the core count, for I/O-bound work a formula based on the wait-to-compute ratio. The other maps symptoms to causes — deadlock from circular locking, race conditions from missing synchronization, thread starvation from unfair scheduling. For stuck processes it lists jstack -l <pid> and jcmd <pid> Thread.print.
The java_version parameter defaults to 21, so the virtual thread examples assume that release. On an older JDK that section will not compile, which is worth checking before you let the agent touch your code. The skill is invoked with Skill("java-concurrency").
What it helps with
- write a thread-safe class without race conditions
- size a thread pool for the actual workload
- move a chain of calls onto
CompletableFuture - diagnose a hang from a thread dump
- migrate from platform threads to virtual threads on Java 21
Example prompts for the agent
- Review this class for race conditions and tell me where a
ReentrantLockbelongs - Configure a
ThreadPoolExecutorfor I/O-bound work and explain the pool size - Rewrite these sequential calls as
CompletableFuturewith a timeout
How to install java-concurrency
1Skills CLI (Vercel)
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-concurrency -a claude-code2Manually: put the files in place
~/.claude/skills/java-concurrency/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/java-concurrency/
1Skills CLI (Vercel)
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-concurrency -a codex2Manually: put the files in place
.agents/skills/java-concurrency/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-concurrency -a cursor2Manually: put the files in place
.cursor/skills/java-concurrency/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install pluginagentmarketplace/custom-plugin-java java-concurrency2Manually: put the files in place
.github/skills/java-concurrency/SKILL.md1Skills CLI (Vercel)
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-concurrency -a gemini-cli2Platform CLI
gemini skills install https://github.com/pluginagentmarketplace/custom-plugin-java --path skills/java-concurrencyManually: put the files in place
.devin/skills/java-concurrency/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-concurrency -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about java-concurrency
How do I install java-concurrency in Claude?
Run npx skills add pluginagentmarketplace/custom-plugin-java --skill java-concurrency -a claude-code. The skill lands in ~/.claude/skills/java-concurrency/SKILL.md.
What does java-concurrency do?
It hands the agent a Java concurrency reference: threads, synchronization, executors, CompletableFuture and virtual threads, plus tables for pool sizing and hang diagnosis.
Which Java version does it need?
The java_version parameter defaults to 21, and the virtual thread examples target that release. On an older JDK that section will not compile.