diff options
| author | Morgan Lunt <morganl@anthropic.com> | 2026-09-23 19:03:35 -0700 |
|---|---|---|
| committer | Morgan Lunt <morganl@anthropic.com> | 2026-09-24 17:49:55 -0700 |
| commit | d7e3a90d48eba9c31733cfd530e35a5560611dc7 (patch) | |
| tree | 6717bb94d4c125575dfb3363e59a06682f1b4b6a /plugins/code-modernization | |
| parent | 2ce9d0dace1239bec65379ecd3834258574c9073 (diff) | |
code-modernization: put flags after the positional arguments
assess and harden said --show-secrets could appear anywhere and that the
system dir was the first non-flag token. Since the commands declare
named arguments, $system is filled with the first token, so
"--show-secrets carddemo" puts legacy/--show-secrets into every path
template, and harden's workflow rejects a system name that starts with
a dash. The old rule contradicted how the arguments bind.
The usage text now says flags go after the positional arguments, and the
README shows --show-secrets in that position on the assess and harden
usage lines. assess --portfolio keeps its mode flag first. No parsing
logic is added. A flag-first invocation now gets a request to run again in
the right order, where a model used to work out the intent on its own.
Diffstat (limited to 'plugins/code-modernization')
| -rw-r--r-- | plugins/code-modernization/README.md | 6 | ||||
| -rw-r--r-- | plugins/code-modernization/commands/modernize-assess.md | 6 | ||||
| -rw-r--r-- | plugins/code-modernization/commands/modernize-harden.md | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/plugins/code-modernization/README.md b/plugins/code-modernization/README.md index 6cf66ad5..32f6c476 100644 --- a/plugins/code-modernization/README.md +++ b/plugins/code-modernization/README.md @@ -26,7 +26,7 @@ The discovery commands (`assess`, `map`, `extract-rules`) write artifacts to `an Each command takes a `<system-dir>` and assumes the code lives at `legacy/<system-dir>/`. Artifacts land in `analysis/<system-dir>/`; new code in `modernized/<system-dir>/`. If your code is elsewhere, symlink it: `mkdir -p legacy && ln -s /path/to/code legacy/billing`. -Plugin commands are namespaced, so type the full name — `/code-modernization:modernize-…` (autocomplete finds it from `/modernize`). +Plugin commands are namespaced, so type the full name — `/code-modernization:modernize-…` (autocomplete finds it from `/modernize`). Flags go after the positional arguments (`/code-modernization:modernize-harden billing --show-secrets`): the first argument is the system directory, except for `assess --portfolio`, whose mode flag comes first. Try the first three on your own codebase — each produces a standalone artifact, so you can stop and review at any point: @@ -52,7 +52,7 @@ Run in order, but each is standalone — stop, review, resume. - **`/code-modernization:modernize-preflight <system-dir> [target-stack]`** — Environment readiness check. Asks you, in a pop-up, the five questions the source can't answer (scope, whether you can build and test locally, bespoke build infrastructure, prior attempts, what's off limits) and records your answers verbatim. Then it detects the legacy stack, checks analysis tooling, reads the CI/build definition, smoke-tests the toolchain against the real code (and, if you name a target stack, that a throwaway project builds on it here), inventories missing includes / deployment descriptors, and checks the **scope boundary** — whether `<system-dir>` is a slice of a larger repo and what outside it depends on it. Produces `PREFLIGHT.md` with a per-command Ready / Ready-with-gaps / Not-ready verdict. -- **`/code-modernization:modernize-assess <system-dir>`** *(or `--portfolio <parent-dir>`)* — Inventory: languages, complexity, tech debt, security posture, and a COCOMO complexity index ([see note](#a-note-on-cocomo)). Produces `ASSESSMENT.md` + `ARCHITECTURE.mmd`. With `--portfolio`, sweeps every subdirectory and writes a sequencing heat-map (`portfolio.html`). +- **`/code-modernization:modernize-assess <system-dir> [--show-secrets]`** *(or `--portfolio <parent-dir>`)* — Inventory: languages, complexity, tech debt, security posture, and a COCOMO complexity index ([see note](#a-note-on-cocomo)). Produces `ASSESSMENT.md` + `ARCHITECTURE.mmd`. With `--portfolio`, sweeps every subdirectory and writes a sequencing heat-map (`portfolio.html`). - **`/code-modernization:modernize-map <system-dir> [--no-describe]`** — Dependency and topology map: call graph, data lineage, entry points, and 2–4 business flows each traced for a persona (the claimant, the auditor). Produces `topology.json` and an **interactive zoomable `TOPOLOGY.html`** (circle-pack sized by LOC, edge toggles, search, and a persona-flow walkthrough), plus small `.mmd` diagrams for docs. Each node also gets a short plain-language description in the sidebar, written by one agent per node from just that node's source and links; `--no-describe` skips that step. @@ -66,7 +66,7 @@ Run in order, but each is standalone — stop, review, resume. - **`/code-modernization:modernize-uplift <system-dir> <source-version> <target-version> [project-pattern]`** — Same-stack version bump (e.g. `.NET Framework 4.8` → `.NET 8`, Spring Boot 2 → 3) — the common case `transform` gets wrong by rewriting. Preserves the code and makes the smallest diffs that compile and behave identically, driven by a **delta catalog** (the known breaking changes that *this* code actually hits) and the ecosystem's migration tooling. Equivalence is proven by running the test suite on both the old and new runtime where both can run here (otherwise it falls back to characterization tests, like `transform`). Migration is **pilot-first**: one representative project is migrated end-to-end in-session and its lessons written to a `PLAYBOOK.md` before anything else is touched; the rest then fan out, one agent per project, in **dependency-aware escalating batches behind a circuit breaker**. Produces `DELTA_CATALOG.md`, `BASELINE.md`, `PLAYBOOK.md` + `UPLIFT_NOTES.md`. If the catalog shows most of the code is forced to change, it tells you to use `transform` instead. -- **`/code-modernization:modernize-harden <system-dir>`** — Security pass on the **legacy** system: OWASP/CWE, dependency CVEs, secrets, injection. Produces `SECURITY_FINDINGS.md` (ranked) and a reviewed `security_remediation.patch`. **Never edits `legacy/`** — you review and apply the patch yourself. Useful while the legacy system keeps running in production during migration. +- **`/code-modernization:modernize-harden <system-dir> [--show-secrets]`** — Security pass on the **legacy** system: OWASP/CWE, dependency CVEs, secrets, injection. Produces `SECURITY_FINDINGS.md` (ranked) and a reviewed `security_remediation.patch`. **Never edits `legacy/`** — you review and apply the patch yourself. Useful while the legacy system keeps running in production during migration. - **`/code-modernization:modernize-status <system-dir>`** — Read-only progress report: artifact inventory, staleness flags, secrets-hygiene checks, and the single most useful next command. diff --git a/plugins/code-modernization/commands/modernize-assess.md b/plugins/code-modernization/commands/modernize-assess.md index 5f19981f..4bf5734c 100644 --- a/plugins/code-modernization/commands/modernize-assess.md +++ b/plugins/code-modernization/commands/modernize-assess.md @@ -6,9 +6,9 @@ arguments: system **Mode select.** If `$ARGUMENTS` starts with `--portfolio`, run **Portfolio mode** against the directory that follows. Otherwise run **Single-system -mode** against the system dir. Parse flags positionally-independently: -`--show-secrets` may appear before or after the system dir — the system -dir is the first non-flag token. +mode** against the system dir, which is the first token (`$system`). Flags +go after it — `<system-dir> --show-secrets` — since a flag in first place +would be read as the system dir. --- diff --git a/plugins/code-modernization/commands/modernize-harden.md b/plugins/code-modernization/commands/modernize-harden.md index 64fb73c4..7275ffee 100644 --- a/plugins/code-modernization/commands/modernize-harden.md +++ b/plugins/code-modernization/commands/modernize-harden.md @@ -6,9 +6,9 @@ arguments: system Run a **security hardening pass** on the legacy system: find vulnerabilities, rank them, and produce a reviewable patch for the -critical ones. Parse arguments flag-independently: the system dir -(referred to as `$system` below) is the first non-flag token in `$ARGUMENTS`; -`--show-secrets` may appear anywhere. +critical ones. The system dir (`$system` below) is the first argument; +flags go after it — `<system-dir> --show-secrets` — since a flag in first +place would be read as the system dir. This command never edits `legacy/` — it writes findings and a proposed patch to `analysis/$system/`. The user reviews and applies (or not). |
