# remove-unused-dependencies

remove-unused-dependencies audits selected dependencies inside an approved package and lockfile scope, then checks imports, tests, builds, and packaging before removal.

- command · `type=command` · Claude Code, Codex, GitHub Copilot, Gemini CLI · ★ 96 repo stars
- Author: Legion Code Inc.
- License: AGPL-3.0-or-later · policy=link-only · description only; the file stays with the author
- Source: https://github.com/legioncodeinc/vibe-coding-tools/tree/HEAD/plugins/repository-modernization-tools/commands/remove-unused-dependencies.md
- Updated: 2026-10-18
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/commands/remove-unused-dependencies

## What it does

The command reviews manually selected dependency removals across the affected packages and workspaces. It checks package names, aliases, subpaths, CLI entries, dynamic loading, tool configuration, generated entry points, scripts, tests, optional branches, public types, peer dependencies, and consumer-facing contracts. Each item is retained, marked unresolved, or prepared as a removal candidate with file and line evidence.

It records the baseline revision, dirty paths, workspace boundaries, package-manager details, existing checks, and their results before editing. Afterward, it inspects the complete manifest and lockfile diff and repeats import, type, test, build, and package checks under matching conditions. A direct declaration can be removed while a transitive instance remains, so that case is tracked separately.

The command is listed for Claude Code and Codex. In Claude Code, it is installed through `repository-modernization-tools`. Audit approval does not authorize deletion: the package scope and affected files must be approved first, and dynamic or peer usage prevents a behavior-preserving removal.

## Install

### Claude Code (native platform)

1. **Plugin marketplace**
In the agent chat (not a shell):
```text
/plugin marketplace add legioncodeinc/vibe-coding-tools
```
In the agent chat (not a shell):
```text
/plugin install repository-modernization-tools@wasp-nest
```

2. **Manually: put the files in place**
- File: `.claude/commands/remove-unused-dependencies.md` — Call it with /remove-unused-dependencies. For all projects use ~/.claude/commands/

### Codex

**Manually: put the files in place**
- File: `~/.codex/prompts/remove-unused-dependencies.md` — Call it with /prompts:remove-unused-dependencies. Codex marks this format deprecated in favour of skills

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/prompts/remove-unused-dependencies.prompt.md`

### Gemini CLI

**Manually: put the files in place**
- File: `.gemini/commands/remove-unused-dependencies.toml` — Gemini stores commands as TOML: the prompt text goes into the prompt field

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/legioncodeinc/vibe-coding-tools/tree/HEAD/plugins/repository-modernization-tools/commands/remove-unused-dependencies.md

## When to use it
- audit selected dependencies across affected workspaces
- trace dynamic imports and framework registrations
- verify manifest and lockfile changes
- compare baseline and candidate build checks
- record transitive instances that remain

## Example prompts
- Run `/repository-modernization-tools:remove-unused-dependencies` for the approved package scope and inspect every proposed removal.
- Check whether `lodash` can be removed, including aliases, dynamic loading, tests, builds, and public consumers.
- Compare the baseline and candidate results for `package-name`, then report the exact manifest and lockfile diff.

## Similar
- [dependencies-audit](https://affpapa.org/en/nevibecode/skills/dependencies-audit.md) — skill · 1900 installs
- [dependency-management](https://affpapa.org/en/nevibecode/skills/dependency-management.md) — skill · 278 installs
- [adding-dependencies](https://affpapa.org/en/nevibecode/skills/adding-dependencies.md) — skill · 25500 installs
- [om-auto-audit-dependencies](https://affpapa.org/en/nevibecode/skills/om-auto-audit-dependencies.md) — skill · 614 installs
- [dependency-manager](https://affpapa.org/en/nevibecode/agents/voltagent-dependency-manager.md) — subagent · ★ 6505 repo stars
- [audit-dependencies](https://affpapa.org/en/nevibecode/commands/audit-dependencies.md) — command · ★ 1357 repo stars

From the same set: [legioncodeinc/vibe-coding-tools](https://affpapa.org/en/nevibecode/by/legioncodeinc/vibe-coding-tools.md) — 172 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
