Command Palette

Search for a command to run...

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

npm-deps-cleanup

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

Audit and reduce JavaScript package dependency footprint across npm, pnpm, Yarn, and Bun projects. Use when asked to remove unused dependencies, deduplicate…

anthonyshewот anthonyshew★ 38 звёзд на GitHub

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

npm Dependency Cleanup

Reduce JavaScript dependency footprint. Preserve the existing package manager, lockfile, workspace layout, and dependency range style unless there is a concrete reason to change them.

Workflow

  1. Establish the baseline.
  2. Remove unused direct dependencies.
  3. Deduplicate direct dependency versions in monorepos.
  4. Rank direct dependencies by transitive lockfile closure.
  5. Use closure data to find low-risk minor/patch upgrades.
  6. Use closure data to find trivial dependencies worth inlining.
  7. Check e18e recommendations for replacements/removals.
  8. Reinstall, verify, and report measured impact.

Package Manager Detection

Use the repo's existing package manager. Prefer explicit package metadata before lockfiles:

  1. packageManager in the root package.json.
  2. devEngines.packageManager.name in the root package.json.
  3. Lockfile inference.

When devEngines.packageManager is present, use its name for npm, pnpm, Yarn, or Bun detection. Treat its version and onFail fields as policy signals, not as permission to change package managers.

Infer from lockfiles only when package metadata does not identify the package manager:

Signal Package manager
package-lock.json or npm-shrinkwrap.json npm
pnpm-lock.yaml pnpm
yarn.lock Yarn
bun.lock or bun.lockb Bun

Use the matching command family:

Action npm pnpm Yarn Bun
Install/update lockfile npm install pnpm install yarn install bun install
Remove direct dependency npm uninstall <pkg> pnpm remove <pkg> yarn remove <pkg> bun remove <pkg>
Add/update direct dependency npm install <pkg>@<version> pnpm add <pkg>@<version> yarn add <pkg>@<version> bun add <pkg>@<version>
Explain dependency npm explain <pkg> pnpm why <pkg> yarn why <pkg> bun pm why <pkg> if available
Dedupe lockfile npm dedupe pnpm dedupe yarn dedupe if available reinstall and inspect
One-off tools npx <tool> pnpm dlx <tool> yarn dlx <tool> if available bunx <tool>

Safety Rules

  • Work in small batches so lockfile diffs remain reviewable.
  • Never trust unused-dependency tools blindly; verify imports, config files, scripts, generated code hooks, framework conventions, plugin names, CLIs, and dynamic imports.
  • You may write scripting and parsing to verify package.json and lockfile dependency accounts.
  • Treat peerDependencies, optionalDependencies, package bin usage, test fixtures, and published package manifests as higher risk.
  • Do not remove or inline dependencies used for security, parsing, crypto, Unicode, URL handling, date/time, i18n, or platform compatibility unless the replacement is proven equivalent.
  • Do not change package managers, delete lockfiles, or rewrite workspace structure as part of cleanup.
  • Treat package manager dedupe commands as potentially behavior-changing. They can alter selected transitive versions within allowed ranges, so inspect lockfile diffs and run focused verification before keeping the result.
  • Measure before and after: direct dependency count, lockfile line count or entry count, package count, and estimated node_modules size when available.

Step 1: Baseline

Collect:

  • All package.json files and workspace boundaries.
  • Current package manager and lockfile.
  • Direct dependency names by manifest section: dependencies, devDependencies, peerDependencies, optionalDependencies.
  • Existing verification commands from scripts, CI, or repo docs.

Record baseline metrics before edits:

git status --short
wc -l <lockfile>

If node_modules is installed, also estimate installed footprint with platform-appropriate filesystem tools. Do not make footprint cleanup depend on node_modules being present; lockfile reductions are the primary metric.

Step 2: Remove Unused Direct Dependencies

Use a static analyzer as a starting point, not as proof. Good candidates include knip, depcheck, or repo-native tooling if already configured. Run them through the detected package manager's one-off executor when they are not installed.

For each candidate:

1

Полный SKILL.md на GitHub

Установить npm-deps-cleanup в Claude Code и Claude Desktop

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

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

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

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

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

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

FAQ

Что делает скилл npm-deps-cleanup?

Audit and reduce JavaScript package dependency footprint across npm, pnpm, Yarn, and Bun projects. Use when asked to remove unused dependencies, deduplicate workspace dependency versions, lockfiles or node_modules, analyze direct dependencies' transitive lockfile closure, find low-risk upgrades that reduce dependency trees, inline trivial dependencies, or apply e18e dependency replacement recommendations.

Как установить скилл npm-deps-cleanup?

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

Скилл npm-deps-cleanup запускает скрипты?

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

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

Сравнить npm-deps-cleanup с