From d4981e86b90f08a5aa029cb5cc1f274f6922cc17 Mon Sep 17 00:00:00 2001 From: Morgan Lunt Date: Tue, 15 Sep 2026 15:15:41 -0700 Subject: code-modernization: named arguments and namespaced command names Positional placeholders are zero-based ($0 is the first argument), but every command used $1 for the first one, so arguments arrived shifted: modernize-preflight carddemo java-spring analyzed legacy/java-spring. Each command now declares its arguments in frontmatter (for example `arguments: system module target_stack`) and uses the names. A missing optional argument now expands to an empty string instead of a literal placeholder. Plugin commands resolve only by their namespaced name, so the README, command cross-references, agents, workflow descriptions and the topology viewer now say /code-modernization:modernize-*. The extract-rules workflow is renamed modernize-extract-rules-mine. It shared the command's name, so invoking the command could start the workflow directly and skip the command's instructions. Commands launch workflows by script path, so nothing else changes. --- plugins/code-modernization/workflows/extract-rules.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins/code-modernization/workflows/extract-rules.js') diff --git a/plugins/code-modernization/workflows/extract-rules.js b/plugins/code-modernization/workflows/extract-rules.js index 1a53552b..82a7d017 100644 --- a/plugins/code-modernization/workflows/extract-rules.js +++ b/plugins/code-modernization/workflows/extract-rules.js @@ -1,9 +1,9 @@ export const meta = { - name: 'modernize-extract-rules', + name: 'modernize-extract-rules-mine', description: 'Business-rule mining with loop-until-dry extraction, per-rule citation verification, and a P0 confirmation panel', whenToUse: - 'Invoked by /modernize-extract-rules when the Workflow tool is available. Requires args {system, modulePattern?, maxRounds?}. Returns structured rule cards — the calling session writes BUSINESS_RULES.md and DATA_OBJECTS.md from them.', + 'Invoked by /code-modernization:modernize-extract-rules when the Workflow tool is available. Requires args {system, modulePattern?, maxRounds?}. Returns structured rule cards — the calling session writes BUSINESS_RULES.md and DATA_OBJECTS.md from them.', phases: [ { title: 'Extract', detail: 'three lens-scoped extractors per round, rounds until two come up dry' }, { title: 'Verify', detail: 'one citation referee per fresh rule' }, @@ -23,7 +23,7 @@ const ARGS = typeof args === 'string' ? (() => { try { return JSON.parse(args) } const system = ARGS && ARGS.system if (!system) { throw new Error( - 'modernize-extract-rules workflow requires args: {system: "", modulePattern?: "", maxRounds?: number}', + 'modernize-extract-rules-mine workflow requires args: {system: "", modulePattern?: "", maxRounds?: number}', ) } if (!/^[A-Za-z0-9][A-Za-z0-9_-]*$/.test(system)) { -- cgit