summaryrefslogtreecommitdiff
path: root/plugins/code-modernization/workflows
diff options
context:
space:
mode:
authorMorgan Lunt <morganl@anthropic.com>2026-09-15 15:15:41 -0700
committerMorgan Lunt <morganl@anthropic.com>2026-09-15 15:15:41 -0700
commit27ccae218634dbe03a234f8902982d12bf6ba52a (patch)
tree1e9f627ce0798341868726447fbef7d46da8f20b /plugins/code-modernization/workflows
parentb5439c41ae9864833eb73d5efd088af8e3be13fe (diff)
code-modernization: named arguments and namespaced command namesmorganl/code-modernization-named-args
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.
Diffstat (limited to 'plugins/code-modernization/workflows')
-rw-r--r--plugins/code-modernization/workflows/extract-rules.js6
-rw-r--r--plugins/code-modernization/workflows/harden-scan.js2
-rw-r--r--plugins/code-modernization/workflows/portfolio-assess.js2
-rw-r--r--plugins/code-modernization/workflows/reimagine-scaffold.js4
-rw-r--r--plugins/code-modernization/workflows/uplift-deltas.js6
-rw-r--r--plugins/code-modernization/workflows/uplift-migrate.js4
6 files changed, 12 insertions, 12 deletions
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: "<system-dir>", modulePattern?: "<glob>", maxRounds?: number}',
+ 'modernize-extract-rules-mine workflow requires args: {system: "<system-dir>", modulePattern?: "<glob>", maxRounds?: number}',
)
}
if (!/^[A-Za-z0-9][A-Za-z0-9_-]*$/.test(system)) {
diff --git a/plugins/code-modernization/workflows/harden-scan.js b/plugins/code-modernization/workflows/harden-scan.js
index 750f63ed..99ea4fd9 100644
--- a/plugins/code-modernization/workflows/harden-scan.js
+++ b/plugins/code-modernization/workflows/harden-scan.js
@@ -3,7 +3,7 @@ export const meta = {
description:
'Security scan as class-scoped parallel finders with adversarial per-finding verification — false positives die before SECURITY_FINDINGS.md',
whenToUse:
- 'Invoked by /modernize-harden when the Workflow tool is available. Requires args {system}. Covers the scan + triage input only — remediation patch drafting and the per-hunk review loop stay in the calling session (they write files and handle raw credentials).',
+ 'Invoked by /code-modernization:modernize-harden when the Workflow tool is available. Requires args {system}. Covers the scan + triage input only — remediation patch drafting and the per-hunk review loop stay in the calling session (they write files and handle raw credentials).',
phases: [
{ title: 'Find', detail: 'one finder per vulnerability class' },
{ title: 'Verify', detail: 'one refuter per finding; second judge for Critical/High' },
diff --git a/plugins/code-modernization/workflows/portfolio-assess.js b/plugins/code-modernization/workflows/portfolio-assess.js
index 5095794a..ddda5c7c 100644
--- a/plugins/code-modernization/workflows/portfolio-assess.js
+++ b/plugins/code-modernization/workflows/portfolio-assess.js
@@ -3,7 +3,7 @@ export const meta = {
description:
'Per-system portfolio sweep as an independent pipeline — metrics, fingerprint, doc coverage per system; COCOMO computed deterministically',
whenToUse:
- 'Invoked by /modernize-assess --portfolio when the Workflow tool is available. Requires args {parentDir, systems: ["dirname", ...]} — the calling session enumerates the subdirectories (workflow scripts have no filesystem access) and renders analysis/portfolio.html from the returned rows.',
+ 'Invoked by /code-modernization:modernize-assess --portfolio when the Workflow tool is available. Requires args {parentDir, systems: ["dirname", ...]} — the calling session enumerates the subdirectories (workflow scripts have no filesystem access) and renders analysis/portfolio.html from the returned rows.',
phases: [{ title: 'Survey', detail: 'one metrics agent per system, all independent' }],
}
diff --git a/plugins/code-modernization/workflows/reimagine-scaffold.js b/plugins/code-modernization/workflows/reimagine-scaffold.js
index 36a77f8a..b91ff779 100644
--- a/plugins/code-modernization/workflows/reimagine-scaffold.js
+++ b/plugins/code-modernization/workflows/reimagine-scaffold.js
@@ -1,9 +1,9 @@
export const meta = {
name: 'modernize-reimagine-scaffold',
description:
- 'Phase E of /modernize-reimagine: scaffold every approved service in parallel — no cap; the runtime queues agents against its concurrency limit',
+ 'Phase E of /code-modernization:modernize-reimagine: scaffold every approved service in parallel — no cap; the runtime queues agents against its concurrency limit',
whenToUse:
- 'Invoked by /modernize-reimagine AFTER the human approves the architecture (HITL checkpoint #2). Requires args {system, services: [{name, responsibilities}]}. Scaffolding agents write only under modernized/<system>-reimagined/<service>/ — disjoint directories, so no worktree isolation is needed.',
+ 'Invoked by /code-modernization:modernize-reimagine AFTER the human approves the architecture (HITL checkpoint #2). Requires args {system, services: [{name, responsibilities}]}. Scaffolding agents write only under modernized/<system>-reimagined/<service>/ — disjoint directories, so no worktree isolation is needed.',
phases: [{ title: 'Scaffold', detail: 'one agent per approved service' }],
}
diff --git a/plugins/code-modernization/workflows/uplift-deltas.js b/plugins/code-modernization/workflows/uplift-deltas.js
index 0b232191..4935f154 100644
--- a/plugins/code-modernization/workflows/uplift-deltas.js
+++ b/plugins/code-modernization/workflows/uplift-deltas.js
@@ -3,7 +3,7 @@ export const meta = {
description:
'Same-stack uplift delta catalog: one finder per delta category (intersecting known version breaking-changes with this code), each verified against the cited source',
whenToUse:
- 'Invoked by /modernize-uplift when the Workflow tool is available. Requires args {system, source, target, projectPattern?}. Returns structured delta cards — the calling session writes DELTA_CATALOG.md and runs the migration (build/dual-run are HITL, not in this workflow).',
+ 'Invoked by /code-modernization:modernize-uplift when the Workflow tool is available. Requires args {system, source, target, projectPattern?}. Returns structured delta cards — the calling session writes DELTA_CATALOG.md and runs the migration (build/dual-run are HITL, not in this workflow).',
phases: [
{ title: 'Find', detail: 'one finder per delta category + ecosystem-tool report' },
{ title: 'Verify', detail: 'one referee per delta — does this code really hit it?' },
@@ -222,10 +222,10 @@ return {
// the codebase. The orchestrating command compares totalTouchedSites to the
// system's file/LOC count (the command has that from assess; the workflow has
// no fs access) — if most of the code is forced to change, it's a rewrite, not
- // an uplift, and the command recommends /modernize-transform. judgment-share is
+ // an uplift, and the command recommends /code-modernization:modernize-transform. judgment-share is
// a SECONDARY "how much human effort", not the gate.
upliftVsRewriteSignal:
confirmed.length === 0
? 'no deltas found — verify the version pair and whether the migration tool could actually run'
- : `${totalSites} touched sites across ${confirmed.length} deltas (${judgmentSites} of them at judgment-class sites). Compare totalTouchedSites against the codebase size from assess: if it approaches "most of the tree", this is a rewrite — recommend /modernize-transform. Judgment share (${Math.round((judgmentCount / confirmed.length) * 100)}% of cards) is a secondary effort signal, not the gate.`,
+ : `${totalSites} touched sites across ${confirmed.length} deltas (${judgmentSites} of them at judgment-class sites). Compare totalTouchedSites against the codebase size from assess: if it approaches "most of the tree", this is a rewrite — recommend /code-modernization:modernize-transform. Judgment share (${Math.round((judgmentCount / confirmed.length) * 100)}% of cards) is a secondary effort signal, not the gate.`,
}
diff --git a/plugins/code-modernization/workflows/uplift-migrate.js b/plugins/code-modernization/workflows/uplift-migrate.js
index be7eb4bb..cb51eb9a 100644
--- a/plugins/code-modernization/workflows/uplift-migrate.js
+++ b/plugins/code-modernization/workflows/uplift-migrate.js
@@ -1,9 +1,9 @@
export const meta = {
name: 'modernize-uplift-migrate',
description:
- 'Batched fan-out of /modernize-uplift Step 5b: one migrator agent per project/module, in dependency-aware escalating batches behind a per-batch circuit breaker',
+ 'Batched fan-out of /code-modernization:modernize-uplift Step 5b: one migrator agent per project/module, in dependency-aware escalating batches behind a per-batch circuit breaker',
whenToUse:
- 'Invoked by /modernize-uplift ONLY after the pilot unit is migrated in-session, analysis/<system>/PLAYBOOK.md is written, and the human has approved the fan-out. Requires args {system, source, target, units: [{name, path, deps?}], batchSize?}. Each unit\'s optional `deps` lists the sibling unit NAMES it depends on; a unit is only batched once every listed dep has BUILT, so a unit and its dependency never run in the same batch. Agents write only inside their own unit directory under modernized/<system>-uplifted/ — disjoint directories, so no worktree isolation is needed; solution/workspace-level shared files are owned by the calling session. Returns per-unit results plus three RE-PASSABLE unit lists ({name, path, deps}) — remainingUnits (never attempted), failedUnits (attempted, build failed), blockedUnits (skipped because a dependency failed) — any of which can be passed straight back as the next invocation\'s `units`. The calling session applies the returned sharedFileNeeds and folds playbookGaps into the playbook before re-invoking.',
+ 'Invoked by /code-modernization:modernize-uplift ONLY after the pilot unit is migrated in-session, analysis/<system>/PLAYBOOK.md is written, and the human has approved the fan-out. Requires args {system, source, target, units: [{name, path, deps?}], batchSize?}. Each unit\'s optional `deps` lists the sibling unit NAMES it depends on; a unit is only batched once every listed dep has BUILT, so a unit and its dependency never run in the same batch. Agents write only inside their own unit directory under modernized/<system>-uplifted/ — disjoint directories, so no worktree isolation is needed; solution/workspace-level shared files are owned by the calling session. Returns per-unit results plus three RE-PASSABLE unit lists ({name, path, deps}) — remainingUnits (never attempted), failedUnits (attempted, build failed), blockedUnits (skipped because a dependency failed) — any of which can be passed straight back as the next invocation\'s `units`. The calling session applies the returned sharedFileNeeds and folds playbookGaps into the playbook before re-invoking.',
phases: [
{
title: 'Migrate',