/code-modernization:modernize-transform <system-dir> <module> <target-stack>from code-modernization
Transforms a single legacy module into a modern stack with behavior-equivalence tests. Supports strangler-fig migrations with characterization tests, idiomatic rewrite, and side-by-side review.
Ships in code-modernization. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
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/.
Read the source module and any business rules in analysis/$1/BUSINESS_RULES.md
that reference it. Then enter plan mode and present:
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."
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>
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 SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub minhthang1009/dotclaude --plugin code-modernization7 skills in this plugin
/modernize-assessThis skill should be used when the user asks to assess a legacy system for modernization ('modernize assess', 'danh gia he thong legacy') - full discovery and portfolio analysis: inventory, complexity, technical debt, effort estimation./modernize-briefThis skill should be used when the user asks to generate a phased Modernization Brief ('modernize brief', 'len ke hoach modernize') - the approved plan that transformation agents execute against./modernize-extract-rulesThis skill should be used when the user asks to mine business logic from legacy code into testable, human-readable rule specifications ('extract business rules', 'trich xuat business logic tu legacy')./modernize-hardenThis skill should be used when the user asks for a security vulnerability scan with a reviewable remediation patch on legacy code ('modernize harden', 'security scan legacy') - OWASP, CWE, CVE, secrets, injection./modernize-mapThis skill should be used when the user asks to map dependencies and topology of a legacy system ('modernize map', 've dependency graph he thong legacy') - call graphs, data lineage, batch flows rendered as navigable diagrams./modernize-reimagineThis skill should be used when the user asks for a multi-agent greenfield rebuild of a legacy system ('modernize reimagine', 'rebuild tu specs') - extract specs from legacy, design AI-native, scaffold and validate with human-in-the-loop.Other plugins' skills for the same job