Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

diet-remove

БесплатноБез исполняемых скриптовНе проверен

Remove a dependency identified by uzomuzo diet — analysis + issue (default) or direct PR

future-architectот future-architect★ 46 звёзд на GitHub

Об этом скилле

Diet Remove: $ARGUMENTS

Analyze and plan the removal of dependency $ARGUMENTS, then take action.

Mode selection

  • Default (Issue mode): Run Phase 1 analysis, then file a GitHub Issue with the findings and proposed migration plan. Appropriate for external OSS contributions and large projects where you don't own the build environment.
  • --pr (PR mode): Run the full removal lifecycle locally: analysis → replacement → verification → commit. Use this only when you own the project and can run build/test locally.

Parse $ARGUMENTS for flags, and set TARGET to the dependency itself: drop the flags and their values, and turn a PURL into the name the package manager uses (pkg:golang/github.com/pkg/[email protected] -> github.com/pkg/errors, pkg:npm/%40scope/[email protected] -> @scope/name). Every command below uses $TARGET, never the raw $ARGUMENTS.

Flags:

  • If --pr is present → PR mode (direct implementation)
  • If --repo owner/repo is present → target that repository for the issue
  • Otherwise → Issue mode (default)

When to use: After /diet-evaluate-removal confirms the dependency is worth removing, or when uzomuzo diet reports it unused or easy (a "trivial" label is only meaningful if coupling was measured -- when every dependency shows trivial and none is unused, re-run diet with the right --source).

Safety principle: Every removal must pass build + vet + test before committing. If any step fails, stop and diagnose — don't force it.

Ecosystem detection

Detect the ecosystem from the PURL scheme or module path (pkg:golang/ → Go, pkg:npm/ → npm, pkg:pypi/ → Python, pkg:maven/ → Maven, pkg:cargo/ → Rust, pkg:githubactions/ → GitHub Actions). Diet measures source coupling for Go, Python, JavaScript/TypeScript, and Java only; for other ecosystems, find the import sites yourself before trusting a "trivial" or "unused" label.

If the ecosystem is not Go, display this notice to the user before proceeding:

Note: This skill's PR-mode commands and common patterns are optimized for Go. Issue mode and IBNC safety checks work for any language, but ecosystem-specific PR-mode guidance (verification commands, edge cases, lockfile handling) is still being developed for {ecosystem}. If you discover surprises or improvements during this removal, please contribute them via an issue or PR to future-architect/uzomuzo-oss.

Then continue with the rest of the flow — the analysis, IBNC checks, and issue template are language-agnostic.

GitHub Actions detection

If the target PURL starts with pkg:githubactions/ or is a GitHub Action name (owner/action):

  1. Find usage: grep -rn "{action-name}" .github/workflows/ --include="*.yml" --include="*.yaml"
  2. Assess impact: Count workflow files and jobs affected. Note whether release-critical pipelines are involved.
  3. Find replacement: Check if an official replacement, maintained fork, or first-party alternative exists (e.g., tibdex/github-app-token → actions/create-github-app-token).
  4. Pin strategy: Replacement should use SHA pins with version comments (e.g., uses: actions/checkout@<sha> # v4.2.0).

The rest of the flow (duplicate check, issue template, etc.) proceeds identically. In the Usage breakdown table, list workflow files instead of source files.

Phase 1: Pre-flight checks

Before writing any code, run through these checks:

0. Is this an incident rather than a cleanup?

Run uzomuzo scan on the exact version in the SBOM. Diet JSON does not carry these signals:

uzomuzo scan "pkg:npm/[email protected]" --format json \
  | jq '.packages[0] | {lifecycle, reason, stable_version, malicious, malicious_check, dormant_release,
                       direct_advisory_count, transitive_advisory_count, max_cvss3_score, max_cvss4_score}'
  • malicious present: Stop this flow. Moving off the malicious version comes before any removal plan, and it must not wait for an issue to be triaged. Report the advisory to the user and propose the fix: pin to a version the advisory does not name (or remove the package when scope is "package"), and run /diet-assess-risk to list the secrets to rotate (skip that if it already produced the incident verdict). Make the change only in PR mode and only after the user approves it; rotating credentials is the user's action, not yours. For an external project, do not open a public issue that describes an exploitable situation in detail; draft a private report for the maintainers' security contact (SECURITY.md) and send nothing until the user approves it.
  • dormant_release present (npm, shown for 7 days after publication): The version came out after a year of silence. Prefer staying on, or pinning back to, the release before the silence while you plan the removal.
  • Otherwise continue. (For ecosystems other than npm, PyPI, crates.io, Go, and Maven, uzomuzo does not run the malicious ch
Полный SKILL.md на GitHub

Установить diet-remove в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл diet-remove?

Remove a dependency identified by uzomuzo diet — analysis + issue (default) or direct PR

Как установить скилл diet-remove?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл diet-remove запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить diet-remove с