A dependency is a third-party package or library that your project relies on to function. When AI generates code that uses Stripe, Prisma, or Tailwind, those are dependencies — external code your project needs. Managing dependencies wisely prevents bloat, security vulnerabilities, and maintenance headaches.
Dependencies are a double-edged sword. They save you from reinventing the wheel but also introduce code you don't control into your project.
A project with 25 direct dependencies might have 500+ transitive dependencies. That's a lot of external code.
| Benefit | Risk |
|---|---|
| Save development time | More code to maintain |
| Battle-tested solutions | Potential security vulnerabilities |
| Community support | Can become abandoned |
| Proven patterns | Version conflicts |
AI sometimes adds unnecessary dependencies. Watch for:
npm audit checks for known vulnerabilitiesAsk: "Is this complex enough to warrant external code?" If you can write it in 20 lines, maybe you don't need a package for it.