summaryrefslogtreecommitdiff
path: root/plugins/code-modernization
diff options
context:
space:
mode:
authorMorgan Lunt <morganl@anthropic.com>2026-09-23 19:04:04 -0700
committerMorgan Lunt <morganl@anthropic.com>2026-09-24 17:49:55 -0700
commit5a8191cd213bd4f4b2a0dd237d450aed029d2752 (patch)
tree04f837d0ac4d339f440175a65807ec9aacbe37f4 /plugins/code-modernization
parentd7e3a90d48eba9c31733cfd530e35a5560611dc7 (diff)
code-modernization: docs accuracy (permission rules, plan mode, marketplace)
The README recommended Write(path) permission rules. File permissions are checked against Edit(path) rules only, so the Write rules were accepted but never consulted. The recommended settings now use Edit(analysis/**) and Edit(modernized/**) allow rules and an Edit(/legacy/**) deny rule, with a line saying that file writes are matched through the Edit rule. The deny rule is anchored at the project root, because an unanchored one also matches any nested directory named legacy. It refuses a cp out of legacy/ as well, so the README gives rsync -a for uplift's working copy, and says a symlinked legacy tree needs additionalDirectories and a deny on its real path. The list of shell commands that bypass the file rules drops sed -i (the deny rule does cover sed, tee and redirections) and keeps git apply and scripts. The README said brief enters plan mode; the command says to use plan mode if the session supports it. The README now says the same. The marketplace description predated same-stack uplift. It now lists uplift and mentions version uplifts such as .NET Framework to .NET 8.
Diffstat (limited to 'plugins/code-modernization')
-rw-r--r--plugins/code-modernization/README.md12
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/code-modernization/README.md b/plugins/code-modernization/README.md
index 32f6c476..051aa51f 100644
--- a/plugins/code-modernization/README.md
+++ b/plugins/code-modernization/README.md
@@ -58,7 +58,7 @@ Run in order, but each is standalone — stop, review, resume.
- **`/code-modernization:modernize-extract-rules <system-dir> [module-pattern]`** — Mine the business rules — calculations, validations, eligibility, state transitions — into Given/When/Then "Rule Cards" with `file:line` citations and confidence ratings. With the Workflow tool, anything but a tiny system is extracted in per-module shards (from `map`'s `topology.json` if present, else the directory tree), so each extractor reads one focused slice. Produces `BUSINESS_RULES.md` + `DATA_OBJECTS.md`.
-- **`/code-modernization:modernize-brief <system-dir> [target-stack]`** — Synthesize discovery into a phased **Modernization Brief**: target architecture, phase plan, persona walkthroughs, behavior contract, and an approval block. Reads the discovery artifacts and **stops if any are missing**. Enters plan mode as a human-in-the-loop approval gate. For a same-stack uplift it also requires the **delta catalog**, since an uplift's phase order is decided by its version deltas. The execution commands read the brief and treat each phase's entry criteria as gates, so editing the brief steers execution.
+- **`/code-modernization:modernize-brief <system-dir> [target-stack]`** — Synthesize discovery into a phased **Modernization Brief**: target architecture, phase plan, persona walkthroughs, behavior contract, and an approval block. Reads the discovery artifacts and **stops if any are missing**. Stops for your explicit approval as a human-in-the-loop gate, in plan mode if the session supports it. For a same-stack uplift it also requires the **delta catalog**, since an uplift's phase order is decided by its version deltas. The execution commands read the brief and treat each phase's entry criteria as gates, so editing the brief steers execution.
- **`/code-modernization:modernize-reimagine <system-dir> <target-vision>`** — Greenfield rebuild from extracted intent. Mines a spec, designs and adversarially reviews a target architecture, then scaffolds services with executable acceptance tests under `modernized/<system>-reimagined/`. Two human checkpoints.
@@ -90,13 +90,17 @@ A `.claude/settings.json` in the project you're modernizing enforces the core in
```json
{
"permissions": {
- "allow": ["Read(**)", "Write(analysis/**)", "Write(modernized/**)", "Edit(analysis/**)", "Edit(modernized/**)"],
- "deny": ["Edit(legacy/**)", "Write(legacy/**)"]
+ "allow": ["Read(**)", "Edit(analysis/**)", "Edit(modernized/**)"],
+ "deny": ["Edit(/legacy/**)"]
}
}
```
-This guards the file tools; shell commands that mutate files (`sed -i`, `git apply`) still go through the normal Bash prompt, so review those with the same invariant in mind. That prompt is the containment for the two steps that fan out many write-capable agents at once — `/code-modernization:modernize-uplift` Step 5b and `/code-modernization:modernize-reimagine` Phase E — so keep Bash on a *prompted* permission mode for those.
+Claude Code matches file writes through the `Edit` rule, so these cover the `Write` tool too; a `Write(path)` rule is accepted but never consulted.
+
+The deny rule starts with `/` so that it is anchored at the project root; without the slash it also matches any nested directory named `legacy`, such as `modernized/<system>/.../legacy/`. It refuses a copy out of `legacy/` too, so `uplift`'s working copy (`cp -r legacy/<system> modernized/<system>-uplifted`) needs `rsync -a legacy/<system>/ modernized/<system>-uplifted/` instead, or a copy you run yourself. If `legacy/<system>` is a symlink to a directory outside the project, add that directory to `additionalDirectories` so Claude can read through the link, and deny its real path as well, because the rule above matches the link's path and not its target's: `"additionalDirectories": ["/path/to/code"]` and `"Edit(//path/to/code/**)"` in `deny`.
+
+This guards the file tools; shell commands that mutate files (`git apply`, a script that opens files itself) still go through the normal Bash prompt, so review those with the same invariant in mind. That prompt is the containment for the two steps that fan out many write-capable agents at once — `/code-modernization:modernize-uplift` Step 5b and `/code-modernization:modernize-reimagine` Phase E — so keep Bash on a *prompted* permission mode for those.
## Prerequisites