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/commands | |
| 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/commands')
| -rw-r--r-- | plugins/code-modernization/commands/modernize-assess.md | 6 | ||||
| -rw-r--r-- | plugins/code-modernization/commands/modernize-harden.md | 6 |
2 files changed, 6 insertions, 6 deletions
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). |
