145-java-refactoring-high-performance — Claude Code skill
145-java-refactoring-high-performance — a skill for refactoring Java code for performance: reduce memory allocations, optimize CPU hot paths, and improve syntax. Works with Claude Code, Cursor, GitHub Copilot, and other AI editors.
Apache-2.0 327 installs ★ 465 updated 2026-10-21
npx skills add jabrena/plinth --skill 145-java-refactoring-high-performance -a claude-codeWhat 145-java-refactoring-high-performance does
This skill guides Java performance optimization through profiling-driven techniques. It covers three reference areas: memory allocation (primitives vs. wrappers, escape analysis, data layout), CPU-bound code (loop unrolling, bitwise operations, SIMD), and code shape (APIs, control flow, concurrency, I/O). The workflow starts by identifying a bottleneck and establishing a baseline, then selects the relevant reference section, applies minimal changes, and validates results against real throughput or latency gains.
The skill enforces a measure-first principle: optimize only where profiling shows actual hot spots. Includes bad/good code examples, validation workflows, and safety constraints. Part of the Plinth Toolkit by Juan Antonio Breña Moral.
What it helps with
- optimize Java hot paths based on profiling results
- reduce memory pressure: lower allocations, tune primitives and data layout
- improve CPU-bound algorithms: unroll loops, apply bitwise tricks, explore SIMD
- refactor syntax and control flow to cut latency
- verify performance gains before committing changes
Example prompts for the agent
- Optimize this Java method for performance using a measure-first approach
- Review the code for avoidable memory allocations and object escapes
- Simplify this hot path: reduce branching and unroll the loop
How to install 145-java-refactoring-high-performance
1Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 145-java-refactoring-high-performance -a claude-code2Manually: put the files in place
~/.claude/skills/145-java-refactoring-high-performance/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/145-java-refactoring-high-performance/
1Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 145-java-refactoring-high-performance -a codex2Manually: put the files in place
.agents/skills/145-java-refactoring-high-performance/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 145-java-refactoring-high-performance -a cursor2Manually: put the files in place
.cursor/skills/145-java-refactoring-high-performance/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install jabrena/plinth skills/145-java-refactoring-high-performance2Manually: put the files in place
.github/skills/145-java-refactoring-high-performance/SKILL.md1Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 145-java-refactoring-high-performance -a gemini-cli2Platform CLI
gemini skills install https://github.com/jabrena/plinth --path skills/145-java-refactoring-high-performanceManually: put the files in place
.devin/skills/145-java-refactoring-high-performance/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 145-java-refactoring-high-performance -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 145-java-refactoring-high-performance
How do I install the 145-java-refactoring-high-performance skill in Claude Code?
Run npx skills add jabrena/plinth --skill 145-java-refactoring-high-performance -a claude-code, then open ~/.claude/skills/145-java-refactoring-high-performance/SKILL.md.
What does this skill do?
It guides Java code refactoring for performance: reducing memory allocations, optimizing CPU hot paths, and improving syntax and control flow. It works by analyzing profiling data and applying techniques from three reference modules with before/after examples.
When should I use this skill?
Use it when improving Java application performance and you already have profiling data (JFR, async-profiler, or similar) showing the bottleneck. The skill requires baseline measurements and applies only evidence-backed optimizations.
Source text
SKILL.md · Apache-2.0
--- name: 145-java-refactoring-high-performance description: Use when you need to refactor Java code for high performance — including memory/allocation reduction, CPU hot-path optimization, and syntax/API/control-flow improvements. This should trigger for requests such as Review Java code for high performance; Optimize Java hot path; Reduce Java allocations; Improve Java latency/throughput. Part of Plinth Toolkit license: Apache-2.0 metadata: author: Juan Antonio Breña Moral version: 0.19.0 --- # Java rules for High Performance Identify and apply practical Java high-performance techniques using a measure-first approach, with emphasis on allocation reduction, data layout, concurrency discipline, and evidence-based validation. **What is covered in this Skill?** - Measure-first workflow for Java code optimization - JVM/runtime-aware coding guidance - Allocation reduction techniques with bad/good patterns - CPU hot-path simplification and loop-level efficiency patterns - Concurrency/backpressure and timeout/cancellation discipline - I/O, parsing, and serialization efficiency patterns - Persistence/query and caching strategy guidance - Java-centric decision workflow: keep/revert based on measured impact **Scope:** Practical optimization in application code and APIs. Apply only where profiling indicates real bottlenecks. ## Constraints Performance optimization must be evidence-driven and safe, focused on Java code changes that preserve correctness and maintainability. - **MEASURE-FIRST**: Establish baseline behavior and identify Java code hot paths before optimization - **NO PREMATURE OPTIMIZATION**: Only optimize code paths identified by profiling evidence - **BEFORE APPLYING**: Read the relevant reference(s) for bad/good examples and measurement workflow - **EDGE CASE**: If hotspot evidence is unclear, ask clarifying questions before changing code ## When to use this skill - Review Java code for high performance - Optimize Java hot path - Reduce Java allocations - Improve Java latency - Improve Java throughput ## Workflow 1. **Identify Java hotspot and baseline behavior** Confirm the performance-sensitive Java path and baseline behavior before changing code. 2. **Select the relevant reference(s) by bottleneck** Pick and read only the reference(s) matching the observed hotspot: `references/145-refactoring-high-performance-java-memory-allocation.md` for allocation pressure, primitives vs. wrappers, escape analysis, collection sizing, data layout, and deduplication; `references/145-refactoring-high-performance-java-cpu.md` for CPU-bound hot paths, bit-level parsing, branchless arithmetic, loop unrolling, Unsafe caution, and SIMD/vectorization; `references/145-refactoring-high-performance-java-code-syntax.md` for code shape, lambdas, API return conventions, parsing syntax, I/O strategy, concurrency, and control-flow improvements. 3. **Apply targeted optimizations** Implement minimal, evidence-backed changes scoped to the chosen domain(s): memory/allocation, CPU/low-level, or code shape/control flow (and adjacent concurrency, I/O, and persistence/caching in Java code). 4. **Validate and compare code-level outcomes** Compare before/after behavior and keep only Java code changes with meaningful, verified gains. ## Reference For detailed guidance, examples, and constraints, see: - [references/145-refactoring-high-performance-java-memory-allocation.md](references/145-refactoring-high-performance-java-memory-allocation.md) - [references/145-refactoring-high-performance-java-cpu.md](references/145-refactoring-high-performance-java-cpu.md) - [references/145-refactoring-high-performance-java-code-syntax.md](references/145-refactoring-high-performance-java-code-syntax.md)
© Juan Antonio Breña Moral · Apache-2.0 · jabrena/plinth