java-review-patterns

java-review-patterns is a skill for Claude Code, Codex from mickeyyaya/refactoring-skills. It costs 82 tokens per session (4,476 once invoked), scanned A, original, MIT.

A guide for reviewing Java code, including null handling, streams, concurrency, resource cleanup, generics, immutability, and common Java design mistakes. Java is a programming language with older and newer APIs that often appear together in production code.

In plain words
What is it for?
Use it when reviewing Java changes involving services, databases, background tasks, generics, streams, threads, asynchronous work, or resource management.
Why use it?
It helps reviewers catch Java-specific crashes, unsafe thread behavior, resource leaks, and misleading uses of features such as Optional, streams, synchronized blocks, and CompletableFuture.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when reviewing Java changes involving services, databases, background tasks, generics, streams, threads, asynchronous work, or resource management.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mickeyyaya/refactoring-skills/java-review-patterns
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mickeyyaya/refactoring-skills --skill java-review-patterns
Clone the repo
git clone --depth 1 https://github.com/mickeyyaya/refactoring-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for java-review-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/mickeyyaya/refactoring-skills/java-review-patterns/github.svg)](https://agentmods.dev/skills/mickeyyaya/refactoring-skills/java-review-patterns)
Your own site
<a href="https://agentmods.dev/skills/mickeyyaya/refactoring-skills/java-review-patterns"><img src="https://agentmods.dev/badge/skills/mickeyyaya/refactoring-skills/java-review-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for java-review-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/mickeyyaya/refactoring-skills/java-review-patterns"><img src="https://agentmods.dev/badge/skills/mickeyyaya/refactoring-skills/java-review-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 82 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,476 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00082 $0.04476
Opus 5.5 $0.00033 $0.01790
Sonnet 5.5 $0.00016 $0.00895
Haiku 4.5 $0.00008 $0.00448

Measured 3mo ago against content hash 5ec7982bb600, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

java-review-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/java-review-patterns/SKILL.md · 451 lines

How it starts

The opening of the file, as written. The whole thing — 451 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Java Code Review Patterns

Overview

Java's size and long history create a distinct review challenge: the language has grown from Java 1 to Java 21 without removing legacy APIs, leaving reviewers to distinguish safe modern idioms from outdated patterns still present in production codebases.

Three forces drive Java-specific review mistakes. First, null is pervasive — NullPointerException remains the most common runtime crash, and Optional was introduced in Java 8 to address this but is frequently misused. Second, the Stream API enables elegant functional pipelines but introduces subtle bugs when side effects, infinite sequences, or parallelism are mixed in carelessly. Third, Java's threading model predates structured concurrency, and the synchronized keyword is still widely used, often with scope wider than necessary, while newer tools like CompletableFuture introduce their own error-swallowing traps.

Load this skill when reviewing any Java PR that touches service logic, data access, background tasks, or concurrent processing. Cross-reference review-accuracy-calibration before posting — Java has moderate false positive risk in the generics and concurrency sections, where correct-looking code can be intentionally chosen over the more idiomatic form.

Quick Reference

Review Dimension Severity Primary Red Flag
Optional.get() without isPresent HIGH opt.get() without guard — throws NoSuchElementException
Optional as field or parameter MEDIUM Optional<T> stored in a struct or passed as method arg
Null returned where Optional expected MEDIUM Method declared to return Optional but returns null
Side effect in stream pipeline HIGH .forEach(list::add) or mutation inside .map()
Infinite stream without limit HIGH Stream.iterate(...) with no .limit() or .takeWhile()
Heavy work in parallel stream MEDIUM .parallelStream() on CPU-bound ops sharing a common pool
synchronized scope too wide MEDIUM Entire method synchronized when only 3 lines need a lock
CompletableFuture swallowed error HIGH .thenApply(...) chain with no .exceptionally() or .handle()
ThreadLocal not cleaned up HIGH ThreadLocal.set() in a request handler with no remove()
Raw generic type MEDIUM List list = new ArrayList() — unchecked operations
Mutable collection returned MEDIUM return this.items exposes internal state directly
Checked exception in lambda MEDIUM Checked exception caught and swallowed inside a lambda
Static mutable state HIGH private static List<X> mutated by instance methods
Resource not in try-with-resources HIGH Connection c = ds.getConnection() outside try-with-resources

Read the full file on GitHub · 451 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 451 lines · 82 tokens per session scan A 5ec7982bb600

Subscribe to this mod's changes

java-review-patterns is a skill published in the GitHub repository mickeyyaya/refactoring-skills (7 stars, last pushed 8mo ago), licensed MIT. It adds 82 tokens to every session and 4,476 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

java-review-patterns compared with skills from other repositories

java-review-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
java-review-patternsmickeyyaya/refactoring-skillsSkill78mo agoMITA82Claude Code, Codex
solid-principlesdecebals/claude-code-javaSkill7801mo agoMITA73Claude Code, Codex
concurrency-reviewdecebals/claude-code-javaSkill7801mo agoMITA58Claude Code, Codex
java-code-reviewdecebals/claude-code-javaSkill7801mo agoMITA45Claude Code, Codex
814-regulations-iso-25010jabrena/plinthSkill469yesterdayApache-2.0A83Claude Code, Codex
121-java-object-oriented-designjabrena/plinthSkill469yesterdayApache-2.0A107Claude Code, Codex
053-design-simple-rulesjabrena/plinthSkill469yesterdayApache-2.0A86Claude Code, Codex