summaryrefslogtreecommitdiff
path: root/plugins/code-modernization/commands
diff options
context:
space:
mode:
authorMorgan Westlee Lunt <morganl@anthropic.com>2026-06-09 21:21:50 +0000
committerMorgan Westlee Lunt <morganl@anthropic.com>2026-06-09 21:21:50 +0000
commite5939029ecdda7e9b8d30854e95eed2a5ff60062 (patch)
tree76eb83b79c43f88b062817a6ec89a46da6a2d262 /plugins/code-modernization/commands
parentd44da811468a8124135a67ba64a3d0257a2e36b6 (diff)
code-modernization: COCOMO is a complexity index, never a modernization timeline
COCOMO's constants encode human-team productivity; presenting its person-months as how long an agentic modernization will take (or cost) is a claim we should not make. Reframe COCOMO everywhere as a RELATIVE complexity/scale index for ranking and sequencing systems only: - assess: capture COCOMO as a complexity index; explicitly ignore scc's 'Estimated Schedule Effort' and cost-in-dollars; ASSESSMENT 'Effort Estimation' section becomes 'Relative Scale' with a not-a-timeline note; portfolio heat-map column renamed Complexity (COCOMO index). - brief: phase plan uses relative T-shirt sizing, not person-months/weeks; phases render as a dependency flowchart, not a gantt (gantt = calendar). - portfolio-assess.js: field cocomoPm -> complexityIndex; return label carries the not-a-duration caveat. - README: 'A note on COCOMO' explains the index framing and points at better intrinsic-complexity proxies. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Diffstat (limited to 'plugins/code-modernization/commands')
-rw-r--r--plugins/code-modernization/commands/modernize-assess.md32
-rw-r--r--plugins/code-modernization/commands/modernize-brief.md13
-rw-r--r--plugins/code-modernization/commands/modernize-preflight.md2
3 files changed, 33 insertions, 14 deletions
diff --git a/plugins/code-modernization/commands/modernize-assess.md b/plugins/code-modernization/commands/modernize-assess.md
index 51c73461..a78f761f 100644
--- a/plugins/code-modernization/commands/modernize-assess.md
+++ b/plugins/code-modernization/commands/modernize-assess.md
@@ -1,5 +1,5 @@
---
-description: Full discovery & portfolio analysis of a legacy system — inventory, complexity, debt, effort estimation
+description: Full discovery & portfolio analysis of a legacy system — inventory, complexity, debt, relative scale
argument-hint: <system-dir> [--show-secrets] | --portfolio <parent-dir>
---
@@ -62,11 +62,19 @@ cyclomatic complexity (CCN). For dependency freshness, locate the
manifest (`package.json`, `pom.xml`, `*.csproj`, `requirements*.txt`,
copybook dir) and note its age / pinned-version count.
-## Step P2 — COCOMO-II effort
+## Step P2 — COCOMO-II complexity index
-Compute person-months per system using COCOMO-II basic:
-`PM = 2.94 × (KSLOC)^1.10` (nominal scale factors). Show the formula and
-inputs so the figure is defensible, not a guess.
+Compute the COCOMO-II basic figure per system: `2.94 × (KSLOC)^1.10`
+(nominal scale factors). Show the formula and inputs so it is defensible,
+not a guess.
+
+**Use this only as a relative complexity/scale index** for ranking and
+sequencing systems — bigger number = bigger, more complex estate. **It is
+not a modernization timeline or cost.** The COCOMO person-month figure
+assumes traditional human-team productivity; agentic transformation does
+not follow those productivity curves, so do not present it (or convert it)
+as how long the work will take or what it will cost. Label the column as an
+index, not "person-months", and never attach a date or duration to it.
## Step P3 — Documentation coverage
@@ -79,7 +87,7 @@ Report coverage % and the top undocumented subsystems.
Write `analysis/portfolio.html` (dark `#1e1e1e` bg, `#d4d4d4` text,
`#cc785c` accent, system-ui font, all CSS inline). One row per system;
columns: **System · Lang · KSLOC · Files · Mean CCN · Max CCN · Dep
-Freshness · Doc Coverage % · COCOMO PM · Risk**. Color-grade the PM and
+Freshness · Doc Coverage % · Complexity (COCOMO index) · Risk**. Color-grade the index and
Risk cells (green→amber→red). Below the table, a 2-3 sentence
sequencing recommendation: which system first and why.
@@ -101,11 +109,15 @@ Run and show the output of:
scc legacy/$1
```
Then run `scc --by-file -s complexity legacy/$1 | head -25` to identify the
-highest-complexity files. Capture the COCOMO effort/cost estimate scc provides.
+highest-complexity files. Capture scc's COCOMO figure **only as a relative
+complexity/scale index** — and **ignore scc's "Estimated Schedule Effort"
+and cost-in-dollars lines**: those project a human-team timeline and budget,
+which are invalid for agentic modernization (see the not-a-timeline note in
+Step 6).
If `scc` is not installed, fall back in order:
-1. `cloc legacy/$1` for the LOC table, then compute COCOMO-II effort
- yourself: `PM = 2.94 × (KSLOC)^1.10` (nominal scale factors). Show the
+1. `cloc legacy/$1` for the LOC table, then compute the COCOMO-II index
+ yourself: `2.94 × (KSLOC)^1.10` (nominal scale factors). Show the
inputs.
2. If `cloc` is also missing, use `find` + `wc -l` grouped by extension
for LOC, and rank file complexity by counting decision keywords
@@ -208,7 +220,7 @@ Create `analysis/$1/ASSESSMENT.md` with these sections:
- **Technical Debt** (top 10, ranked)
- **Security Findings** (CWE table)
- **Documentation Gaps** (top 5)
-- **Effort Estimation** (COCOMO-derived person-months, ±range, key cost drivers)
+- **Relative Scale** (the COCOMO-II index + KSLOC as a complexity/scale signal for ranking this system against others. **Not a timeline:** state plainly that this is a relative size measure, not an estimate of how long modernization will take or what it will cost — it assumes traditional human-team productivity, which agentic transformation does not follow. Do not print person-months, a schedule, a cost, or a date.)
- **Recommended Modernization Pattern** (one of: Rehost / Replatform / Refactor / Rearchitect / Rebuild / Replace — with one-paragraph rationale)
Also create `analysis/$1/ARCHITECTURE.mmd` containing the Mermaid domain
diff --git a/plugins/code-modernization/commands/modernize-brief.md b/plugins/code-modernization/commands/modernize-brief.md
index 5daa611e..9546733f 100644
--- a/plugins/code-modernization/commands/modernize-brief.md
+++ b/plugins/code-modernization/commands/modernize-brief.md
@@ -40,11 +40,18 @@ fewest-dependencies first. For each phase:
- Scope (which legacy modules, which target services)
- Entry criteria (what must be true to start)
- Exit criteria (what tests/metrics prove it's done)
-- Estimated effort (person-months, same unit as the assessment's COCOMO
- figure — convert deliberately if you present weeks)
+- Relative scale (T-shirt size — S/M/L/XL — anchored to the phase's share
+ of the assessment's COCOMO complexity index. This ranks phases by size
+ against each other; it is **not** a duration. Do **not** state
+ person-months, weeks, calendar dates, or a delivery estimate — agentic
+ transformation does not follow the human-team productivity curves those
+ units assume, so any time figure here would be misleading.)
- Risk level + top 2 risks + mitigation
-Render the phases as a Mermaid `gantt` chart.
+Render the phases as a Mermaid `flowchart LR` showing **sequence and
+dependencies** (Phase 1 → Phase 2 → …, with branches where phases are
+independent). Do **not** use a `gantt` chart — gantt encodes calendar
+durations, and this plan deliberately makes no time claims.
### 4. Business Walkthroughs
For each persona flow in `analysis/$1/topology.json` (`flows` — produced
diff --git a/plugins/code-modernization/commands/modernize-preflight.md b/plugins/code-modernization/commands/modernize-preflight.md
index ed283ea3..ff91c2a3 100644
--- a/plugins/code-modernization/commands/modernize-preflight.md
+++ b/plugins/code-modernization/commands/modernize-preflight.md
@@ -27,7 +27,7 @@ used for, and what degrades without it:
| Tool | Used by | Without it |
|---|---|---|
-| `scc` (or `cloc`) | assess | LOC/complexity fall back to `find`+`wc`; COCOMO estimate gets coarser |
+| `scc` (or `cloc`) | assess | LOC/complexity fall back to `find`+`wc`; the COCOMO complexity index gets coarser |
| `lizard` | assess --portfolio | complexity estimated from decision-keyword counts |
| `glow` | all | markdown artifacts render as plain text |
| `delta` | transform | side-by-side diffs fall back to `diff -y` |