Dead code Required
Remove unused dependencies
Uninstall packages that no code imports. Each one adds install time, attack surface and update work.
How to do it
Run a dependency checker in the build. Remove what it reports from the manifest and the lock file.
Example
$ npx depcheck
Unused dependencies
* left-pad
* moment
How to check
A tool such as depcheck, knip, composer-unused or deptry fails the build on an unused package.
For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers architecture playbook: https://agentwranglers.se/playbook/architecture/dead-code/remove-unused-dependencies.