npm-deps-cleanup

Audit and reduce JavaScript dependency footprint across npm, pnpm, Yarn, and Bun projects.

1|Updated Aug 11, 2026
One-click install
npx skills add https://github.com/Chia1104/agent-air --skill npm-deps-cleanup-chia1104
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: npm-deps-cleanup
Source: https://github.com/Chia1104/agent-air/tree/main/skills/shared/npm-deps-cleanup
Command: npx skills add https://github.com/Chia1104/agent-air --skill npm-deps-cleanup-chia1104

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? JavaScript projects accumulate unused, duplicated, and bloated dependencies over time, inflating lockfiles and node_modules. This Skill provides a measured, safe workflow to shrink dependency trees without breaking builds or changing package managers. ## Core Features & Use Cases - Unused Dependency Removal: Verify candidates from static analyzers like knip or depcheck against imports, configs, scripts, and plugin loaders before removing. - Monorepo Deduplication: Standardize mismatched direct dependency versions across workspace manifests using syncpack or native dedupe commands. - Transitive Closure Analysis: Rank direct dependencies by their lockfile closure to find low-risk upgrades, trivial packages worth inlining, and e18e replacement candidates. - Use Case: A pnpm monorepo has a 12,000-line lockfile. Use this Skill to remove unused packages, dedupe mismatched versions, and measure the exact lockfile and node_modules reduction. ## Quick Start Audit this repository's dependencies and remove unused packages while preserving the existing package manager and lockfile.

Frequently Asked Questions about npm-deps-cleanup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I remove unused npm dependencies safely?▼

Start with a static analyzer like knip or depcheck as a candidate list, not proof. Verify each candidate against imports, config files, package scripts, plugin loaders, and dynamic requires before removing, then reinstall and run focused verification.

How to deduplicate dependency versions in a monorepo?▼

Use syncpack list-mismatches to find the same dependency declared with different versions across workspace manifests. Standardize ranges at the manifest level first, then consider native dedupe commands like npm dedupe or pnpm dedupe while inspecting lockfile diffs.

Does this work with pnpm, Yarn, and Bun projects?▼

Yes, the workflow detects the package manager from the packageManager field, devEngines metadata, or lockfile inference, then uses the matching command family. It supports npm, pnpm, Yarn, and Bun without switching managers.

What is the e18e dependency replacement guidance?▼

e18e is a community effort to modernize and shrink the JavaScript dependency ecosystem. Run @e18e/cli analyze or migrate --dry-run through your package manager's executor, and check e18e.dev/docs/replacements for known lighter alternatives.

When should I not remove or inline a dependency?▼

Avoid removing or inlining dependencies handling security, parsing, crypto, Unicode, URL handling, date/time, i18n, or platform compatibility unless the replacement is proven equivalent. Treat peerDependencies, optionalDependencies, and bin usage as higher risk.