Read the package.json Your AI Builder Wrote Before It Ships
Disclosure: I work on VibUI, a paid library of website prompts. It's linked once, at the very end.
The preview looked great, so you ran npm install locally and went to make coffee. When you came back it was still going. node_modules is now roughly the size of a small film, and package.json contains three packages you've never heard of, two icon libraries and an animation library for a page that has one fade-in.
Nobody chose any of that. A tool reaching for whatever solved the immediate prompt, then solved the next one with something else, and never went back to tidy up. It's not malicious. It's also your problem the moment the page goes live under your name.
Here's the ten-minute read-through I'd do before merging anything generated.
1. List what's actually there
npm ls --depth=0 # direct dependencies only
cat package.json | less # skim dependencies vs devDependencies
Read the names out loud. Anything you can't explain in a sentence goes on a list.
2. Find what nothing uses
npx depcheck
depcheck reports packages that are installed but never imported. Generated projects collect these when the tool tries one approach, switches, and leaves the first one behind. It's not perfect (it can miss config-only usage), so treat the output as a list of suspects, not a verdict.
3. Look for doubles
| What you find | Why it's a problem | What to ask for |
|---|---|---|
| Two icon sets | Both ship to the browser | "Use one icon library, replace the rest" |
| Two animation libraries | Heavy and they fight each other | "CSS transitions only, remove both" |
| A date library for one date | Large for what it does | "Use Intl.DateTimeFormat" |
| A CSS-in-JS runtime next to Tailwind or plain CSS | Two styling systems | "Pick one, convert the other" |
| An HTTP client plus fetch calls | Duplicate paths | "Use fetch everywhere" |
4. Run the boring checks
npm audit # known issues in the tree
npm outdated # what's behind
du -sh node_modules # a rough sense of weight
npm audit output can be noisy, so look at what's reachable in production, not only the count. And check the licences if the project is for a client:
npx license-checker --summary
5. Check where the secrets are
While you're in the files, search for keys:
rg -n "(api[_-]?key|secret|token)" --glob '!node_modules' --glob '!package-lock.json'
Anything in client-side code is public. If a key was ever pasted into a chat to "make the API work", treat it as exposed and rotate it.
The prompt rule that prevents most of this
Dependencies: add no new packages unless I approve them. Prefer built-in browser features (CSS, <dialog>, <details>, fetch, Intl) over libraries. If a package is truly needed, name it, say what it replaces, and give its approximate size. Never put API keys in client code. At the end of every reply, list the packages you added.
That last line is the one that matters. It makes the tool confess, which turns a mystery into a diff.
Same rule, any tool: v0, Lovable, Bolt, Cursor, Windsurf, Claude, ChatGPT, Gemini, Replit, GitHub Copilot, Framer AI, Google Stitch, Readdy, Aura.build, OpenAI Codex. The editors that can see your repo tend to follow it best, and the chat tools need the dependency list pasted in so they know what already exists.
Where a prompt library fits, honestly
A lot of dependency creep starts with a section that needs "a bit of animation" or "a nice carousel." Starting from a section that already does it in plain CSS means less to remove later. That's the pitch.
If you want to test that claim: VibUI is the library I work on: 2,852 website prompt templates (775 pages, 1,100 sections, 817 components, 160 animated backgrounds), about 1,000 of them with source code. It's one-time pricing with no auto-renewal: $48 quarterly, $99 yearly, $179 lifetime (listed down from $384). Yearly and lifetime also include 2,407 AI video prompts. There are 60 free samples, and a free account can copy 2 prompts. Open a free sample with source code, run it through the steps above, and see how many packages it asked for.
Comments
No comments yet. Start the discussion.