agentleFS
derHakenderHaken/SuperAntigravity/skills/dependency-management/SKILL.md

dependency-management

Skill439 starsChanged 8 months agoMITView on GitHub

Use when adding new dependencies, deciding whether to update packages, running security audits on dependencies, evaluating library alternatives, or encountering outdated or vulnerable packages

We split this skill into the rules it gives an agent

18 rules. 0 are common, 17 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 14 edited versions we read keep these.

  • 17

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Every dependency is a commitment -- to its maintenance, security surface, and upgrade path.

    line 10
  2. Distinctive:

    Core principle: Every dependency decision should be justified.

    line 12
  3. Distinctive:

    Before adding any dependency, evaluate against all seven criteria:

    line 65
  4. Distinctive:

    Rule of thumb: If a package fails two or more criteria, find an alternative or write it yourself.

    line 77
  5. Distinctive:

    Update patch versions first, run tests, commit

    line 88
  6. Distinctive:

    Update minor versions one by one, run tests after each

    line 89
  7. Distinctive:

    Never batch major updates together -- isolate each one

    line 91
  8. Distinctive:

    Run the audit tool for your ecosystem (npm audit, pip-audit, cargo audit, bundler-audit)

    line 103
  9. Distinctive:

    Document accepted risks for findings you cannot immediately resolve

    line 106
  10. Very specific:

    Always commit lockfiles (package-lock.json, yarn.lock, poetry.lock, Cargo.lock, etc.)

    line 110
  11. Distinctive:

    Use ranges only for libraries (not applications)

    line 112
  12. Distinctive:

    Never manually edit lockfiles -- use package manager commands

    line 113
  13. Distinctive:

    After resolving lockfile merge conflicts, always run install to regenerate

    line 114
  14. Distinctive:

    Before removing a package:

    line 129
  15. Distinctive:

    Search the codebase for all imports and usages

    line 130
  16. Distinctive:

    Check if other dependencies rely on it transitively

    line 131
  17. Distinctive:

    Remove the import statements and package reference, then run the full test suite

    line 132
  18. Distinctive:

    Verify the lockfile is cleanly regenerated after removal

    line 133

“Common” is measured: kept by at least 6 in 10 of the 14 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 Management

Overview

Every dependency is a commitment -- to its maintenance, security surface, and upgrade path. Add deliberately, update strategically, audit regularly.

Core principle: Every dependency decision should be justified. Don't add what you can write. Don't ignore what you can update. Don't skip what you can audit.

When to Use

  • Adding a new package or library to a project
  • Security audit warnings (npm audit, pip-audit, cargo audit, etc.)
  • Batch dependency update time
  • Major version upgrade decisions
  • Choosing between alternative libraries
  • Lockfile merge conflicts
  • Questioning if a package is still maintained

Don't use when:

  • Internal module/code organization (that's refactoring)
  • Learning a single package's API (that's research)

Decision Tree

digraph dependency_decision {
    "What dependency decision?" [shape=diamond];
    "Add new package" [shape=box];
    "Update existing" [shape=box];
    "Security alert" [shape=box];
    "Remove package" [shape=box];

    "Evaluation Criteria" [shape=box, style=filled, fillcolor=lightyellow];
    "Update Type?" [shape=diamond];
    "Urgency Matrix" [shape=box, style=filled, fillcolor=lightyellow];
    "Usage check, remove" [shape=box];

    "Patch" [shape=box];
    "Minor" [shape=box];
    "Major" [shape=box];

    "What dependency decision?" -> "Add new package";
    "What dependency decision?" -> "Update existing";
    "What dependency decision?" -> "Security alert";
    "What dependency decision?" -> "Remove package";

    "Add new package" -> "Evaluation Criteria";
    "Update existing" -> "Update Type?";
    "Security alert" -> "Urgency Matrix";
    "Remove package" -> "Usage check, remove";

    "Update Type?" -> "Patch" [label="x.x.Z"];
    "Update Type?" -> "Minor" [label="x.Y.0"];
    "Update Type?" -> "Major" [label="X.0.0"];
}

New Package Evaluation

Before adding any dependency, evaluate against all seven criteria:

CriterionQuestionRed Flag
NecessityCan stdlib or existing deps do this?Adding a package for 10 lines of code
MaintenanceLast commit? Issue/PR response time?12+ months inactive, unanswered issues
CommunityWeekly downloads, stars, forks?Very low usage, single maintainer
LicenseCompatible with project license?GPL in commercial project (license contamination)
SizeBundle size? Transitive dependency count?Massive dep tree for a small task
SecurityKnown CVEs? Clean audit?Active security vulnerabilities
AlternativesBetter/lighter alternative available?Picking the first result without evaluating

Rule of thumb: If a package fails two or more criteria, find an alternative or write it yourself.

Update Strategy

Update TypeStrategyRisk
Patch (x.x.Z)Update immediately, run test suiteLow
Minor (x.Y.0)Read changelog, update, testMedium
Major (X.0.0)Breaking change analysis, migration plan, test on separate branchHigh

Workflow for batch updates:

  1. Update patch versions first, run tests, commit
  2. Update minor versions one by one, run tests after each
  3. Tackle major versions individually on feature branches
  4. Never batch major updates together -- isolate each one

Security Urgency Matrix

SeverityExploit exists?ActionTimeframe
CriticalYesUpdate immediately or apply workaroundHours
CriticalNoPriority update1-2 days
High--Update within sprint1 week
Medium/Low--Add to next update cyclePlanned

When a security audit reports vulnerabilities:

  1. Run the audit tool for your ecosystem (npm audit, pip-audit, cargo audit, bundler-audit)
  2. Classify each finding using the matrix above
  3. Address critical/exploitable issues before any other work
  4. Document accepted risks for findings you cannot immediately resolve

Lockfile & Pinning Rules

  • Always commit lockfiles (package-lock.json, yarn.lock, poetry.lock, Cargo.lock, etc.)
  • Pin exact versions for production dependencies where possible
  • Use ranges only for libraries (not applications)
  • Never manually edit lockfiles -- use package manager commands
  • After resolving lockfile merge conflicts, always run install to regenerate

Common Mistakes

MistakeReality
"Popular package is safe"Popularity does not equal security. event-stream was hacked at 2M weekly downloads
"Lockfile commit is unnecessary"Without lockfile, builds are not reproducible
"Update everything at once"Batch updates make it impossible to isolate the source of issues
"Major update is just a version number"Breaking change = potential refactoring
"Dev dependency security doesn't matter"Supply chain attacks target build processes
"Add a package instead of writing 10 lines"Every package adds attack surface and maintenance burden

Removing a Dependency

Before removing a package:

  1. Search the codebase for all imports and usages
  2. Check if other dependencies rely on it transitively
  3. Remove the import statements and package reference, then run the full test suite
  4. Verify the lockfile is cleanly regenerated after removal

Related Skills

  • security-review -- For auditing vulnerable and outdated components (OWASP A06)
  • systematic-debugging -- For diagnosing issues introduced by dependency updates
  • verification-before-completion -- For confirming dependency changes do not break the build

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.