dependency-update
Process for safely adding or updating npm dependencies
SKILL.md.hive/prompts/skills/dependency-update/SKILL.md
GitHubAdding a new dependency
- Check bundle impact — justify packages >50 KB
- Verify licence: must be MIT, Apache-2.0, BSD-2-Clause, or BSD-3-Clause
- Check maintainer activity: last publish within 12 months, >1 maintainer for critical packages
- Pin to exact version for CLI tools; use
^for library dependencies - Add to
package.jsonin the correct section (dependenciesvsdevDependencies) - Run
npm installand commit the updated lockfile
Updating an existing dependency
- Read the changelog between current and target version — note any breaking changes
- Run the full test suite after the update:
npm test - Run
npm auditand resolve any new advisories before committing - Update in a separate commit from feature work:
chore(deps): bump express from 4.18 to 4.19
Never do
- Do not use
npm install --legacy-peer-depswithout a comment explaining why - Do not add a dependency to solve a problem that already has a solution in the codebase
- Do not add polyfills for browser APIs if target environments already support them