Skill: dependency audit before merge
Audit new dependencies for license, size, and maintenance signals before they enter the lockfile.
What to do first

Alt First
- Search the repo for an existing helper before adding a package.
- Record the license; treat unknown licenses as a merge blocker.
- End with a short go / replace / reject note in the PR: not a legal opinion essay.
Agents love solving a 20-line problem with a 2 MB framework. By the time CI is green, you have a new license, a native addon, and a maintainer who last published three years ago. Unwinding that from the lockfile is harder than writing the helper.
This skill forces an audit note before merge: alternatives in-repo, license, maintenance signals, install/bundle cost, then a clear verdict. Use it on every PR that adds or upgrades a sensitive dependency.
Part 1: Alternatives before npm install
Proposed dependency: [name + why]
Diff / lockfile change: [paste or path]
Do not recommend install yet.
1. Search the repo for existing utilities that already solve this.
2. If an alternative exists, quote the path and stop with REJECT (use existing).
3. If not, list the smallest candidate packages (max 3) including "vendor a 30-line helper".
Part 2: License, maintenance, cost gate
Audit candidate: [package]
Produce a short audit note with:
- License (exact SPDX). Unknown → BLOCK.
- Maintenance: last release, open critical issues (mark unverified if you cannot check).
- Cost: approximate install/bundle impact, native deps, supply-chain surface.
- Verdict: ACCEPT / REPLACE (with what) / REJECT, with one-line reason.
Rules: do not invent download counts; mark unverified stats.
Part 3: Package addiction board

Addiction Traps
Read the board. Each card is a stop rule the skill must encode.
Save it as a skill file
# Skill: deps-audit
## When
- PR adds/upgrades dependencies, or user asks "can we add X?"
## Hard rules
1. In-repo alternatives first.
2. License known or BLOCK.
3. No invented popularity stats.
4. Prefer minimal deps; vendor tiny helpers when cheaper.
## Steps

*Audit Gate*
1. List package + why; search repo alternatives.
2. License, maintenance, size/supply-chain.
3. Verdict ACCEPT / REPLACE / REJECT into PR template.
## Done when
- Audit note complete with license + verdict.
Test before you trust it
- Duplicate utility in repo. Pass: REJECT new dep, cite path.
- Unknown license. Pass: BLOCK.
- Tiny MIT package, clear need, no alternative. Pass: ACCEPT with note.
Pair with CSV cleanup plan when vendors ship data files beside packages. Broader skill writing: write Cursor skills.
Common mistakes
- Auditing only the top-level package. Transitive GPL still ships.
- Accepting “types package” without checking the runtime dep it pulls.
- Skipping upgrades of sensitive packages (crypto, auth, parsers): upgrades need the same note.
You are done when the PR description has license, alternative considered, and a verdict a reviewer can disagree with in one glance.
Share