[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6DA7DV99JKQ623GX67913X7":3,"skill-same:01M6DA7DV99JKQ623GX67913X7":60},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":31,"linkOnly":32,"markdownContent":33,"markdownBody":34,"frontMatter":35,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":40,"repositoryHtmlUrl":41,"repositoryHomepageUrl":6,"ownerHtmlUrl":42,"ownerBlogUrl":43,"ownerDescription":44,"updatedAt":45,"install":46,"resources":59},"01M6DA7DV99JKQ623GX67913X7","diet-evaluate-removal",null,"Data-driven deep evaluation of whether a dependency is worth removing","future-architect\u002Fuzomuzo-oss","future-architect","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F14890632?v=4","01M6DA6C4A1ESW410NS3Y424QR","Future Corp","01M6DA6C8ET9B0110HVZD8DCZB",45,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Ffuture-architect\u002Fuzomuzo-oss\u002Fblob\u002Fmain\u002Fclaude-skills\u002Fdiet-evaluate-removal\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30],"diet evaluate removal","diet","evaluate","github","Evaluation","data","dependency","deep","driven","name","errors","data-driven","2026-11-10 10:12:30",false,"---\nname: diet-evaluate-removal\ndescription: \"Data-driven deep evaluation of whether a dependency is worth removing\"\nargument-hint: \"\u003Cdependency name, e.g. github.com\u002Fpkg\u002Ferrors>\"\n---\n\n# Diet Removal Evaluation: $ARGUMENTS\n\nDeep-dive evaluation of whether `$ARGUMENTS` is worth removing, using a 5-phase data-driven framework. This command picks up where `uzomuzo diet` leaves off -- diet gives you the priority ranking, this gives you the removal verdict.\n\n**When to use**: After `uzomuzo diet` ranks a dependency and you need to decide whether to invest the effort. Works for any difficulty level -- trivial deps get a quick confirmation, hard deps get a concrete migration plan.\n\n**Relationship to other skills**:\n- `uzomuzo diet` tells you **ranking and difficulty** (automated, all dependencies at once)\n- `\u002Fdiet-evaluate-removal` tells you **whether it's worth removing** and **how** (LLM-powered, one dependency at a time)\n- `\u002Fdiet-assess-risk` tells you **how dangerous it is to keep** (LLM-powered, security focus)\n- `\u002Fdiet-remove` **executes the removal** (LLM-powered, implementation)\n\n---\n\n## Phase 1: Ingest Diet Data\n\nExtract the target dependency's diet JSON entry. Prefer existing JSON over re-running diet.\n\n**Option A -- existing diet JSON** (preferred):\n```bash\njq '.dependencies[] | select(.name == \"$ARGUMENTS\")' diet.json\n```\n\n**Option B -- run diet now**:\n```bash\nuzomuzo diet --sbom bom.json --source . --format json | jq '.dependencies[] | select(.name == \"$ARGUMENTS\")'\n```\n\n### Check that coupling was actually measured\n\n`difficulty` and `coupling_effort` are only meaningful when diet matched imports in the source tree. When source analysis is skipped, fails, or finds no import of any dependency (typically because `--source` points at the wrong directory; diet logs `no imports matched any dependency`), diet gives every entry without a `scope` `import_file_count = call_site_count = 0`, `coupling_effort = 0`, `difficulty = \"trivial\"`, and `is_unused = false` (`tool` and `runtime` entries get a placeholder `api_breadth = 1` and show `easy`). Here \"trivial\" means \"not measured\", not \"easy to remove\".\n\nDetect it across the whole JSON, not from the one entry:\n\n```bash\njq '[.dependencies[] | select(.scope == null)]\n    | if length == 0 then \"undetermined\" else all(.import_file_count == 0 and (.is_unused | not)) end' diet.json\n```\n\n`true` means coupling was not measured. `\"undetermined\"` means every dependency has a `scope`, so this check cannot tell; look at the diet log for `no imports matched any dependency`. (`source_root` does not tell you: the CLI fills it with `.` by default.) Re-run diet with `--source` pointing at the project root the SBOM was generated from. If that is impossible, write \"unmeasured\" for Coupling Depth and Production Scope and say so in the verdict.\n\nExample of the trap: `{\"difficulty\": \"trivial\", \"coupling_effort\": 0, \"is_unused\": false, \"import_file_count\": 0}` looks like a free removal, but if every other entry looks the same, nobody has looked at the code yet.\n\n### Signals that are not in diet JSON\n\nDiet JSON does not carry the OSV malicious-package check or the npm dormant-release marker. Get them from `uzomuzo scan` for the exact version in the SBOM:\n\n```bash\nuzomuzo scan \"pkg:npm\u002Fexample@1.2.3\" --format json \\\n  | jq '.packages[0] | {lifecycle, reason, stable_version, malicious, malicious_check, dormant_release,\n                       direct_advisory_count, transitive_advisory_count, max_cvss3_score}'\n```\n\n| Field | Meaning for this evaluation |\n|-------|-----------------------------|\n| `malicious` present | An OSV advisory names this version (or, with `scope: \"package\"`, the whole package) as malicious. Stop the evaluation -- see the first row of the Recommendation logic. |\n| `malicious_check: \"unknown\"` | The malicious lookup failed. Say so in the verdict; do not treat it as clean. |\n| both absent | Clean for npm, PyPI, crates.io, Go, and Maven. For any other ecosystem the check did not run: write \"not checked\". |\n| `dormant_release` present | (npm) This version came out after a year with no releases. Not a finding, but a reason to confirm who published it before trusting it. The marker is shown only for 7 days after publication (`until`), so its absence on an older version proves nothing; for a version pinned recently, compare its publish date with the previous release yourself. |\n| `reason` | Why scan chose the lifecycle label. Needed to interpret `Review Needed` (see Security Urgency below). |\n\n### Required fields to extract\n\nDisplay ALL of these from the diet JSON. Do NOT re-compute any of them.\n\n| Field | What it tells you |\n|-------|-------------------|\n| `name` \u002F `version` \u002F `ecosystem` | Dependency identity |\n| `purl` | Canonical package URL identifier |\n| `scope` | Dependency scope: `\"tool\"` (build-time-only), `\"runtime\"` (reflection\u002FServiceLoader-loaded) |\n| `rank` \u002F `priority_score` | Where this dep sits in the removal priority list |\n| `difficulty` | trivial \u002F easy \u002F moderate \u002F hard |\n| `exclusive_transitive` \u002F `total_transitive` | Deps removed together \u002F total transitive count |\n| `stays_as_indirect` | Whether it remains after removing direct usage |\n| `indirect_via` | Which other deps pull it in transitively |\n| `import_file_count` | Number of files importing this dep |\n| `call_site_count` | Total call sites across all files |\n| `api_breadth` | Number of distinct APIs used |\n| `symbols` | Exact API surface used (function\u002Ftype names) |\n| `import_files` | Exact file paths that import this dep |\n| `has_blank_import` \u002F `has_dot_import` \u002F `has_wildcard_import` | Special import patterns |\n| `is_unused` | Whether diet found zero imports (always `false` for `tool` \u002F `runtime` scope, and for every entry when coupling was not measured) |\n| `lifecycle` | Active \u002F Stalled \u002F Legacy-Safe \u002F EOL-Confirmed \u002F EOL-Effective \u002F EOL-Scheduled \u002F Archived \u002F Review Needed |\n| `has_vulnerabilities` \u002F `vulnerability_count` \u002F `max_cvss_score` | Advisories on the package's **latest release, including advisories in its dependencies** -- not on the version in your SBOM (see below) |\n| `overall_score` | OpenSSF Scorecard overall score (0-10) |\n| `graph_impact` \u002F `coupling_effort` \u002F `health_risk` | Score components (each 0.0-1.0) |\n\n### How to read the health fields\n\n- **Vulnerability fields describe the latest release, including its dependencies.** Diet takes them from the release uzomuzo picks as the newest (the stable release; failing that, the highest version, then a pre-release, then the requested version), not from the pinned version, and it counts advisories in that release's own dependencies too. Split them with scan's `direct_advisory_count` and `transitive_advisory_count`:\n  - Direct advisories on the latest release mean \"even upgrading does not fix these\" -- a strong reason to remove or replace.\n  - Transitive-only advisories (`direct_advisory_count` 0) are in a package this one depends on. They argue for a dependency bump upstream, not for removing this package. `max_cvss_score` may come from them.\n  - For the version you actually ship, query OSV for that exact version (`osv-scanner`, `govulncheck`, `npm audit`, `pip-audit`). If the pinned version is vulnerable but the latest release is clean, the fix is an upgrade, not a removal.\n- **`Archived` is diet's own label.** Diet writes `Archived` whenever the source repository is archived, overriding the lifecycle label. Check scan's `stable_version` and its release date before concluding fixes stopped: packages that moved into a monorepo keep publishing from the new repository while the old one is archived. `uzomuzo scan` reports the same package as `Stalled` unless the registry also gives an explicit end-of-life signal ([ADR-0020](https:\u002F\u002Fgithub.com\u002Ffuture-architect\u002Fuzomuzo-oss\u002Fblob\u002Fmain\u002Fdocs\u002Fadr\u002F0020-archived-registry-liveness.md)). Archived alone does not mean \"already broken\".\n- **`Review Needed` now has specific causes**, visible in scan's `reason`: too little data to classify (`Insufficient data for assessment`, `Commit data missing`); every published release is yanked ([ADR-0022](https:\u002F\u002Fgithub.com\u002Ffuture-architect\u002Fuzomuzo-oss\u002Fblob\u002Fmain\u002Fdocs\u002Fadr\u002F0022-all-releases-yanked-is-not-eol.md)); or (npm) a release burst across release lines after a long silence ([ADR-0026](https:\u002F\u002Fgithub.com\u002Ffuture-architect\u002Fuzomuzo-oss\u002Fblob\u002Fmain\u002Fdocs\u002Fadr\u002F0026-dormant-release-burst.md)). The last two are not \"unknown\" -- see Security Urgency in Phase 4.\n- **`health_risk` is 1.0 for a malicious version**, but 1.0 can also come from EOL plus a high CVSS score. Use scan's `malicious` field, not `health_risk`, to tell them apart.\n- **`coupling_effort` formula** (for explaining a difficulty label): `0.4 * L(import_file_count, 5) + 0.4 * L(call_site_count, 20) + 0.2 * L(api_breadth, 10)`, where `L(x, m)` is a logistic curve that reaches 0.5 at `x = m`. Labels: exactly `0` is trivial, `\u003C 0.25` easy, `\u003C 0.6` moderate, otherwise hard. Effort is exactly 0 only when the dependency is unused, is used through a blank import alone, or coupling was not measured -- so \"trivial\" never means \"a few call sites\".\n\n### Data quality check\n\nBefore proceeding, flag any of these patterns -- they indicate diet's coupling data may be unreliable:\n\n- `is_unused: true` -- `is_unused` only means diet found no import. Dependencies loaded through configuration, plugins, reflection, ServiceLoader, or build commands still show as unused unless diet knows them (it recognizes Go `tool` directives and a fixed list of Java runtime libraries such as JDBC drivers and logging backends). Before treating an unused dependency as removable, search for its name in the source -- including `import type` \u002F `export type ... from` lines, which diet ignores, and places diet does not read (a `build\u002F`, `dist\u002F`, or `target\u002F` directory next to the manifest of a tool that writes there, such as `dist\u002F` next to `package.json` or `target\u002F` next to `pom.xml`; in files over 1 MiB, call sites and any import after the first 64 KiB; file types it does not parse) -- and in configuration and build files (`*.yml`, `*.properties`, `META-INF\u002Fservices\u002F*`, `spring.factories`, `package.json` scripts and config files, `Makefile`, CI workflows).\n- `scope: \"tool\"` + `import_file_count: 0` -- Expected for build-time-only tool deps. Not an IBNC pattern. These have zero runtime imports by design.\n- `scope: \"runtime\"` + `import_file_count: 0` -- Expected for runtime-mechanism deps (JDBC drivers, logging backends, Spring auto-config). Loaded via reflection\u002FServiceLoader\u002Fclasspath, not static imports.\n- `has_blank_import: true` + `call_site_count: 0` -- The blank import IS the usage (Go DB drivers, JS polyfills). Coupling is underestimated.\n- `has_wildcard_import: true` -- All symbols are in scope. `api_breadth` may undercount.\n- `has_dot_import: true` -- Broadly coupled; symbols lack package qualifier.\n- `import_file_count > 0` + `call_site_count: 0` (without blank\u002Fdot\u002Fwildcard flags) -- Possible IBNC pattern (type-only usage, annotation processing, framework DI, config-driven plugins). Investigate before trusting \"0 calls.\" Note: distinct from the blank-import pattern above -- blank imports typically produce `call_site_count = 1`, not 0.\n\n---\n\n## Phase 2: Usage Classification\n\nClassify each entry in `import_files` by its role in the project. This is the single most important step -- it determines the **effective difficulty** of removal.\n\n### Classification categories\n\n| Category | Path patterns | Impact |\n|----------|--------------|--------|\n| **Production** | `src\u002F`, `lib\u002F`, `internal\u002F`, `pkg\u002F`, `cmd\u002F`, `app\u002F` (not under test\u002F) | Full migration required |\n| **Test** | `*_test.go`, `test\u002F`, `tests\u002F`, `__tests__\u002F`, `spec\u002F`, `*.test.ts` | Can delete or swap independently |\n| **CI \u002F Infrastructure** | `.github\u002F`, `scripts\u002F`, `ci\u002F`, `Makefile`, `build\u002F` | Often trivially replaceable |\n| **Example \u002F Demo** | `examples\u002F`, `example\u002F`, `demo\u002F`, `sample\u002F` | Can delete or update separately |\n| **Generated** | Files with `\u002F\u002F Code generated` header, `*_gen.go`, `*.pb.go` | Re-run generator with replacement |\n| **Vendored** | `vendor\u002F`, `node_modules\u002F`, `third_party\u002F` | Exclude from analysis -- copies of the dep, not usage |\n\n### Output format\n\n```\nUsage Classification for {name}:\n  Production:     {N} files  [{file list}]\n  Test:           {N} files  [{file list}]\n  CI\u002FInfra:       {N} files  [{file list}]\n  Example:        {N} files  [{file list}]\n  Generated:      {N} files  [{file list}]\n\n  Effective scope: {N} production files (out of {total} total)\n```\n\n### Effective difficulty adjustment\n\n| diet difficulty | All files are test\u002FCI\u002Fexample | Adjusted difficulty |\n|----------------|------------------------------|---------------------|\n| hard | Yes | easy (no production impact) |\n| moderate | Yes | trivial |\n| easy\u002Ftrivial | -- | unchanged |\n\nIf ALL import files are non-production, note: **\"Zero production code impact.\"**\n\nFor `scope: \"runtime\"` dependencies, `import_files` is empty but the dependency runs in production. Classify the files that wire it instead (configuration, connection strings, `META-INF\u002Fservices\u002F*`, `Class.forName` calls) as Production, and never treat an empty list as \"zero production files\" for Production Scope or Effort.\n\n---\n\n## Phase 3: Feasibility Analysis\n\nTwo checks that diet cannot automate: API leakage (a binary gate) and symbol replaceability (requires domain knowledge).\n\n### 3a. API Leakage Check (GATE)\n\n**Critical question**: Do any types from this dependency appear in EXPORTED identifiers?\n\n- If **yes** -- removing it is a **breaking change** for downstream consumers. Flag this immediately. The verdict must account for the breaking change cost.\n- If **no** -- internal swap, no API impact.\n\nLook for the package's types in **exported function signatures** (parameter types, return types), **exported struct field types**, and **exported interface method signatures**. Internal usage within function bodies is NOT API leakage.\n\nCheck approach by ecosystem:\n\n| Ecosystem | What to check |\n|-----------|---------------|\n| Go | Exported func signatures, struct fields, and interface methods that reference the dep's types. Search non-test files for the dep's package name in type positions. |\n| npm\u002FTS | `export ... from '{pkg}'` re-exports, or exported types\u002Finterfaces using the dep's types. |\n| Python | Re-exports in `__init__.py` files: `from {pkg} import ...` that are part of the public API. |\n| Java\u002FMaven | Public class signatures, method parameters, return types, or field types referencing the dep's packages in non-test source sets. |\n\n### 3b. Symbol Migration Map\n\nUsing the `symbols` list from diet, classify each symbol's replaceability. This is where the LLM adds the most value.\n\n```\nSymbol Migration Map for {name}:\n\n| Symbol | Category | Replacement | Notes |\n|--------|----------|-------------|-------|\n| {sym1} | stdlib   | {specific function} | Available since {version} |\n| {sym2} | existing-dep | {dep already in project} | Already in go.mod\u002Fpackage.json |\n| {sym3} | self-impl | {N}-line implementation | Non-crypto, well-defined |\n| {sym4} | no-replacement | -- | Crypto\u002Fprotocol, keep or find alternative lib |\n\nSummary: {N}\u002F{total} stdlib, {N} existing-dep, {N} self-impl, {N} no-replacement.\n```\n\n**Rules for symbol classification**:\n- **stdlib**: Prefer this. Name the specific function (e.g., `os.UserHomeDir()`, `slices.SortFunc()`). Note the minimum language version required.\n- **existing-dep**: A dependency already in the project provides this. No new dependency added.\n- **self-impl**: Only for non-crypto, non-protocol, non-security functionality. Estimate lines of code including tests.\n- **no-replacement**: The symbol has no viable alternative. This blocks removal unless the feature can be dropped.\n\n**Special cases**:\n- If `is_unused: true` and the Data quality search found no use -- skip this step. If the search found use, build the map from the places it found, and treat those files as Production in Phase 2.\n- If `has_blank_import: true` and `call_site_count \u003C= 1` -- the import itself is the usage (driver registration, polyfill). Check what `init()` does; the replacement is typically a different driver package, not a code change. Score Replaceability as High if a drop-in alternative driver\u002Fpolyfill exists, Low if not.\n- If `symbols` is empty but `import_file_count > 0` (without blank\u002Fdot\u002Fwildcard flags) -- diet's coupling analysis may be incomplete. Manually inspect the import files to determine actual API usage before scoring Replaceability. Note the gap in the rationale.\n\n### 3c. Verification Cost\n\nWith a coding agent doing the edits, rewriting call sites is rarely the expensive part of a removal. The expensive part is proving the replacement behaves the same. That cost depends on whether the code that calls the dependency is already under test.\n\nFor each **production** file from Phase 2, check whether a test exercises it (a sibling `*_test.go`, `test_*.py`, `*.test.ts`, `src\u002Ftest\u002F...` class, or a test that imports the file's package\u002Fmodule). Record:\n\n```\nVerification Cost for {name}:\n  Production import files with tests:    {N}  [{file list}]\n  Production import files without tests: {N}  [{file list}]\n  Behavior-sensitive symbols:            {symbols whose replacement may differ at edge cases -- parsing, formatting, time, network addresses, error wrapping, encoding}\n```\n\nExample: three production files call `iplib.NewNet4(...)`, and none has a test. Replacing it with `net\u002Fnetip` takes minutes to type, but `\u002F31` and `\u002F32` prefixes behave differently between the two libraries, so the removal must start by writing tests against the current behavior. That is where the time goes, and Effort below accounts for it.\n\n---\n\n## Phase 4: 6-Axis Quantitative Scoring\n\nRate each axis High\u002FMed\u002FLow using the data gathered in Phases 1-3. Each axis is anchored to concrete data -- no guesswork.\n\n| Axis | Data Source | High (favors removal) | Medium | Low (discourages removal) |\n|------|-----------|------|--------|------|\n| **Transitive Cleanup** | `exclusive_transitive` | >= 10 exclusive deps | 1-9 exclusive | 0 exclusive |\n| **Production Scope** | Phase 2 classification | 0 production files (all test\u002FCI\u002Fexample) | \u003C 50% production files | >= 50% production files |\n| **Coupling Depth** | `coupling_effort`, `import_file_count`, `call_site_count` | `coupling_effort` \u003C 0.25 (trivial\u002Feasy) | 0.25 - 0.6 (moderate) | >= 0.6 (hard, deeply wired) |\n| **Replaceability** | Phase 3b symbol map | > 80% symbols have stdlib\u002Fexisting-dep replacement | 50-80% replaceable | \u003C 50%, or crypto\u002Fprotocol involved |\n| **Security Urgency** | `has_vulnerabilities`, `max_cvss_score`, `lifecycle`, scan `direct_advisory_count` \u002F `reason` \u002F `dormant_release` | Direct advisories on the latest release with CVSS >= 7.0 (no upstream fix), or lifecycle EOL-Confirmed\u002FEOL-Effective, or `dormant_release.kind = \"burst_across_lines\"` (whatever the label) | Direct advisories with CVSS 4.0-6.9, or lifecycle Stalled\u002FEOL-Scheduled\u002FArchived, or `Review Needed` for lack of data, or `dormant_release.kind = \"fresh\"` | No direct advisories on the latest release, or only ones with CVSS below 4.0 (transitive-only counts here), lifecycle Active\u002FLegacy-Safe. A direct advisory with no CVSS score counts as Medium until its severity is looked up |\n| **Cascade Potential** | `exclusive_transitive`, project knowledge | Removing unblocks 3+ further removals | Unblocks 1-2 | Standalone, no cascade |\n\n### Scoring overrides\n\n- **Coupling Depth override**: When Phase 2 shows ALL import files are non-production (test\u002FCI\u002Fexample), override Coupling Depth to **High** regardless of `coupling_effort`. Test\u002FCI refactoring is low-risk regardless of call count.\n- **Transitive Cleanup caveat**: When `stays_as_indirect: true`, `exclusive_transitive` may overestimate actual cleanup -- some \"exclusive\" transitives may remain reachable via the indirect path. Note this uncertainty in the rationale.\n- **Unmeasured coupling**: When Phase 1 found that coupling was not measured, write \"unmeasured\" for Coupling Depth and Production Scope instead of a rating. Do not let a \"trivial\" label from an unmeasured run count as High.\n- **Rate the lifecycle part from scan when diet says `Archived`**: diet overwrites the lifecycle label with `Archived` whenever the repository is archived, even when the registry has declared end of life. Example: an npm-deprecated package with an archived repository is `EOL-Confirmed` in scan but `Archived` in diet. Use scan's `lifecycle` for the rating (EOL-Confirmed \u002F EOL-Effective -> High, Stalled -> Medium).\n- **Highest matching column wins**: if the inputs match both High and Medium (e.g., Stalled with a direct CVSS 8.1 advisory), rate High.\n- **All releases yanked is not a security signal**: it is handled by its own Recommendation row; rate Security Urgency from the other inputs.\n- **Security Urgency is about removal, not upgrade**: If the pinned version has advisories but the latest release is clean, the remedy is an upgrade. Rate Security Urgency from the latest release's **direct** advisories, and mention the upgrade in the rationale. When both direct and transitive advisories exist, `max_cvss_score` may belong to a transitive one; look up the direct advisories' scores on OSV before rating.\n\n### Scoring output\n\n```\n6-Axis Scores:\n  Transitive Cleanup:  {H\u002FM\u002FL} -- {exclusive_transitive} exclusive deps ({reasoning})\n  Production Scope:    {H\u002FM\u002FL} -- {N}\u002F{total} files are production ({reasoning})\n  Coupling Depth:      {H\u002FM\u002FL} -- effort={coupling_effort:.2f}, {call_site_count} calls across {api_breadth} APIs\n  Replaceability:      {H\u002FM\u002FL} -- {N}\u002F{total} symbols replaceable ({reasoning})\n  Security Urgency:    {H\u002FM\u002FL} -- {lifecycle}, {vulnerability_count} vulns, max CVSS {max_cvss_score}\n  Cascade Potential:   {H\u002FM\u002FL} -- {reasoning}\n\nVerification Cost (feeds Effort, not an axis):\n  {N}\u002F{production files} production import files have tests; behavior-sensitive symbols: {list or \"none\"}\n```\n\n---\n\n## Phase 5: Verdict\n\nSynthesize all phases into a structured recommendation. Use the exact field names from diet JSON.\n\n```\n### Verdict: {name}@{version}\n\n**Diet Data**:\n  rank: #{rank}\n  priority_score: {priority_score:.3f}\n  difficulty: {difficulty}\n  ecosystem: {ecosystem}\n\n**Graph**:\n  exclusive_transitive: {exclusive_transitive}\n  total_transitive: {total_transitive}\n  stays_as_indirect: {stays_as_indirect}\n  indirect_via: {indirect_via or \"none\"}\n\n**Coupling**:\n  {import_file_count} files ({N} production, {N} test, {N} other)\n  {call_site_count} calls across {api_breadth} APIs\n  symbols: {symbols count} ({N} stdlib-replaceable, {N} self-impl, {N} no-replacement)\n\n**Health**:\n  lifecycle: {lifecycle} {-- scan reason: {reason} if Review Needed}\n  vulnerabilities on latest release: {vulnerability_count} ({direct_advisory_count} direct, {transitive_advisory_count} via its dependencies; max CVSS {max_cvss_score})\n  vulnerabilities on pinned version: {from OSV, or \"not checked\"}\n  malicious check: {clean \u002F flagged: {advisory_id} \u002F unknown}\n  dormant release: {none \u002F {silent_days} days of silence before this version}\n\n**API Leakage**: {Yes (BREAKING CHANGE) \u002F No}\n**Verification Cost**: {N}\u002F{production files} production import files have tests\n\n**6-Axis Summary**:\n  {axis}: {H\u002FM\u002FL}  (x6, from Phase 4)\n\n**Recommendation**: REMOVE \u002F DEFER \u002F KEEP \u002F UPGRADE \u002F REPLACE \u002F REPLACE VERSION NOW\n**Effort**: Trivial (\u003C1h) \u002F Small (1-4h) \u002F Medium (1-3d) \u002F Large (1w+)\n**Priority**: S (do now) \u002F A (this sprint) \u002F B (when convenient) \u002F C (keep for now)\n**Rationale**: {1-2 sentences -- why this recommendation, citing the key axis scores}\n```\n\n### Recommendation logic\n\nRules are evaluated **top-to-bottom; first match wins.** If multiple rows could match, the earlier row takes priority.\n\n| Condition | Recommendation |\n|-----------|---------------|\n| scan `malicious` present | REPLACE VERSION NOW, Priority S. This is incident response, not a removal decision: move to a version the advisory does not name (or, for `scope: \"package\"`, remove the package), and run `\u002Fdiet-assess-risk` to judge what the malicious code could have reached. Skip the rest of this table |\n| `is_unused: true`, and the search in the Data quality check finds no use | REMOVE, Trivial, Priority S |\n| Pinned version has advisories, the pinned version is older than the latest release, an OSV check of the latest release (with the dependency versions it resolves to in your project) no longer shows them, and lifecycle is Active or Legacy-Safe | UPGRADE, Priority A. Stop here; name in the rationale any axis that would still argue for removal later |\n| scan `reason` starts with `All releases yanked on` | REPLACE, Priority A -- no version resolves any more, so a fresh install or lockfile update can break. This is build continuity, not security: do not use it to justify a breaking change |\n| Coupling Depth or Production Scope is \"unmeasured\" | DEFER -- re-run diet with the correct `--source`, or read the import sites by hand, then evaluate again. Exception: if Security Urgency is High, do not stop here; continue to the rows below, which still apply (API leakage, crypto\u002Fprotocol replacement). Rate Replaceability by reading the import sites, not from the empty `symbols` list, and note the missing coupling data in the rationale |\n| API leakage = Yes AND Security Urgency = High | REMOVE with BREAKING CHANGE warning -- security overrides API stability. Rationale must document the breaking change and recommend a major version bump or deprecation timeline. Escalate to `\u002Fdiet-assess-risk` |\n| API leakage = Yes | DEFER (needs major version bump or deprecation period) |\n| Replaceability = Low (crypto\u002Fprotocol) | KEEP -- find an alternative maintained library rather than self-implementing. If Security Urgency is also High, escalate to `\u002Fdiet-assess-risk` for full risk analysis. Never recommend self-implementing crypto\u002Fprotocol |\n| All 6 axes High or Med | REMOVE |\n| 1-2 axes Low, rest High\u002FMed | REMOVE -- note the Low axes as caveats in rationale |\n| Security Urgency = High, others mixed | REMOVE (prioritize security). Suggest `\u002Fdiet-assess-risk` for full analysis |\n| `stays_as_indirect: true` AND Coupling Depth = High | REMOVE (still valuable: delegates version management, unblocks future cleanup) |\n| >= 3 axes Low | KEEP |\n\n### Effort derivation\n\n| Effort | Criteria |\n|--------|----------|\n| Trivial (\u003C1h) | `is_unused: true`, OR 0 production files, OR all symbols stdlib-replaceable with \u003C= 3 files |\n| Small (1-4h) | \u003C= 5 production files AND > 80% symbols replaceable |\n| Medium (1-3d) | 6-15 production files, OR 50-80% symbols replaceable, OR API leakage requiring deprecation |\n| Large (1w+) | > 15 production files, OR \u003C 50% symbols replaceable, OR crypto\u002Fprotocol replacement needed |\n\nAfter picking a row, **raise Effort one level** when more than half of the production import files have no tests and the used symbols include behavior-sensitive ones (Phase 3c). Those tests must be written before the swap, and they take longer than the swap itself. Do not lower Effort for having an agent do the edits -- the time estimate is for the whole removal including review and verification.\n\n### When to recommend further analysis\n\n- Security Urgency = High --> \"Consider running `\u002Fdiet-assess-risk {name}` for full data-flow analysis.\"\n- Recommendation = REMOVE, Effort >= Medium --> \"Use `\u002Fdiet-remove {name} --pr` for guided implementation.\"\n- Recommendation = REMOVE, external project --> \"Use `\u002Fdiet-remove {name} --repo {owner\u002Frepo}` to file an issue.\"\n\n---\n\n## Important rules\n\n- **Start from diet's output.** Never re-compute fields that diet already provides. But check that coupling was measured (Phase 1) before trusting `difficulty`, and fetch the malicious and dormant-release signals from `uzomuzo scan`, because diet JSON does not carry them.\n- **Know which version a number describes.** Diet's vulnerability fields describe the latest release and include its dependencies' advisories; the version you ship may be better or worse.\n- **Classify before scoring.** Usage classification (Phase 2) changes everything -- always do it before the 6-axis scoring.\n- **API leakage is a gate, not a spectrum.** If exported types depend on this package, flag it immediately.\n- **Be concrete about replacements.** Don't say \"use stdlib\" -- name the specific function, note the version requirement, show the migration pattern.\n- **Respect IBNC patterns.** If `has_blank_import` is true and `call_site_count` is 0, the import IS the usage. Don't call it \"unused.\"\n- **This works for any language.** The `ecosystem` field in diet JSON tells you which language. Use the ecosystem-specific commands in Phase 3a.\n- **One dependency at a time.** This skill is for deep single-dep analysis. For several dependencies, run one evaluation per dependency -- in parallel subagents if your environment has them -- and merge the verdict blocks afterwards. Keep each evaluation independent; a shared context tends to copy one dependency's conclusions onto the next.\n","# Diet Removal Evaluation: $ARGUMENTS\n\nDeep-dive evaluation of whether `$ARGUMENTS` is worth removing, using a 5-phase data-driven framework. This command picks up where `uzomuzo diet` leaves off -- diet gives you the priority ranking, this gives you the removal verdict.\n\n**When to use**: After `uzomuzo diet` ranks a dependency and you need to decide whether to invest the effort. Works for any difficulty level -- trivial deps get a quick confirmation, hard deps get a concrete migration plan.\n\n**Relationship to other skills**:\n- `uzomuzo diet` tells you **ranking and difficulty** (automated, all dependencies at once)\n- `\u002Fdiet-evaluate-removal` tells you **whether it's worth removing** and **how** (LLM-powered, one dependency at a time)\n- `\u002Fdiet-assess-risk` tells you **how dangerous it is to keep** (LLM-powered, security focus)\n- `\u002Fdiet-remove` **executes the removal** (LLM-powered, implementation)\n\n---\n\n## Phase 1: Ingest Diet Data\n\nExtract the target dependency's diet JSON entry. Prefer existing JSON over re-running diet.\n\n**Option A -- existing diet JSON** (preferred):\n```bash\njq '.dependencies[] | select(.name == \"$ARGUMENTS\")' diet.json\n```\n\n**Option B -- run diet now**:\n```bash\nuzomuzo diet --sbom bom.json --source . --format json | jq '.dependencies[] | select(.name == \"$ARGUMENTS\")'\n```\n\n### Check that coupling was actually measured\n\n`difficulty` and `coupling_effort` are only meaningful when diet matched imports in the source tree. When source analysis is skipped, fails, or finds no import of any dependency (typically because `--source` points at the wrong directory; diet logs `no imports matched any dependency`), diet gives every entry without a `scope` `import_file_count = call_site_count = 0`, `coupling_effort = 0`, `difficulty = \"trivial\"`, and `is_unused = false` (`tool` and `runtime` entries get a placeholder `api_breadth = 1` and show `easy`). Here \"trivial\" means \"not measured\", not \"easy to remove\".\n\nDetect it across the whole JSON, not from the one entry:\n\n```bash\njq '[.dependencies[] | select(.scope == null)]\n    | if length == 0 then \"undetermined\" else all(.import_file_count == 0 and (.is_unused | not)) end' diet.json\n```\n\n`true` means coupling was not measured. `\"undetermined\"` means every dependency has a `scope`, so this check cannot tell; look at the diet log for `no imports matched any dependency`. (`source_root` does not tell you: the CLI fills it with `.` by default.) Re-run diet with `--source` pointing at the project root the SBOM was generated from. If that is impossible, write \"unmeasured\" for Coupling Depth and Production Scope and say so in the verdict.\n\nExample of the trap: `{\"difficulty\": \"trivial\", \"coupling_effort\": 0, \"is_unused\": false, \"import_file_count\": 0}` looks like a free removal, but if every other entry looks the same, nobody has looked at the code yet.\n\n### Signals that are not in diet JSON\n\nDiet JSON does not carry the OSV malicious-package check or the npm dormant-release marker. Get them from `uzomuzo scan` for the exact version in the SBOM:\n\n```bash\nuzomuzo scan \"pkg:npm\u002Fexample@1.2.3\" --format json \\\n  | jq '.packages[0] | {lifecycle, reason, stable_version, malicious, malicious_check, dormant_release,\n                       direct_advisory_count, transitive_advisory_count, max_cvss3_score}'\n```\n\n| Field | Meaning for this evaluation |\n|-------|-----------------------------|\n| `malicious` present | An OSV advisory names this version (or, with `scope: \"package\"`, the whole package) as malicious. Stop the evaluation -- see the first row of the Recommendation logic. |\n| `malicious_check: \"unknown\"` | The malicious lookup failed. Say so in the verdict; do not treat it as clean. |\n| both absent | Clean for npm, PyPI, crates.io, Go, and Maven. For any other ecosystem the check did not run: write \"not checked\". |\n| `dormant_release` present | (npm) This version came out after a year with no releases. Not a finding, but a reason to confirm who published it before trusting it. The marker is shown only for 7 days after publication (`until`), so its absence on an older version proves nothing; for a version pinned recently, compare its publish date with the previous release yourself. |\n| `reason` | Why scan chose the lifecycle label. Needed to interpret `Review Needed` (see Security Urgency below). |\n\n### Required fields to extract\n\nDisplay ALL of these from the diet JSON. Do NOT re-compute any of them.\n\n| Field | What it tells you |\n|-------|-------------------|\n| `name` \u002F `version` \u002F `ecosystem` | Dependency identity |\n| `purl` | Canonical package URL identifier |\n| `scope` | Dependency scope: `\"tool\"` (build-time-only), `\"runtime\"` (reflection\u002FServiceLoader-loaded) |\n| `rank` \u002F `priority_score` | Where this dep sits in the removal priority list |\n| `difficulty` | trivial \u002F easy \u002F moderate \u002F hard |\n| `exclusive_transitive` \u002F `total_transitive` | Deps removed together \u002F total transitive count |\n| `stays_as_indirect` | Whether it remains after removing direct usage |\n| `indirect_via` | Which other deps pull it in transitively |\n| `import_file_count` | Number of files importing this dep |\n| `call_site_count` | Total call sites across all files |\n| `api_breadth` | Number of distinct APIs used |\n| `symbols` | Exact API surface used (function\u002Ftype names) |\n| `import_files` | Exact file paths that import this dep |\n| `has_blank_import` \u002F `has_dot_import` \u002F `has_wildcard_import` | Special import patterns |\n| `is_unused` | Whether diet found zero imports (always `false` for `tool` \u002F `runtime` scope, and for every entry when coupling was not measured) |\n| `lifecycle` | Active \u002F Stalled \u002F Legacy-Safe \u002F EOL-Confirmed \u002F EOL-Effective \u002F EOL-Scheduled \u002F Archived \u002F Review Needed |\n| `has_vulnerabilities` \u002F `vulnerability_count` \u002F `max_cvss_score` | Advisories on the package's **latest release, including advisories in its dependencies** -- not on the version in your SBOM (see below) |\n| `overall_score` | OpenSSF Scorecard overall score (0-10) |\n| `graph_impact` \u002F `coupling_effort` \u002F `health_risk` | Score components (each 0.0-1.0) |\n\n### How to read the health fields\n\n- **Vulnerability fields describe the latest release, including its dependencies.** Diet takes them from the release uzomuzo picks as the newest (the stable release; failing that, the highest version, then a pre-release, then the requested version), not from the pinned version, and it counts advisories in that release's own dependencies too. Split them with scan's `direct_advisory_count` and `transitive_advisory_count`:\n  - Direct advisories on the latest release mean \"even upgrading does not fix these\" -- a strong reason to remove or replace.\n  - Transitive-only advisories (`direct_advisory_count` 0) are in a package this one depends on. They argue for a dependency bump upstream, not for removing this package. `max_cvss_score` may come from them.\n  - For the version you actually ship, query OSV for that exact version (`osv-scanner`, `govulncheck`, `npm audit`, `pip-audit`). If the pinned version is vulnerable but the latest release is clean, the fix is an upgrade, not a removal.\n- **`Archived` is diet's own label.** Diet writes `Archived` whenever the source repository is archived, overriding the lifecycle label. Check scan's `stable_version` and its release date before concluding fixes stopped: packages that moved into a monorepo keep publishing from the new repository while the old one is archived. `uzomuzo scan` reports the same package as `Stalled` unless the registry also gives an explicit end-of-life signal ([ADR-0020](https:\u002F\u002Fgithub.com\u002Ffuture-architect\u002Fuzomuzo-oss\u002Fblob\u002Fmain\u002Fdocs\u002Fadr\u002F0020-archived-registry-liveness.md)). Archived alone does not mean \"already broken\".\n- **`Review Needed` now has specific causes**, visible in scan's `reason`: too little data to classify (`Insufficient data for assessment`, `Commit data missing`); every published release is yanked ([ADR-0022](https:\u002F\u002Fgithub.com\u002Ffuture-architect\u002Fuzomuzo-oss\u002Fblob\u002Fmain\u002Fdocs\u002Fadr\u002F0022-all-releases-yanked-is-not-eol.md)); or (npm) a release burst across release lines after a long silence ([ADR-0026](https:\u002F\u002Fgithub.com\u002Ffuture-architect\u002Fuzomuzo-oss\u002Fblob\u002Fmain\u002Fdocs\u002Fadr\u002F0026-dormant-release-burst.md)). The last two are not \"unknown\" -- see Security Urgency in Phase 4.\n- **`health_risk` is 1.0 for a malicious version**, but 1.0 can also come from EOL plus a high CVSS score. Use scan's `malicious` field, not `health_risk`, to tell them apart.\n- **`coupling_effort` formula** (for explaining a difficulty label): `0.4 * L(import_file_count, 5) + 0.4 * L(call_site_count, 20) + 0.2 * L(api_breadth, 10)`, where `L(x, m)` is a logistic curve that reaches 0.5 at `x = m`. Labels: exactly `0` is trivial, `\u003C 0.25` easy, `\u003C 0.6` moderate, otherwise hard. Effort is exactly 0 only when the dependency is unused, is used through a blank import alone, or coupling was not measured -- so \"trivial\" never means \"a few call sites\".\n\n### Data quality check\n\nBefore proceeding, flag any of these patterns -- they indicate diet's coupling data may be unreliable:\n\n- `is_unused: true` -- `is_unused` only means diet found no import. Dependencies loaded through configuration, plugins, reflection, ServiceLoader, or build commands still show as unused unless diet knows them (it recognizes Go `tool` directives and a fixed list of Java runtime libraries such as JDBC drivers and logging backends). Before treating an unused dependency as removable, search for its name in the source -- including `import type` \u002F `export type ... from` lines, which diet ignores, and places diet does not read (a `build\u002F`, `dist\u002F`, or `target\u002F` directory next to the manifest of a tool that writes there, such as `dist\u002F` next to `package.json` or `target\u002F` next to `pom.xml`; in files over 1 MiB, call sites and any import after the first 64 KiB; file types it does not parse) -- and in configuration and build files (`*.yml`, `*.properties`, `META-INF\u002Fservices\u002F*`, `spring.factories`, `package.json` scripts and config files, `Makefile`, CI workflows).\n- `scope: \"tool\"` + `import_file_count: 0` -- Expected for build-time-only tool deps. Not an IBNC pattern. These have zero runtime imports by design.\n- `scope: \"runtime\"` + `import_file_count: 0` -- Expected for runtime-mechanism deps (JDBC drivers, logging backends, Spring auto-config). Loaded via reflection\u002FServiceLoader\u002Fclasspath, not static imports.\n- `has_blank_import: true` + `call_site_count: 0` -- The blank import IS the usage (Go DB drivers, JS polyfills). Coupling is underestimated.\n- `has_wildcard_import: true` -- All symbols are in scope. `api_breadth` may undercount.\n- `has_dot_import: true` -- Broadly coupled; symbols lack package qualifier.\n- `import_file_count > 0` + `call_site_count: 0` (without blank\u002Fdot\u002Fwildcard flags) -- Possible IBNC pattern (type-only usage, annotation processing, framework DI, config-driven plugins). Investigate before trusting \"0 calls.\" Note: distinct from the blank-import pattern above -- blank imports typically produce `call_site_count = 1`, not 0.\n\n---\n\n## Phase 2: Usage Classification\n\nClassify each entry in `import_files` by its role in the project. This is the single most important step -- it determines the **effective difficulty** of removal.\n\n### Classification categories\n\n| Category | Path patterns | Impact |\n|----------|--------------|--------|\n| **Production** | `src\u002F`, `lib\u002F`, `internal\u002F`, `pkg\u002F`, `cmd\u002F`, `app\u002F` (not under test\u002F) | Full migration required |\n| **Test** | `*_test.go`, `test\u002F`, `tests\u002F`, `__tests__\u002F`, `spec\u002F`, `*.test.ts` | Can delete or swap independently |\n| **CI \u002F Infrastructure** | `.github\u002F`, `scripts\u002F`, `ci\u002F`, `Makefile`, `build\u002F` | Often trivially replaceable |\n| **Example \u002F Demo** | `examples\u002F`, `example\u002F`, `demo\u002F`, `sample\u002F` | Can delete or update separately |\n| **Generated** | Files with `\u002F\u002F Code generated` header, `*_gen.go`, `*.pb.go` | Re-run generator with replacement |\n| **Vendored** | `vendor\u002F`, `node_modules\u002F`, `third_party\u002F` | Exclude from analysis -- copies of the dep, not usage |\n\n### Output format\n\n```\nUsage Classification for {name}:\n  Production:     {N} files  [{file list}]\n  Test:           {N} files  [{file list}]\n  CI\u002FInfra:       {N} files  [{file list}]\n  Example:        {N} files  [{file list}]\n  Generated:      {N} files  [{file list}]\n\n  Effective scope: {N} production files (out of {total} total)\n```\n\n### Effective difficulty adjustment\n\n| diet difficulty | All files are test\u002FCI\u002Fexample | Adjusted difficulty |\n|----------------|------------------------------|---------------------|\n| hard | Yes | easy (no production impact) |\n| moderate | Yes | trivial |\n| easy\u002Ftrivial | -- | unchanged |\n\nIf ALL import files are non-production, note: **\"Zero production code impact.\"**\n\nFor `scope: \"runtime\"` dependencies, `import_files` is empty but the dependency runs in production. Classify the files that wire it instead (configuration, connection strings, `META-INF\u002Fservices\u002F*`, `Class.forName` calls) as Production, and never treat an empty list as \"zero production files\" for Production Scope or Effort.\n\n---\n\n## Phase 3: Feasibility Analysis\n\nTwo checks that diet cannot automate: API leakage (a binary gate) and symbol replaceability (requires domain knowledge).\n\n### 3a. API Leakage Check (GATE)\n\n**Critical question**: Do any types from this dependency appear in EXPORTED identifiers?\n\n- If **yes** -- removing it is a **breaking change** for downstream consumers. Flag this immediately. The verdict must account for the breaking change cost.\n- If **no** -- internal swap, no API impact.\n\nLook for the package's types in **exported function signatures** (parameter types, return types), **exported struct field types**, and **exported interface method signatures**. Internal usage within function bodies is NOT API leakage.\n\nCheck approach by ecosystem:\n\n| Ecosystem | What to check |\n|-----------|---------------|\n| Go | Exported func signatures, struct fields, and interface methods that reference the dep's types. Search non-test files for the dep's package name in type positions. |\n| npm\u002FTS | `export ... from '{pkg}'` re-exports, or exported types\u002Finterfaces using the dep's types. |\n| Python | Re-exports in `__init__.py` files: `from {pkg} import ...` that are part of the public API. |\n| Java\u002FMaven | Public class signatures, method parameters, return types, or field types referencing the dep's packages in non-test source sets. |\n\n### 3b. Symbol Migration Map\n\nUsing the `symbols` list from diet, classify each symbol's replaceability. This is where the LLM adds the most value.\n\n```\nSymbol Migration Map for {name}:\n\n| Symbol | Category | Replacement | Notes |\n|--------|----------|-------------|-------|\n| {sym1} | stdlib   | {specific function} | Available since {version} |\n| {sym2} | existing-dep | {dep already in project} | Already in go.mod\u002Fpackage.json |\n| {sym3} | self-impl | {N}-line implementation | Non-crypto, well-defined |\n| {sym4} | no-replacement | -- | Crypto\u002Fprotocol, keep or find alternative lib |\n\nSummary: {N}\u002F{total} stdlib, {N} existing-dep, {N} self-impl, {N} no-replacement.\n```\n\n**Rules for symbol classification**:\n- **stdlib**: Prefer this. Name the specific function (e.g., `os.UserHomeDir()`, `slices.SortFunc()`). Note the minimum language version required.\n- **existing-dep**: A dependency already in the project provides this. No new dependency added.\n- **self-impl**: Only for non-crypto, non-protocol, non-security functionality. Estimate lines of code including tests.\n- **no-replacement**: The symbol has no viable alternative. This blocks removal unless the feature can be dropped.\n\n**Special cases**:\n- If `is_unused: true` and the Data quality search found no use -- skip this step. If the search found use, build the map from the places it found, and treat those files as Production in Phase 2.\n- If `has_blank_import: true` and `call_site_count \u003C= 1` -- the import itself is the usage (driver registration, polyfill). Check what `init()` does; the replacement is typically a different driver package, not a code change. Score Replaceability as High if a drop-in alternative driver\u002Fpolyfill exists, Low if not.\n- If `symbols` is empty but `import_file_count > 0` (without blank\u002Fdot\u002Fwildcard flags) -- diet's coupling analysis may be incomplete. Manually inspect the import files to determine actual API usage before scoring Replaceability. Note the gap in the rationale.\n\n### 3c. Verification Cost\n\nWith a coding agent doing the edits, rewriting call sites is rarely the expensive part of a removal. The expensive part is proving the replacement behaves the same. That cost depends on whether the code that calls the dependency is already under test.\n\nFor each **production** file from Phase 2, check whether a test exercises it (a sibling `*_test.go`, `test_*.py`, `*.test.ts`, `src\u002Ftest\u002F...` class, or a test that imports the file's package\u002Fmodule). Record:\n\n```\nVerification Cost for {name}:\n  Production import files with tests:    {N}  [{file list}]\n  Production import files without tests: {N}  [{file list}]\n  Behavior-sensitive symbols:            {symbols whose replacement may differ at edge cases -- parsing, formatting, time, network addresses, error wrapping, encoding}\n```\n\nExample: three production files call `iplib.NewNet4(...)`, and none has a test. Replacing it with `net\u002Fnetip` takes minutes to type, but `\u002F31` and `\u002F32` prefixes behave differently between the two libraries, so the removal must start by writing tests against the current behavior. That is where the time goes, and Effort below accounts for it.\n\n---\n\n## Phase 4: 6-Axis Quantitative Scoring\n\nRate each axis High\u002FMed\u002FLow using the data gathered in Phases 1-3. Each axis is anchored to concrete data -- no guesswork.\n\n| Axis | Data Source | High (favors removal) | Medium | Low (discourages removal) |\n|------|-----------|------|--------|------|\n| **Transitive Cleanup** | `exclusive_transitive` | >= 10 exclusive deps | 1-9 exclusive | 0 exclusive |\n| **Production Scope** | Phase 2 classification | 0 production files (all test\u002FCI\u002Fexample) | \u003C 50% production files | >= 50% production files |\n| **Coupling Depth** | `coupling_effort`, `import_file_count`, `call_site_count` | `coupling_effort` \u003C 0.25 (trivial\u002Feasy) | 0.25 - 0.6 (moderate) | >= 0.6 (hard, deeply wired) |\n| **Replaceability** | Phase 3b symbol map | > 80% symbols have stdlib\u002Fexisting-dep replacement | 50-80% replaceable | \u003C 50%, or crypto\u002Fprotocol involved |\n| **Security Urgency** | `has_vulnerabilities`, `max_cvss_score`, `lifecycle`, scan `direct_advisory_count` \u002F `reason` \u002F `dormant_release` | Direct advisories on the latest release with CVSS >= 7.0 (no upstream fix), or lifecycle EOL-Confirmed\u002FEOL-Effective, or `dormant_release.kind = \"burst_across_lines\"` (whatever the label) | Direct advisories with CVSS 4.0-6.9, or lifecycle Stalled\u002FEOL-Scheduled\u002FArchived, or `Review Needed` for lack of data, or `dormant_release.kind = \"fresh\"` | No direct advisories on the latest release, or only ones with CVSS below 4.0 (transitive-only counts here), lifecycle Active\u002FLegacy-Safe. A direct advisory with no CVSS score counts as Medium until its severity is looked up |\n| **Cascade Potential** | `exclusive_transitive`, project knowledge | Removing unblocks 3+ further removals | Unblocks 1-2 | Standalone, no cascade |\n\n### Scoring overrides\n\n- **Coupling Depth override**: When Phase 2 shows ALL import files are non-production (test\u002FCI\u002Fexample), override Coupling Depth to **High** regardless of `coupling_effort`. Test\u002FCI refactoring is low-risk regardless of call count.\n- **Transitive Cleanup caveat**: When `stays_as_indirect: true`, `exclusive_transitive` may overestimate actual cleanup -- some \"exclusive\" transitives may remain reachable via the indirect path. Note this uncertainty in the rationale.\n- **Unmeasured coupling**: When Phase 1 found that coupling was not measured, write \"unmeasured\" for Coupling Depth and Production Scope instead of a rating. Do not let a \"trivial\" label from an unmeasured run count as High.\n- **Rate the lifecycle part from scan when diet says `Archived`**: diet overwrites the lifecycle label with `Archived` whenever the repository is archived, even when the registry has declared end of life. Example: an npm-deprecated package with an archived repository is `EOL-Confirmed` in scan but `Archived` in diet. Use scan's `lifecycle` for the rating (EOL-Confirmed \u002F EOL-Effective -> High, Stalled -> Medium).\n- **Highest matching column wins**: if the inputs match both High and Medium (e.g., Stalled with a direct CVSS 8.1 advisory), rate High.\n- **All releases yanked is not a security signal**: it is handled by its own Recommendation row; rate Security Urgency from the other inputs.\n- **Security Urgency is about removal, not upgrade**: If the pinned version has advisories but the latest release is clean, the remedy is an upgrade. Rate Security Urgency from the latest release's **direct** advisories, and mention the upgrade in the rationale. When both direct and transitive advisories exist, `max_cvss_score` may belong to a transitive one; look up the direct advisories' scores on OSV before rating.\n\n### Scoring output\n\n```\n6-Axis Scores:\n  Transitive Cleanup:  {H\u002FM\u002FL} -- {exclusive_transitive} exclusive deps ({reasoning})\n  Production Scope:    {H\u002FM\u002FL} -- {N}\u002F{total} files are production ({reasoning})\n  Coupling Depth:      {H\u002FM\u002FL} -- effort={coupling_effort:.2f}, {call_site_count} calls across {api_breadth} APIs\n  Replaceability:      {H\u002FM\u002FL} -- {N}\u002F{total} symbols replaceable ({reasoning})\n  Security Urgency:    {H\u002FM\u002FL} -- {lifecycle}, {vulnerability_count} vulns, max CVSS {max_cvss_score}\n  Cascade Potential:   {H\u002FM\u002FL} -- {reasoning}\n\nVerification Cost (feeds Effort, not an axis):\n  {N}\u002F{production files} production import files have tests; behavior-sensitive symbols: {list or \"none\"}\n```\n\n---\n\n## Phase 5: Verdict\n\nSynthesize all phases into a structured recommendation. Use the exact field names from diet JSON.\n\n```\n### Verdict: {name}@{version}\n\n**Diet Data**:\n  rank: #{rank}\n  priority_score: {priority_score:.3f}\n  difficulty: {difficulty}\n  ecosystem: {ecosystem}\n\n**Graph**:\n  exclusive_transitive: {exclusive_transitive}\n  total_transitive: {total_transitive}\n  stays_as_indirect: {stays_as_indirect}\n  indirect_via: {indirect_via or \"none\"}\n\n**Coupling**:\n  {import_file_count} files ({N} production, {N} test, {N} other)\n  {call_site_count} calls across {api_breadth} APIs\n  symbols: {symbols count} ({N} stdlib-replaceable, {N} self-impl, {N} no-replacement)\n\n**Health**:\n  lifecycle: {lifecycle} {-- scan reason: {reason} if Review Needed}\n  vulnerabilities on latest release: {vulnerability_count} ({direct_advisory_count} direct, {transitive_advisory_count} via its dependencies; max CVSS {max_cvss_score})\n  vulnerabilities on pinned version: {from OSV, or \"not checked\"}\n  malicious check: {clean \u002F flagged: {advisory_id} \u002F unknown}\n  dormant release: {none \u002F {silent_days} days of silence before this version}\n\n**API Leakage**: {Yes (BREAKING CHANGE) \u002F No}\n**Verification Cost**: {N}\u002F{production files} production import files have tests\n\n**6-Axis Summary**:\n  {axis}: {H\u002FM\u002FL}  (x6, from Phase 4)\n\n**Recommendation**: REMOVE \u002F DEFER \u002F KEEP \u002F UPGRADE \u002F REPLACE \u002F REPLACE VERSION NOW\n**Effort**: Trivial (\u003C1h) \u002F Small (1-4h) \u002F Medium (1-3d) \u002F Large (1w+)\n**Priority**: S (do now) \u002F A (this sprint) \u002F B (when convenient) \u002F C (keep for now)\n**Rationale**: {1-2 sentences -- why this recommendation, citing the key axis scores}\n```\n\n### Recommendation logic\n\nRules are evaluated **top-to-bottom; first match wins.** If multiple rows could match, the earlier row takes priority.\n\n| Condition | Recommendation |\n|-----------|---------------|\n| scan `malicious` present | REPLACE VERSION NOW, Priority S. This is incident response, not a removal decision: move to a version the advisory does not name (or, for `scope: \"package\"`, remove the package), and run `\u002Fdiet-assess-risk` to judge what the malicious code could have reached. Skip the rest of this table |\n| `is_unused: true`, and the search in the Data quality check finds no use | REMOVE, Trivial, Priority S |\n| Pinned version has advisories, the pinned version is older than the latest release, an OSV check of the latest release (with the dependency versions it resolves to in your project) no longer shows them, and lifecycle is Active or Legacy-Safe | UPGRADE, Priority A. Stop here; name in the rationale any axis that would still argue for removal later |\n| scan `reason` starts with `All releases yanked on` | REPLACE, Priority A -- no version resolves any more, so a fresh install or lockfile update can break. This is build continuity, not security: do not use it to justify a breaking change |\n| Coupling Depth or Production Scope is \"unmeasured\" | DEFER -- re-run diet with the correct `--source`, or read the import sites by hand, then evaluate again. Exception: if Security Urgency is High, do not stop here; continue to the rows below, which still apply (API leakage, crypto\u002Fprotocol replacement). Rate Replaceability by reading the import sites, not from the empty `symbols` list, and note the missing coupling data in the rationale |\n| API leakage = Yes AND Security Urgency = High | REMOVE with BREAKING CHANGE warning -- security overrides API stability. Rationale must document the breaking change and recommend a major version bump or deprecation timeline. Escalate to `\u002Fdiet-assess-risk` |\n| API leakage = Yes | DEFER (needs major version bump or deprecation period) |\n| Replaceability = Low (crypto\u002Fprotocol) | KEEP -- find an alternative maintained library rather than self-implementing. If Security Urgency is also High, escalate to `\u002Fdiet-assess-risk` for full risk analysis. Never recommend self-implementing crypto\u002Fprotocol |\n| All 6 axes High or Med | REMOVE |\n| 1-2 axes Low, rest High\u002FMed | REMOVE -- note the Low axes as caveats in rationale |\n| Security Urgency = High, others mixed | REMOVE (prioritize security). Suggest `\u002Fdiet-assess-risk` for full analysis |\n| `stays_as_indirect: true` AND Coupling Depth = High | REMOVE (still valuable: delegates version management, unblocks future cleanup) |\n| >= 3 axes Low | KEEP |\n\n### Effort derivation\n\n| Effort | Criteria |\n|--------|----------|\n| Trivial (\u003C1h) | `is_unused: true`, OR 0 production files, OR all symbols stdlib-replaceable with \u003C= 3 files |\n| Small (1-4h) | \u003C= 5 production files AND > 80% symbols replaceable |\n| Medium (1-3d) | 6-15 production files, OR 50-80% symbols replaceable, OR API leakage requiring deprecation |\n| Large (1w+) | > 15 production files, OR \u003C 50% symbols replaceable, OR crypto\u002Fprotocol replacement needed |\n\nAfter picking a row, **raise Effort one level** when more than half of the production import files have no tests and the used symbols include behavior-sensitive ones (Phase 3c). Those tests must be written before the swap, and they take longer than the swap itself. Do not lower Effort for having an agent do the edits -- the time estimate is for the whole removal including review and verification.\n\n### When to recommend further analysis\n\n- Security Urgency = High --> \"Consider running `\u002Fdiet-assess-risk {name}` for full data-flow analysis.\"\n- Recommendation = REMOVE, Effort >= Medium --> \"Use `\u002Fdiet-remove {name} --pr` for guided implementation.\"\n- Recommendation = REMOVE, external project --> \"Use `\u002Fdiet-remove {name} --repo {owner\u002Frepo}` to file an issue.\"\n\n---\n\n## Important rules\n\n- **Start from diet's output.** Never re-compute fields that diet already provides. But check that coupling was measured (Phase 1) before trusting `difficulty`, and fetch the malicious and dormant-release signals from `uzomuzo scan`, because diet JSON does not carry them.\n- **Know which version a number describes.** Diet's vulnerability fields describe the latest release and include its dependencies' advisories; the version you ship may be better or worse.\n- **Classify before scoring.** Usage classification (Phase 2) changes everything -- always do it before the 6-axis scoring.\n- **API leakage is a gate, not a spectrum.** If exported types depend on this package, flag it immediately.\n- **Be concrete about replacements.** Don't say \"use stdlib\" -- name the specific function, note the version requirement, show the migration pattern.\n- **Respect IBNC patterns.** If `has_blank_import` is true and `call_site_count` is 0, the import IS the usage. Don't call it \"unused.\"\n- **This works for any language.** The `ecosystem` field in diet JSON tells you which language. Use the ecosystem-specific commands in Phase 3a.\n- **One dependency at a time.** This skill is for deep single-dep analysis. For several dependencies, run one evaluation per dependency -- in parallel subagents if your environment has them -- and merge the verdict blocks afterwards. Keep each evaluation independent; a shared context tends to copy one dependency's conclusions onto the next.\n",{"name":5,"description":7,"argument-hint":36},"\u003Cdependency name, e.g. github.com\u002Fpkg\u002Ferrors>","main","fd5444486365ae1d00d222e0d1779c1023d12f72","claude-skills\u002Fdiet-evaluate-removal",7,"https:\u002F\u002Fgithub.com\u002Ffuture-architect\u002Fuzomuzo-oss","https:\u002F\u002Fgithub.com\u002Ffuture-architect","https:\u002F\u002Fwww.future.co.jp\u002F","Future's official open source repositories","2026-11-15 01:28:54",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add future-architect\u002Fuzomuzo-oss --skill diet-evaluate-removal",{"tool":52,"command":53},"bunx","bunx skills add future-architect\u002Fuzomuzo-oss --skill diet-evaluate-removal",{"tool":55,"command":56},"pnpm","pnpm dlx skills add future-architect\u002Fuzomuzo-oss --skill diet-evaluate-removal","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Ffuture-architect\u002Fuzomuzo-oss\u002Fblob\u002Fmain\u002Fclaude-skills\u002Fdiet-evaluate-removal\u002FSKILL.md",true,[],[61,94,112,126,154,174],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":31},"01M6DA7MGD29HB8B7PD74AP302","scan-before-add","Use when selecting, comparing, or recommending third-party libraries, and before adding a new dependency (go.mod, package.json, pyproject.toml, requirements.txt, Cargo.toml, pom.xml, *.csproj, Gemfile, composer.json). Applies both when you choose the candidates and when the user names a package. Runs uzomuzo scan on the candidates and leaves a record of what was checked and who decided.","https:\u002F\u002Fgithub.com\u002Ffuture-architect\u002Fuzomuzo-oss\u002Fblob\u002Fmain\u002Fclaude-skills\u002Fscan-before-add\u002FSKILL.md",[],[68,69,70,71,72,73,74,75,76,77,78,25,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],"scan","scan before add","add","go","libraries","package","xml","json","choose","user","use","record","requirements","toml","third-party","cargo","composer","with","you","pom","gemfile","pyproject.toml","csproj","candidate","when","new",{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":31},"01M6DA7H2JJBKD8535AN2XRDWQ","diet-remove","Remove a dependency identified by uzomuzo diet — analysis + issue (default) or direct PR","https:\u002F\u002Fgithub.com\u002Ffuture-architect\u002Fuzomuzo-oss\u002Fblob\u002Fmain\u002Fclaude-skills\u002Fdiet-remove\u002FSKILL.md",[],[101,102,20,103,104,105,106,25,107,108,109,110,111],"remove","diet remove","pr","analysis","direct","repo","issue","default","module","purl","path",{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":31},"01M6DA7AMHSDTKWJVX07967KGE","diet-assess-risk","Deep-dive security risk analysis for a dependency flagged by uzomuzo diet","https:\u002F\u002Fgithub.com\u002Ffuture-architect\u002Fuzomuzo-oss\u002Fblob\u002Fmain\u002Fclaude-skills\u002Fdiet-assess-risk\u002FSKILL.md",[],[119,120,121,20,122,123,104,25,26,109,110,124,111,125],"risk","diet assess risk","assess","security","risk analysis","top","for",{"skillNo":127,"name":128,"nameZh":6,"description":129,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":130,"categories":131,"keywords":132,"publishedAt":31},"01M6DA77R43KS673EP8B9RMNY5","review-until-clean","1-shot to merge-ready (local-only) — Phase A (5-agent local review iteration) → Phase B (push + self-driven Copilot re-review iteration) → Phase C (reply+resolve all threads). One invocation drives a PR from local agent review through Copilot review convergence to merge-ready state. Runs from your own machine; there is no CI auto-fix.","https:\u002F\u002Fgithub.com\u002Ffuture-architect\u002Fuzomuzo-oss\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Freview-until-clean\u002FSKILL.md",[],[133,134,135,136,137,103,138,139,140,141,142,143,144,145,146,147,148,149,27,150,151,152,153],"review","clean","review until clean","merge","copilot","state","push","ci","copilot review","fix","auto","only","ready","reply","self","local","iteration","machine","re","auto-fix","phase",{"skillNo":155,"name":156,"nameZh":6,"description":157,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":158,"categories":159,"keywords":160,"publishedAt":31},"01M6DA74ZDFXWN62XKMDQ94689","review-diff","Pre-push diff review by the local GitHub Copilot CLI (gpt-5.6-sol, a separate-vendor LLM). Usage: \u002Freview-diff [BASE_REF | --cached] (default base=origin\u002Fmain)","https:\u002F\u002Fgithub.com\u002Ffuture-architect\u002Fuzomuzo-oss\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Freview-diff\u002FSKILL.md",[],[133,161,162,163,22,164,137,165,139,166,167,108,37,168,148,169,170,171,172,173],"diff","review diff","cli","github copilot","copilot cli","gpt","vendor","base","origin","diff review","github copilot cli","usage","sol",{"skillNo":175,"name":176,"nameZh":6,"description":177,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":178,"categories":179,"keywords":180,"publishedAt":31},"01M6DA72JCYB5EE77NWGWJ4JRY","plan-review","Have the local GitHub Copilot CLI (gpt-5.6-sol, a separate-vendor LLM) critique the latest plan-mode plan file before ExitPlanMode — a sanity check. Usage: \u002Fplan-review [\u003Cplan-path>]","https:\u002F\u002Fgithub.com\u002Ffuture-architect\u002Fuzomuzo-oss\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fplan-review\u002FSKILL.md",[],[133,181,182,163,22,164,137,165,166,183,184,185,167,148,186,171,172,187,188,173,189],"plan","plan review","file","critique","check","sanity","latest","mode","plan-mode"]