{"success":true,"name":"own-your-dependencies-lock-versions-audit-what-you-import-up","description":"Adding npm packages freely or updating them randomly when something breaks","category":"ai-brimind","path":"ai-brimind/own-your-dependencies-lock-versions-audit-what-you-import-up/SKILL.md","file":"SKILL.md","content":"---\nname: own-your-dependencies-lock-versions-audit-what-you-import-up\ndescription: \"Adding npm packages freely or updating them randomly when something breaks\"\n---\n\n# Own Your Dependencies: Lock Versions, Audit What You Import, Update on Purpose\n\n## When to use\nThe project pulls in third-party packages (npm or similar), and dependencies are added on impulse, updated only when something forces it, or installed without a glance at what they are — with no routine for locks, audits, or deliberate upgrades.\n\n## Example request\nThe app builds fine on your machine but breaks on deploy → the lockfile was not committed, so the server resolved newer sub-dependencies than you tested with; the lockfile IS the guarantee that everyone installs the same world. A tiny helper package with 3 downloads a week gets installed for one function → it drags 40 sub-dependencies and one day ships malware or dies unmaintained; five minutes checking downloads, last publish, and size is the vetting a stranger's code deserves. 'npm audit' has screamed 14 vulnerabilities for months → nobody triages which are real for YOUR usage; ignoring the tool entirely and panicking at every warning are both wrong — triage is the skill. Everything upgraded at once the day something breaks → ten versions jump together and the culprit is unfindable; updates in small, deliberate batches keep every change attributable.\n\n## Instructions\nAct as the engineer who remembers that every package you install is thousands of lines of a stranger's code running with full trust inside your app — importing it is a hiring decision, and hiring without an interview, a contract, or performance reviews is how supply-chain incidents and unbuildable projects happen. For dependency work, do this: (1) Before adding ANY package, interview it for five minutes: does the platform already do this natively (your reuse discipline applies — fetch, Intl, crypto and friends have eaten many old packages)? If not: weekly downloads, last publish date, open issues, size and sub-dependency count. A huge tree for a one-line function fails the interview — copy the one function's logic yourself or pick the lighter alternative, and say which you chose and why. (2) Treat the lockfile as sacred: committed always, never deleted-and-regenerated as a 'fix' (that silently upgrades your entire world in one blind step), so that dev, CI, and production install byte-identical trees — 'works on my machine' bugs are very often lockfile hygiene bugs. (3) Make updates a small, scheduled, deliberate act instead of an emergency: routinely check what is outdated, read the changelog for anything major (semver majors mean declared breaking changes — the version number is the author talking to you), upgrade in small batches, run the app, commit with the reason. Ten packages jumped in one desperate commit is ten suspects with one alibi. (4) Run the vulnerability audit regularly and TRIAGE like an adult: identify whether the vulnerable path is one your app actually exercises, fix the real ones promptly, and record why the noise is noise — a permanently red audit teaches the team to ignore the one day it matters. (5) Once a year or at big milestones, prune: packages no longer imported anywhere still cost install time, attack surface, and reader confusion — deleting a dependency is one of the few free wins in software. Only consider dependency handling healthy when you can answer: 'why is each of these here, what guarantees we all run the same versions, and when did we last consciously update?' — if the answers are 'history', 'hopefully', and 'never', the project's foundation is quietly rotting under the features.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #228\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}