/code-modernization:modernize-assess <system-dir> | --portfolio <parent-dir>from code-modernization
Assesses legacy systems for modernization via 'modernize assess'. Performs inventory, complexity, technical debt, and COCOMO-II effort estimation. Supports single-system and portfolio modes.
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.
Mode select. If $ARGUMENTS starts with --portfolio, run Portfolio
mode against the directory that follows. Otherwise run Single-system
mode against legacy/$1.
--portfolio <parent-dir>)Sweep every immediate subdirectory of the parent dir and produce a heat-map a steering committee can use to sequence a multi-year program.
For each subdirectory <sys>:
cloc --quiet --csv <parent>/<sys> # LOC by language
lizard -s cyclomatic_complexity <parent>/<sys> 2>/dev/null | tail -1
If cloc/lizard are not installed, fall back to scc <parent>/<sys>
(LOC + complexity) or find + wc -l grouped by extension, and estimate
complexity by counting decision keywords per file. Note which tool you used.
Capture: total SLOC, dominant language, file count, mean & max
cyclomatic complexity (CCN). For dependency freshness, locate the
manifest (package.json, pom.xml, *.csproj, requirements*.txt,
copybook dir) and note its age / pinned-version count.
Compute person-months per system using COCOMO-II basic:
PM = 2.94 × (KSLOC)^1.10 (nominal scale factors). Show the formula and
inputs so the figure is defensible, not a guess.
For each system, count source files with vs without a header comment
block, and list architecture docs present (README, docs/, ADRs).
Report coverage % and the top undocumented subsystems.
Write analysis/portfolio.html (dark #1e1e1e bg, #d4d4d4 text,
#cc785c accent, system-ui font, all CSS inline). One row per system;
columns: System · Lang · KSLOC · Files · Mean CCN · Max CCN · Dep
Freshness · Doc Coverage % · COCOMO PM · Risk. Color-grade the PM and
Risk cells (green→amber→red). Below the table, a 2-3 sentence
sequencing recommendation: which system first and why.
Then stop. Tell the user to open analysis/portfolio.html.
Perform a complete modernization assessment of legacy/$1.
This is the discovery phase — the goal is a fact-grounded executive brief that a VP of Engineering could take into a budget meeting. Work in this order:
Run and show the output of:
scc legacy/$1
Then run scc --by-file -s complexity legacy/$1 | head -25 to identify the
highest-complexity files. Capture the COCOMO effort/cost estimate scc provides.
If scc is not installed, fall back in order:
cloc legacy/$1 for the LOC table, then compute COCOMO-II effort
yourself: PM = 2.94 × (KSLOC)^1.10 (nominal scale factors). Show the
inputs.cloc is also missing, use find + wc -l grouped by extension
for LOC, and rank file complexity by counting decision keywords
(IF/EVALUATE/WHEN/PERFORM for COBOL; if/for/while/case/
catch for C-family). Compute COCOMO from KSLOC as above.Note in the assessment which tool was used so the figures are reproducible.
Identify, with file evidence:
Spawn three subagents in parallel:
legacy-analyst — "Build a structural map of legacy/$1: what are the
5-12 major functional domains (group optional/feature-gated subsystems
under one umbrella), which source files belong to each, and how do they
depend on each other (control flow + shared data)? Return a markdown
table + a Mermaid graph TD of domain-level dependencies — use
subgraph to cluster and cap at ~40 edges. Cite repo-relative file
paths. Flag dangling references (defined but no source, or unused)."
legacy-analyst — "Identify technical debt in legacy/$1: dead code, deprecated APIs, copy-paste duplication, god objects/programs, missing error handling, hardcoded config. Return the top 10 findings ranked by remediation value, each with file:line evidence."
security-auditor — "Scan legacy/$1 for security vulnerabilities: injection, auth weaknesses, hardcoded secrets, vulnerable dependencies, missing input validation. Return findings in CWE-tagged table form with file:line evidence and severity."
Wait for all three. Synthesize their findings.
If production telemetry is available — an observability/APM MCP server, batch
job logs, or runtime exports the user can supply — gather p50/p95/p99
wall-clock for the system's key jobs/transactions (e.g. JCL members under
legacy/$1/jcl/, scheduled batches, top API routes). Use it to:
Include a small Runtime Profile table (Job/Route · Domain · p50 · p95 · p99 · p99/p50) in the assessment. If no telemetry is available, skip this step and note the gap in the assessment.
Compare what the code does against what README/docs/comments say. List the top 5 undocumented behaviors or subsystems that a new engineer would need explained.
Create analysis/$1/ASSESSMENT.md with these sections:
Also create analysis/$1/ARCHITECTURE.mmd containing the Mermaid domain
dependency diagram from the legacy-analyst.
Tell the user the assessment is ready and suggest:
glow -p analysis/$1/ASSESSMENT.md
What SKILL.md sets; muted values are Claude Code's defaults
7 skills in this plugin
/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./modernize-transformThis skill should be used when the user asks to transform one legacy module to the target stack ('modernize transform module X', 'chuyen module sang stack moi') - idiomatic rewrite with behavior-equivalence tests.npx claudepluginhub minhthang1009/dotclaude --plugin code-modernizationOther plugins' skills for the same job