Dependency Management

aj-geddes/useful-ai-prompts/skills/dependency-management

作者 aj-geddes3f5182cfd739無授權條款355 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫7 個月前更新

Manage project dependencies across languages including npm install, package versioning, dependency conflicts, security scanning, and lock files. Use when dealing with dependencies, version pinning, semantic versioning, or resolving conflicts.

AI 產生的概覽

指導跨生態系統的相依性管理:安裝、版本控制、鎖定檔、衝突解決與安全稽核。

功能
此技能為 JavaScript/Node.js、Python、Ruby、Java 等生態系統的專案相依性管理提供指引與參考資料。內容涵蓋安裝與更新套件、語意化版本、鎖定檔、版本衝突解決、同儕相依性、單體儲存庫相依性、效能最佳化、CI/CD 實務以及安全弱點稽核。它另外附帶一個測試鷹架指令碼與一個測試範本,並在 references 目錄中提供十份參考指南。
適用情境
適用於安裝或更新相依性、解決版本衝突、稽核安全弱點、管理鎖定檔、套用語意化版本,或建立單體儲存庫與同儕相依性結構時。也適用於最佳化相依性樹或制定相依性更新策略。
執行需求
需要在可存取此技能參考檔案的代理環境中執行。隨附的 scripts/scaffold-tests.sh 與 templates/test-template.js 需要 shell 環境;文中描述的 npm 等套件管理員指令並未隨技能提供。

Dependency Management

Table of Contents

Overview

Comprehensive dependency management across JavaScript/Node.js, Python, Ruby, Java, and other ecosystems. Covers version control, conflict resolution, security auditing, and best practices for maintaining healthy dependencies.

When to Use

  • Installing or updating project dependencies
  • Resolving version conflicts
  • Auditing security vulnerabilities
  • Managing lock files (package-lock.json, Gemfile.lock, etc.)
  • Implementing semantic versioning
  • Setting up monorepo dependencies
  • Optimizing dependency trees
  • Managing peer dependencies

Quick Start

Minimal working example:

bash
# Initialize projectnpm init -y
# Install dependenciesnpm install expressnpm install --save-dev jestnpm install --save-exact lodash  # Exact version
# Update dependenciesnpm updatenpm outdated  # Check for outdated packages
# Audit securitynpm auditnpm audit fix
# Clean install from lock filenpm ci  # Use in CI/CD
# View dependency treenpm listnpm list --depth=0  # Top-level only

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
Package Manager Basics [blocked]Package Manager Basics
Semantic Versioning (SemVer) [blocked]Semantic Versioning (SemVer)
Dependency Lock Files [blocked]Dependency Lock Files
Resolving Dependency Conflicts [blocked]Resolving Dependency Conflicts
Security Vulnerability Management [blocked]Security Vulnerability Management
Monorepo Dependency Management [blocked]Monorepo Dependency Management
Peer Dependencies [blocked]Peer Dependencies
Performance Optimization [blocked]Performance Optimization
CI/CD Best Practices [blocked]CI/CD Best Practices
Dependency Update Strategies [blocked]Dependency Update Strategies

Best Practices

✅ DO

  • Commit lock files to version control
  • Use npm ci or equivalent in CI/CD pipelines
  • Regular dependency audits (weekly/monthly)
  • Keep dependencies up-to-date (automate with Dependabot)
  • Use exact versions for critical dependencies
  • Document why specific versions are pinned
  • Test after updating dependencies
  • Use semantic versioning correctly
  • Minimize dependency count
  • Review dependency licenses

❌ DON'T

  • Manually edit lock files
  • Mix package managers (npm + yarn in same project)
  • Use npm install in CI/CD (use npm ci)
  • Ignore security vulnerabilities
  • Use wildcards (*) for versions
  • Install packages globally when local install is possible
  • Commit node_modules to git
  • Use latest tag in production
  • Blindly run npm audit fix
  • Install unnecessary dependencies

來源與署名

來源:aj-geddes/useful-ai-prompts位於skills/dependency-management提交3f5182c

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架