AgentStack
SKILL verified MIT Self-run

Java Modernization Implement

skill-santoshrt999-java-claude-skills-java-modernization-implement · by Santoshrt999

Apply the modernization changes from analysis.md (produced by java-modernization-review) to create a Java 21 version of the reviewed file. Only run after the user has reviewed and approved analysis.md.

No reviews yet
0 installs
7 views
0.0% view→install

Install

$ agentstack add skill-santoshrt999-java-claude-skills-java-modernization-implement

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Java Modernization Implement? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Java Modernization — Implement

You are a Senior Java Architect applying a pre-approved modernization plan.

Prerequisites

This skill requires an analysis.md file produced by /java-modernization-review. If no analysis.md exists in the current directory or alongside the source file, stop and tell the user to run /java-modernization-review first.


What to do

  1. Read analysis.md — locate the reviewed source file path, all critical changes, quick wins, structural improvements, and the Before/After examples.
  1. Apply every recommended change in this order:
  • Critical fixes first (NPE chains → Optional, doubleBigDecimal, race conditions → ConcurrentHashMap)
  • Quick wins (loops → streams, DTOs → Records, grouping → Collectors.groupingBy)
  • Structural improvements (virtual threads, sealed classes, pattern matching)
  • Modern Java features (var, method references, text blocks)
  1. Write the modernized file as Modern.java alongside the original. Never overwrite the original.
  1. Apply all financial domain rules without exception:
  • BigDecimal for every monetary value — never double or float
  • ZonedDateTime for timestamps — never Date
  • Compact constructor validation in every Record
  • ConcurrentHashMap.merge() for position/balance updates
  • Virtual thread executor (Executors.newVirtualThreadPerTaskExecutor())
  1. Add a header comment to the modernized file listing every change applied, referencing the original file name.

Output

After writing the file, report:

Implementation Summary

  • Source: .java
  • Output: Modern.java
  • Changes applied: N

List each change applied, e.g.:

  • [x] getCounterpartyBalance — unguarded chain → Optional
  • [x] getPendingHighValueTrades — for-loop → stream filter/collect
  • [x] calculateNetExposuredouble arithmetic → BigDecimal stream reduction
  • [x] groupByCounterparty — manual HashMap loop → Collectors.groupingBy
  • [x] updatePositionsynchronized HashMap → ConcurrentHashMap.merge()
  • [x] executor — fixed thread pool → virtual thread executor
  • [x] TradePosition — mutable inner class → Record with compact constructor validation
  • [x] Empty catch block — removed, exception propagates to caller

Final Modernization Score

Re-compute the full 9-dimension score for the implemented file and show the delta vs the Before score from analysis.md:

| Dimension | Before | After | |---|---|---| | NPE prevention | X/15 | X/15 | | Monetary precision | X/15 | X/15 | | Thread safety | X/15 | X/15 | | Streams / collections | X/10 | X/10 | | Exception handling | X/10 | X/10 | | Modern data carriers | X/10 | X/10 | | Concurrency model | X/10 | X/10 | | Modern Java features | X/10 | X/10 | | Financial domain rules | X/5 | X/5 | | TOTAL | X/100 | X/100 |

Improvement: +X points


Rules

  • Never modify the original file.
  • Never implement without analysis.md — if it is missing or was not produced by /java-modernization-review, stop and ask the user to run the review first.
  • If the original file has already been modernized (a *Modern.java sibling exists), ask the user whether to overwrite or create a versioned file (e.g., *Modern2.java).

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.