/code-modernization:modernize-transform <system-dir> <module> <target-stack>from code-modernization
Transforms a single legacy module to the specified target stack, producing an idiomatic rewrite with behavioral equivalence tests and characterization tests.
Ships in code-modernization. Installing the plugin adds it to Claude Code.
Transform legacy/$1 module $2 into $3, with proof of behavioral
equivalence.
This is a surgical, single-module transformation — one vertical slice of the
strangler fig. Output goes to modernized/$1/$2/.
Verify the build environment before planning, not when the tests first run:
java -version + mvn -v, node -v + npm -v,
python3 -V + pytest --version, …). If any are missing, stop and
report what to install — the new code and its tests cannot run without
them, so a plan gate now would just defer the failure an hour. Suggest
/modernize-preflight $1 $3 for the full readiness report.cobc -fsyntax-only). Legacy
code often cannot build locally by nature, not by misconfiguration —
CICS/IMS programs have no local translator, and the real runtime may be
a mainframe you don't have. A failed or impossible legacy compile does
not stop the transform; it changes the equivalence strategy:
Read the source module and any business rules in analysis/$1/BUSINESS_RULES.md
that reference it. Then present the plan and stop — write no code until
the user explicitly approves (use plan mode if the session supports it):
Wait for approval before writing any code.
Before writing target code, spawn the test-engineer subagent:
"Write characterization tests for legacy/$1 module $2. Read the source,
identify every observable behavior, and encode each as a test case with
concrete input → expected output pairs derived from the legacy logic.
Target framework: <appropriate for $3>. Write to
modernized/$1/$2/src/test/. These tests define 'done' — the new code
must pass all of them. Follow your secret-handling rules: no credential
literal from legacy code becomes a fixture; substitute fake same-shape
values and read anything genuinely live from environment variables."
Show the user the test file. Get a 👍 before proceeding.
Write the target implementation in modernized/$1/$2/src/main/.
Critical: Write code a senior $3 engineer would write from the
specification, not from the legacy structure. Do NOT mirror COBOL paragraphs
as methods, do NOT preserve legacy variable names like WS-TEMP-AMT-X.
Use the target language's idioms: records/dataclasses, streams, dependency
injection, proper error types, etc.
Include: domain model, service logic, API surface (REST controller or equivalent), and configuration. Add concise Javadoc/docstrings linking each class back to the rule IDs it implements.
Run the characterization tests:
cd modernized/$1/$2 && <appropriate test command for $3>
Show the output. If anything fails, fix and re-run until green.
Generate modernized/$1/$2/TRANSFORMATION_NOTES.md:
Then show a visual diff of one representative behavior, legacy vs modern:
delta --side-by-side <(sed -n '<lines>p' legacy/$1/<file>) modernized/$1/$2/src/main/<file>
(Fall back to diff -y --width=160 if delta isn't installed.) Never
pick a credential-bearing line range for this diff, and mask any
credential-like literal quoted in TRANSFORMATION_NOTES.md — the notes
live in modernized/ and get committed.
Spawn the architecture-critic subagent to review the transformed code against $3 best practices. Apply any HIGH-severity feedback; list the rest in TRANSFORMATION_NOTES.md.
Report: tests passing, lines of legacy retired, location of artifacts.
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
10 commands in this plugin
/modernize-assessPortfolio mode (`--portfolio <parent-dir>`)Full discovery & portfolio analysis of a legacy system — inventory, complexity, debt, relative scale/modernize-briefThe BriefGenerate a phased Modernization Brief — the approved plan that transformation agents will execute against/modernize-extract-rulesMethod A — Workflow orchestration (preferred when available)Mine business logic from legacy code into testable, human-readable rule specifications/modernize-hardenStep 0 — Secrets quarantine setupSecurity vulnerability scan with a reviewable remediation patch — OWASP, CWE, CVE, secrets, injection/modernize-mapWhat to produceDependency & topology mapping — call graphs, data lineage, batch flows, rendered as navigable diagrams/modernize-preflightCheck 1 — Detect the stackEnvironment readiness check — analysis tools, build toolchain, source completeness, telemetry accessGenerated from the plugin's indexed repository (jrezelorezo/gh-repo-clone-anthropics-claude-plugins-official) — no native marketplace selected
npx claudepluginhub p/jrezelorezo-code-modernization-plugins-code-modernization3 plugins ship this exact command · first indexed Jun 23, 2026
Other plugins' commands for the same job