Do you make your AI reuse existing dependencies instead of installing new ones?

by•

The easiest way I found to stop my workspace from bloating with duplicate tools was adding a strict rule to my instructions: check what's already installed before running npm install.

Before that, every little UI tweak resulted in a brand new package being pulled in, leaving behind a massive mess of dead code and potential security gaps.

If you're building with AI agents daily, how do you keep your node_modules from getting completely out of hand?

14 views

Add a comment

Replies

Best

I write those rules once and share them. There's one global instruction file in git, plus shared docs on coding standards, DB, mail and security that every project links to, so a rule I add today applies everywhere tomorrow. The ones that keep getting broken get promoted to hooks, which block the command before it runs. A rule an agent can forget is a suggestion.

 i like the idea of turning repeated mistakes into hooks. it makes the rules much easier to follow and saves time across projects. having one shared place for instructions is a smart way to keep things consistent.

 Thanks! The rule of thumb I ended up with: if the agent breaks the same rule twice, it gets a hook.