summaryrefslogtreecommitdiff
path: root/plugins/code-modernization/commands
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/code-modernization/commands')
-rw-r--r--plugins/code-modernization/commands/modernize-assess.md17
-rw-r--r--plugins/code-modernization/commands/modernize-brief.md6
-rw-r--r--plugins/code-modernization/commands/modernize-map.md26
3 files changed, 30 insertions, 19 deletions
diff --git a/plugins/code-modernization/commands/modernize-assess.md b/plugins/code-modernization/commands/modernize-assess.md
index 69df96b1..44997aa5 100644
--- a/plugins/code-modernization/commands/modernize-assess.md
+++ b/plugins/code-modernization/commands/modernize-assess.md
@@ -99,20 +99,21 @@ Spawn three subagents **concurrently** using the Task tool:
Wait for all three. Synthesize their findings.
-## Step 4 — Production runtime overlay (observability)
+## Step 4 — Production runtime overlay (optional)
-If the system has batch jobs (e.g. JCL members under `app/jcl/`), call the
-`observability` MCP tool `get_batch_runtimes` for each business-relevant
-job name (interest, posting, statement, reporting). Use the returned
-p50/p95/p99 and 90-day series to:
+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:
- Tag each functional domain from Step 3 with its production wall-clock
cost and **p99 variance** (p99/p50 ratio).
- Flag the highest-variance domain as the highest operational risk —
this is telemetry-grounded, not a static-analysis opinion.
-Include a small **Batch Runtime** table (Job · Domain · p50 · p95 · p99 ·
-p99/p50) in the assessment.
+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.
## Step 5 — Documentation gap analysis
@@ -126,7 +127,7 @@ Create `analysis/$1/ASSESSMENT.md` with these sections:
- **Executive Summary** (3-4 sentences: what it is, how big, how risky, headline recommendation)
- **System Inventory** (the scc table + tech fingerprint)
- **Architecture-at-a-Glance** (the domain table; reference the diagram)
-- **Production Runtime Profile** (the batch-runtime table from Step 4, with the highest-variance domain called out)
+- **Production Runtime Profile** (the runtime table from Step 4 with the highest-variance domain called out — or "no telemetry available")
- **Technical Debt** (top 10, ranked)
- **Security Findings** (CWE table)
- **Documentation Gaps** (top 5)
diff --git a/plugins/code-modernization/commands/modernize-brief.md b/plugins/code-modernization/commands/modernize-brief.md
index ec7f1496..86265cd9 100644
--- a/plugins/code-modernization/commands/modernize-brief.md
+++ b/plugins/code-modernization/commands/modernize-brief.md
@@ -8,8 +8,10 @@ single document a steering committee approves and engineering executes.
Target stack: `$2` (if blank, recommend one based on the assessment findings).
-Read `analysis/$1/ASSESSMENT.md`, `TOPOLOGY.md`, and `BUSINESS_RULES.md` first.
-If any are missing, say so and stop.
+Read `analysis/$1/ASSESSMENT.md`, `analysis/$1/TOPOLOGY.html` (and the `.mmd`
+files alongside it), and `analysis/$1/BUSINESS_RULES.md` first. If any are
+missing, say so and stop — they come from `/modernize-assess`, `/modernize-map`,
+and `/modernize-extract-rules` respectively. Run those first.
## The Brief
diff --git a/plugins/code-modernization/commands/modernize-map.md b/plugins/code-modernization/commands/modernize-map.md
index bd149cb5..6fb55b75 100644
--- a/plugins/code-modernization/commands/modernize-map.md
+++ b/plugins/code-modernization/commands/modernize-map.md
@@ -28,14 +28,22 @@ re-run and audited. Run it. Show the raw output.
## Render
From the extracted data, generate **three Mermaid diagrams** and write them
-to `analysis/$1/TOPOLOGY.html` so the artifact pane renders them live.
+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). Each diagram goes in a
-`<pre class="mermaid">...</pre>` block — the artifact server loads
-mermaid.js and renders client-side. Do **not** wrap diagrams in
-markdown ` ``` ` fences inside the HTML.
+external stylesheets). Load Mermaid from a CDN in `<head>`:
+
+```html
+<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.
1. **`graph TD` — Module call graph.** Cluster by domain (use `subgraph`).
Highlight entry points in a distinct style. Cap at ~40 nodes — if larger,
@@ -46,9 +54,9 @@ markdown ` ``` ` fences inside the HTML.
3. **`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 the `observability`
- MCP server is connected, annotate each batch step with its p50/p99
- wall-clock from `get_batch_runtimes`.
+ 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`,
@@ -63,4 +71,4 @@ touched by too many writers.
## Present
-Tell the user to open `analysis/$1/TOPOLOGY.html` in the artifact pane.
+Tell the user to open `analysis/$1/TOPOLOGY.html` in a browser.