cd /news/developer-tools/i-built-a-claude-code-skill-that-sco… · home topics developer-tools article
[ARTICLE · art-4261] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

I built a Claude Code skill that scores your legacy Java code 1–100 and modernizes it to Java 21

A two-skill Claude Code plugin designed to analyze and modernize legacy Java 8 codebases to Java 21. The first skill, `/java-modernization-review`, analyzes a Java file and generates a scored report (1–100) across nine dimensions like NPE prevention and thread safety, while the second skill, `/java-modernization-implement`, applies the recommended changes without overwriting the original file. The tool is specifically aimed at developers working on legacy systems or preparing for banking roles, using financial domain examples such as trade processors and FX arithmetic.

read3 min views9 publishedMay 21, 2026

If you're working on a Java 8 codebase — or trying to break into banking and legacy system roles — this article is for you. Every Java 8 codebase has the same problems. You know they exist, but finding and fixing them across 50,000 lines is slow: double for monetary values → silent FX precision loss in productionorder.getCounterparty().getAccount( ).getBalance() → NPE in settlementsynchronized HashMap → race conditions under concurrent trade loadExecutors.newFixedThreadPool(200) → bottleneck at peak volumeA two-skill Claude Code plugin that acts as a Senior Java Architect: Skill 1 — /java-modernization-review Analyzes your Java file, saves a full report to analysis.md , and stops. You review it before any code is touched. Skill 2 — /java-modernization-implement Reads analysis.md , applies every change, writes *Modern.java alongside the original. Never overwrites your file. Every review produces a Before/After score

across 9 dimensions (100 points total):
## Scoring breakdown (100 points total)

🔴 NPE prevention — 15 pts 🔴 Monetary precision (BigDecimal) — 15 pts 🔴 Thread safety — 15 pts 🟡 Streams & collections — 10 pts 🟡 Exception handling — 10 pts 🟡 Modern data carriers (Records) — 10 pts 🟡 Concurrency model (virtual threads) — 10 pts 🟡 Modern Java features — 10 pts 🟢 Financial domain rules — 5 pts Legacy code the skill flagged as critical:

// C1 — NPE: any of these can be null
return order.getCounterparty().getAccount().getB
alance();
// C2 — Precision loss on every FX trade
double total = 0.0;
total += t.getAmount() * t.getFxRate();
// C2 — Precision loss on every FX trade
double total = 0.0;
total += t.getAmount() * t.getFxRate();
// C3 — Race condition on position updates
private HashMap<String, Double> positionMap = new HashMap<>();
public synchronized void updatePosition(String cp, double delta) {
Double current = positionMap.get(cp);
positionMap.put(cp, current == null ? delta : current + delta);
}
// C4 — Swallowed settlement failure
} catch (Exception e) {
// TODO: handle later
}
After /java-modernization-implement:
// C1 fixed — Optional chain, no NPE possible
public BigDecimal getCounterpartyBalance(Order order) {
return Optional.ofNullable(order)
.map(Order::getCounterparty)
.map(Counterparty::getAccount)
.map(Account::getBalance)
.orElseThrow(() -> new IllegalArgumentException("Account balance unavailable"));
}
// C2 + C3 fixed — BigDecimal stream + lock-free map
private final ConcurrentHashMap<String, BigDecimal> positionMap = new
ConcurrentHashMap<>();
public void updatePosition(String counterparty, BigDecimal delta) {
positionMap.merge(counterparty, delta, BigDecimal::add);
}
// Java 21 — virtual threads
private final ExecutorService executor = Executors.newVirtualThreadPerTaskExecutor();

What it covers — every Java release from 9 to 21 Step 1 — /java-modernization-review → Analyzes file → Saves analysis.md → Stops and waits for your approvalStep 2 — /java-modernization-implement → Reads analysis.md → Applies every change → Writes *Modern.java (original untouched) → Prints final score + delta Full source code and the TradeProcessor example are in the repo: 👉 AI-powered Java code modernization skill for Claude Code. Analyzes legacy Java, generates a prioritized upgrade report, scores it 1–100, and applies every change — all inside your editor. Migrating Java 8 code to Java 21 is high-value but tedious — every codebase has the same problems: This skill acts as a Senior Java Architect in your Claude Code session. It knows every Java feature from 8 through 21, enforces financial-domain safety rules, and produces code you can ship — not just advice. Again, if you're working on a Java 8 codebase — or trying to break into banking and legacy system roles — this repo is built for you. The financial domain examples are intentional: trade processors, FX arithmetic, position maps, settlement logic. That's the code you'll actually face in banking interviews and on the job. Practice modernizing it here before you touch production. Curious what scores you're seeing on your own codebases. Drop them in the comments.

── more in #developer-tools 4 stories · sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/i-built-a-claude-cod…] indexed:0 read:3min 2026-05-21 ·