diff options
| author | Morgan Lunt <morganl@anthropic.com> | 2026-09-24 20:14:51 -0700 |
|---|---|---|
| committer | Morgan Lunt <morganl@anthropic.com> | 2026-09-24 20:14:51 -0700 |
| commit | cafefb304bde4070c6c0877528ee49c1252eff85 (patch) | |
| tree | 7e3a0db85edf586817474e04253a4d9d02416676 /plugins/code-modernization/commands/modernize-status.md | |
| parent | b10dab2f5ad83f642a03b5f800dea71651830beb (diff) | |
code-modernization: simpler commands, a source option, a report page and an equivalence check
Commands hardcoded legacy/<system>, so code too big to copy, or living at
an absolute path, needed a hand-made symlink. Preflight now takes
--source <path> and makes the legacy/<system> link for you (a junction on
Windows); nothing is copied, and every command says where the link points
before it starts. The harden patch is applied with patch -p1 -d.
Each command ends by naming the next command to run, and the commands are
about a third shorter with no step removed:
- map accepts an existing dependency graph (--graph) or the stack's own
tooling, maps very large estates in resumable chunks, records reflection
targets as unresolved instead of dead, asks before describing more than
40 nodes, and never gives two nodes the same location.
- transform can take its module and target from the brief, counts the
equivalence cases that executed (zero is a failure and a comparison never
skips), shows the tests can fail with a deliberate one-line break, and
hands "same or different" to a script when both systems can run.
- brief writes each phase in one fixed shape: one command, module ids as in
the map, and criteria written as conditions a build command may tick but
not reword.
- reimagine reuses the discovery artifacts instead of extracting them again.
- status names the exact command to paste next.
scripts/build_report.py turns whatever the commands wrote into one
self-contained, offline REPORT.html (Mermaid is vendored, all text from the
analysis is escaped, the quarantined secrets file is never read), and
scripts/compare.py decides byte-for-byte whether two outputs match, records
why, and checks it can fail. The shard builder ignores symbolic links and
paths that leave the source, matches a plain name against what lies beneath
it, and falls back to the directory tree when the map's modules share a
location.
The README drops from 275 to about 100 lines; the pane's reference moves to
hooks/README.md.
Diffstat (limited to 'plugins/code-modernization/commands/modernize-status.md')
| -rw-r--r-- | plugins/code-modernization/commands/modernize-status.md | 74 |
1 files changed, 33 insertions, 41 deletions
diff --git a/plugins/code-modernization/commands/modernize-status.md b/plugins/code-modernization/commands/modernize-status.md index f855ced3..2439bdc0 100644 --- a/plugins/code-modernization/commands/modernize-status.md +++ b/plugins/code-modernization/commands/modernize-status.md @@ -1,61 +1,53 @@ --- -description: Where am I in the modernization workflow — artifact inventory, staleness, secrets hygiene, next step -argument-hint: <system-dir> +description: Where am I? Progress, what is stale, and the exact next command to run — start here when unsure +argument-hint: <system> arguments: system --- -Report where the modernization of `$system` stands, in one screen. This is a -read-only command — inspect, never modify. +Report where the modernization of `$system` stands, in one screen. This command inspects and never modifies, +except that it refreshes `analysis/$system/REPORT.html` (`python3 +"${CLAUDE_PLUGIN_ROOT}/scripts/build_report.py" $system`, a convenience: if it fails or `python3` is missing, say so in one line and carry on). If nothing +exists yet, the answer is `/code-modernization:modernize-preflight $system`. -## 1 — Artifact inventory +## 1 — Inventory -Check `analysis/$system/` and `modernized/$system*/` and build a table — one row per -workflow stage, with the artifact's presence and modification time: +Check `analysis/$system/` and `modernized/$system*/` and build a table, one row per stage, with each artifact's +presence and modification time: | Stage | Artifacts | |---|---| -| preflight | `PREFLIGHT.md` (note whether the Check 0 human answers and the Check 6 scope-boundary finding are present) | +| preflight | `PREFLIGHT.md` (are the Check 0 human answers and the Check 6 scope-boundary finding there?), where `legacy/$system` points (does that directory exist?) | | assess | `ASSESSMENT.md`, `ARCHITECTURE.mmd` | | map | `topology.json`, `TOPOLOGY.html`, `*.mmd`, `extract_topology.*` | | extract-rules | `BUSINESS_RULES.md`, `DATA_OBJECTS.md` | -| brief | `MODERNIZATION_BRIEF.md` (note whether the approval block is signed) | +| brief | `MODERNIZATION_BRIEF.md` (is the approval block signed?) | | harden | `SECURITY_FINDINGS.md`, `security_remediation.patch` | -| uplift | `DELTA_CATALOG.md`, `BASELINE.md`, `PLAYBOOK.md` (no playbook = the pilot hasn't happened yet — the fan-out must not); `modernized/$system-uplifted/UPLIFT_NOTES.md` (note per-unit: builds on target? baseline reproduced?) | -| transform | each `modernized/$system/<module>/` dir — note test presence and whether `TRANSFORMATION_NOTES.md` exists | -| reimagine | `modernized/$system-reimagined/` — note per-service acceptance tests and the `CLAUDE.md` handoff (reimagine's completion markers; it does NOT write `TRANSFORMATION_NOTES.md`) | - -## 2 — Staleness - -Flag any artifact older than an upstream artifact it derives from: - -- `MODERNIZATION_BRIEF.md` older than `ASSESSMENT.md`, `topology.json`, - or `BUSINESS_RULES.md` → the brief no longer reflects discovery; - recommend re-running `/code-modernization:modernize-brief`. -- `MODERNIZATION_BRIEF.md` for a same-stack **uplift** plan that is older - than `DELTA_CATALOG.md` — or that has no catalog at all — → the phase - order was decided before (or without) the version deltas that determine - it; recommend re-running `/code-modernization:modernize-brief`. -- `TOPOLOGY.html` older than `topology.json` → re-run the injection step - from `/code-modernization:modernize-map`. -- Any `TRANSFORMATION_NOTES.md` older than `BUSINESS_RULES.md` → the - module may not implement the latest rule set; list which. +| uplift | `DELTA_CATALOG.md`, `BASELINE.md`, `PLAYBOOK.md` (no playbook means the pilot has not happened, so the fan-out must not), `modernized/$system-uplifted/UPLIFT_NOTES.md` (per unit: builds on target? baseline reproduced?) | +| transform | each `modernized/$system/<module>/`: tests present? `TRANSFORMATION_NOTES.md` present (its completion marker)? | +| reimagine | `modernized/$system-reimagined/`: per-service acceptance tests, and the `CLAUDE.md` handoff (its completion marker; it does not write `TRANSFORMATION_NOTES.md`) | +| equivalence | `EQUIVALENCE.json`: cases executed, same, differs (any differing or missing case, or zero executed, is a failure) | + +## 2 — Stale + +Flag any artifact older than one it derives from: the brief older than `ASSESSMENT.md`, `topology.json` or +`BUSINESS_RULES.md` (no longer reflects discovery: rerun `brief`); an uplift's brief older than +`DELTA_CATALOG.md`, or with no catalog (phase order was decided without the version deltas: rerun `brief`); +`TOPOLOGY.html` older than `topology.json` (rerun the render step of `map`); a `TRANSFORMATION_NOTES.md` older +than `BUSINESS_RULES.md` (the module may not implement the latest rules: list which). ## 3 — Secrets hygiene -- Does `analysis/.gitignore` exist and cover `SECRETS.local.md` / - `*.local.patch`? (`git check-ignore` when in a git repo.) -- If `SECRETS.local.md` exists: confirm it is NOT tracked - (`git ls-files --error-unmatch`, expect failure) and has never been - committed (`git log --all --oneline -- <path>`, expect empty). If - either check fails, say so prominently and recommend rotation plus - history scrubbing. +Does `analysis/.gitignore` exist and cover `SECRETS.local.md` and `*.local.patch` (`git check-ignore` in a git +repo)? If `SECRETS.local.md` exists, confirm it is NOT tracked (`git ls-files --error-unmatch` should fail) and +never committed (`git log --all --oneline -- <path>` should be empty). If either fails, say so prominently and +recommend rotation and history scrubbing. ## 4 — Verdict End with three lines: -- **Where you are** — the furthest completed stage and roughly how much - of the system it covers (e.g. "mapped 100%, 2 of 14 modules - transformed"). -- **What's stale** — or "nothing". -- **Next command** — the single most useful next step, with a one-line - reason. + +- **Where you are:** the furthest completed stage and how much it covers ("mapped 100%, 2 of 14 modules transformed"). +- **What is stale:** or "nothing". +- **Next command:** the single most useful next step as the exact command line to paste, with a one-line reason. + The order is preflight, assess, map, extract-rules, brief (needs approval), then the brief's Phase 1 command + (`transform`, `uplift` or `reimagine`), then `harden`. |
