agentleFS
hereshecodeshereshecodes/secureskills/skills/dependency-security/SKILL.md

dependency-security

Skill0 starsChanged 8 months agoMITView on GitHub

Use when adding packages, updating dependencies, or reviewing lock files

  • Installs packages

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every package you install is code you didn't write running in your application.

    line 8
  2. Distinctive:

    Check download count, maintenance status, and known vulnerabilities before adding a dependency.

    line 14
  3. Distinctive:

    Don't wait for a breach to find out your dependencies are vulnerable.

    line 56
  4. Distinctive:

    Every dependency is attack surface.

    line 92

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Dependency Security

Every package you install is code you didn't write running in your application. Audit before you add. Update regularly.

Related: secrets-management, security-context

Rule 1: Audit Before You Install

Check download count, maintenance status, and known vulnerabilities before adding a dependency.

# WRONG — install without checking
npm install random-helper-lib

# RIGHT — check first
# 1. Does it have recent commits? (Abandoned packages don't get security patches)
# 2. Does it have known vulnerabilities? (npm audit, snyk, socket.dev)
# 3. Is the download count reasonable? (Very low = untested. Very high = high-value target)
# 4. Does it need to be a dependency? (Can you write 10 lines instead?)
npm info random-helper-lib
npm audit
npm install random-helper-lib

Rule 2: Pin Major Versions

Prevent unexpected breaking changes and supply chain attacks via compromised minor/patch releases.

// WRONG — accepts any compatible version (risky)
"dependencies": {
  "express": "^4.18.0"
}

// RIGHT — pin to specific version
"dependencies": {
  "express": "4.18.2"
}
# WRONG — unpinned
requests

# RIGHT — pinned
requests==2.31.0

Rule 3: Run Vulnerability Scans Regularly

Don't wait for a breach to find out your dependencies are vulnerable.

# JavaScript
npm audit
npx snyk test

# Python
pip-audit
safety check

# .NET
dotnet list package --vulnerable

# Ruby
bundle audit check

# Go
govulncheck ./...

Rule 4: Keep Lock Files Committed

Lock files ensure everyone uses the exact same dependency versions. Never .gitignore them.

# WRONG — ignoring lock files
package-lock.json
yarn.lock

# RIGHT — lock files MUST be committed
# (Don't add them to .gitignore)

Rule 5: Remove Unused Dependencies

Every dependency is attack surface. If you're not using it, remove it.

# Find unused packages
npx depcheck

# Python
pip-extra-reqs --requirements-file requirements.txt .

# Then remove them
npm uninstall unused-package

Rule 6: Watch for Typosquatting

Attackers publish malicious packages with names similar to popular ones.

# WRONG — typo installs malicious package
npm install expres      # missing 's'
npm install lodahs      # transposed letters
pip install reqeusts    # typo

# RIGHT — double-check the package name
npm install express     # correct
pip install requests    # correct

Quick Reference

DoDon't
Audit packages before installingBlindly install dependencies
Pin major versions in productionUse ^ or ~ ranges for critical deps
Run npm audit / pip-audit regularlyWait for incidents to check vulnerabilities
Commit lock filesGitignore package-lock.json or yarn.lock
Remove unused dependenciesKeep packages "just in case"
Verify package names carefullyRush through install commands
Prefer well-maintained packagesUse abandoned or unmaintained libraries

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.