code-modernization-expert

A guide for updating older software to newer language versions, frameworks and architectures. It includes assessing the codebase, finding outdated or risky parts, and planning changes in small steps.

In plain words
What is it for?
Use it to plan migrations such as Python 2 to 3, Java 8 to 21, React classes to Hooks, Vue 2 to 3, monoliths to microservices, or callbacks to async code.
Why use it?
It gives structure to modernisation work that can otherwise become a risky, unclear rewrite. It helps identify technical debt, such as duplicated code, vulnerable dependencies, missing tests and tightly connected components.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/ibm-self-serve-assets/building-blocks/code-modernization-java
Any agent
npx skills add ibm-self-serve-assets/building-blocks --skill code-modernization-java
Clone the repo
git clone --depth 1 https://github.com/ibm-self-serve-assets/building-blocks

Made for: Claude Code, Codex.

Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,223 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod 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 $0.00028 $0.01223
Opus 5 $0.00014 $0.00611
Sonnet 5 $0.00006 $0.00245
Haiku 4.5 $0.00003 $0.00122

Measured 2d ago against content hash a916bb723100, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-modernization-expert 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 2d 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.

Origin

This is a copy

100% identical to code-modernization-expert — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

ibm-bob/skills/code-modernization-java/SKILL.md · 195 lines

How it starts

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

Modernize legacy codebases systematically using proven enterprise patterns and automated transformations.

Supported Migrations

  • Languages: Python 2→3, Java 8→21, JavaScript ES5→ES6+, TypeScript
  • Frameworks: React Class→Hooks, Vue 2→3, Spring Boot 2→3, Django, Rails, Angular
  • Architecture: Monolith→Microservices, REST→GraphQL, Callbacks→Async/Await

Use Glob to find all source files. Use Grep to identify:

  • Framework versions (package.json, requirements.txt, pom.xml)
  • Deprecated APIs and imports
  • Code smells (TODO, FIXME, HACK)
  • Security vulnerabilities

Generate Current State Report with:

  • Languages, frameworks, versions
  • Dependency health (outdated, vulnerable)
  • Test coverage percentage
  • Technical risks

See assessment-checklist.md for detailed items.

Categorize debt by severity and effort:

  • Code quality (God classes, long methods, duplicates)
  • Dependencies (EOL frameworks, vulnerable libraries)
  • Testing gaps (low coverage, missing tests)
  • Architecture issues (tight coupling, monolithic design)

Use prioritization matrix in debt-prioritization.md to rank items.

Create inventory with: Severity, Effort, Risk, Impact on velocity.

Choose based on context:

  • Strangler Fig: Large monoliths, zero downtime required → patterns/strangler-fig.md
  • Branch by Abstraction: Internal modules, service layers → patterns/branch-by-abstraction.md
  • Seam-Based: Low test coverage, tightly coupled code → patterns/seam-based.md
  • Parallel Run: Mission-critical, financial, healthcare systems → patterns/parallel-run.md

Generate phased roadmap:

Preparation (1-2 weeks):

  • Set up feature flags
  • Implement monitoring/alerting
  • Generate characterization tests
  • Create rollback procedures (see rollback-template.yaml)

Execution (Iterative per module):

  • Read source files
  • Generate tests capturing current behavior
  • Apply transformations with Edit/MultiEdit
  • Update imports and dependencies
  • Run tests to validate
  • Deploy incrementally (1% → 5% → 25% → 100%)

Validation:

  • Run test suite
  • Perform shadow testing
  • Monitor error rates and latency

Cleanup:

  • Remove legacy code
  • Remove feature flags
  • Update documentation

Apply language-specific changes:

Python 2→3: See migrations/python.md

  • print statements → print()
  • dict.iteritems() → dict.items()
  • Add type hints, dataclasses, f-strings

Java 8→21: See migrations/java.md

  • javax.* → jakarta.*
  • Date → java.time.*
  • POJOs → Records
  • Add pattern matching, text blocks

JavaScript ES5→ES6+: See migrations/javascript.md

  • var → let/const
  • callbacks → async/await
  • prototypes → classes
  • Add template literals, modules

React Class→Hooks: See migrations/react.md

  • constructor+state → useState
  • componentDidMount → useEffect
  • lifecycle methods → hooks

Create comprehensive coverage:

Characterization Tests: Capture current behavior (even if buggy) Golden Master Tests: Record production inputs/outputs Approval Tests: Snapshot complex outputs

See testing-strategies.md for examples.

Use Task tool to delegate test generation when needed.

Implement mitigation:

Risk Registry: Track risks with likelihood, impact, mitigation, owners

Rollback Plan: Define triggers (error rate, latency, bugs), immediate actions, validation steps

Monitoring: Track error rates, latency, business metrics, set alerts

See rollback-template.yaml for complete template.

Generate migration report with:

  • Executive summary (current vs target, approach, timeline)
  • Technical details (files modified, dependencies updated, tests added)
  • Results (statistics, test results, performance impact)
  • Lessons learned and next steps

Read the full file on GitHub · 195 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. 2d ago First seen · 195 lines · 28 tokens per session scan A a916bb723100

Subscribe to this mod's changes

code-modernization-expert is a skill published in the GitHub repository ibm-self-serve-assets/building-blocks (24 stars, last pushed 8d ago), licensed Apache-2.0. It adds 28 tokens to every session and 1,223 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to code-modernization-expert, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens