/code-modernization:modernize-map <system-dir>from code-modernization
Maps dependencies and topology of legacy systems, producing call graphs, data lineage, and batch flow diagrams from source code and deployment config.
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.
Build a dependency and topology map of legacy/$1 and render it visually.
The assessment gave us domains. Now go one level deeper: how do the pieces connect? This is the map an engineer needs before touching anything.
Write a one-off analysis script (Python or shell — your choice) that parses
the source under legacy/$1 and extracts the four datasets below. Three
principles apply across stacks; getting them wrong produces a misleading map:
Extract:
CALL, method invocations,
import/require) and dispatcher calls (EXEC CICS LINK/XCTL, DI
container wiring, framework routing, reflection/factory). Resolve variable
call targets against route tables, copybooks, config, or constant pools.SELECT…ASSIGN TO ↔ JCL DD (batch
COBOL), EXEC CICS READ/WRITE…FILE() ↔ CSD DEFINE FILE (CICS online),
EXEC SQL table refs (embedded SQL), ORM annotations/mappings (Java/.NET),
model files (Node/Python/Ruby). Include UI/screen bindings (BMS maps, JSPs,
templates) — they're dependencies too.EXEC PGM= and CICS CSD DEFINE TRANSACTION
(mainframe), web.xml/route annotations/route files (web), main()/argv
parsing (CLI), queue/scheduler subscriptions (event-driven).If the source is fixed-column (COBOL columns 8–72, RPG, etc.), slice the code area and strip comment lines before regex matching, or you'll match sequence numbers and commented-out code.
Save the script as analysis/$1/extract_topology.py (or .sh) so it can be
re-run and audited. Have it write a machine-readable
analysis/$1/topology.json and print a human summary. Run it; show the
summary (cap at ~200 lines for very large estates).
From the extracted data, generate three Mermaid diagrams and write them
to analysis/$1/TOPOLOGY.html as a self-contained page that renders in any
browser.
The HTML page must use: dark #1e1e1e background, #d4d4d4 text,
#cc785c for <h2>/accents, system-ui font, all CSS inline (no
external stylesheets). Load Mermaid from a CDN in <head>:
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
mermaid.initialize({ startOnLoad: true, theme: 'dark' });
</script>
Each diagram goes in a <pre class="mermaid">...</pre> block. Do not
wrap diagrams in markdown ``` fences inside the HTML.
graph TD — Module call graph. Cluster by domain (use subgraph).
Highlight entry points in a distinct style. Cap at ~40 nodes — if larger,
show domain-level with one expanded domain.
graph LR — Data lineage. Programs → data stores.
Mark read vs write edges.
flowchart TD — Critical path. Trace ONE end-to-end business flow
(e.g., "monthly billing run" or "process payment") through every program
and data store it touches, in execution order. If production telemetry is
available (see /modernize-assess Step 4), annotate each step with its
p50/p99 wall-clock.
Also export the three diagrams as standalone .mmd files for re-use:
analysis/$1/call-graph.mmd, analysis/$1/data-lineage.mmd,
analysis/$1/critical-path.mmd.
Below each <pre class="mermaid"> block in TOPOLOGY.html, add a <ul>
with 3-5 architect observations: tight coupling clusters, single
points of failure, candidates for service extraction, data stores
touched by too many writers.
Tell the user to open analysis/$1/TOPOLOGY.html in a browser.
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').Other plugins' skills for the same job