Chuyển đến nội dung
Skillpedia
Lập trình chung48k · #4370

dependency-upgrade

Skill này làm gì

Giúp cập nhật các phiên bản lớn của thư viện phần mềm (phụ thuộc) trong một dự án. Nó kiểm tra xem các phiên bản mới có tương thích với nhau không và đề xuất cách cập nhật an toàn.

Khi nào nên dùng

  • ✓Khi cập nhật một thư viện quan trọng lên phiên bản lớn mới.
  • ✓Khi cần đảm bảo các thư viện trong dự án hoạt động tốt cùng nhau.
  • ✓Khi lên kế hoạch cập nhật bảo mật cho các gói đã cũ.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/dependency-upgrade/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/dependency-upgrade/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Làm thế nào để nâng cấp React từ phiên bản 16 lên 18 một cách an toàn?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

AI phân tích các phụ thuộc của dự án, kiểm tra khả năng tương thích bằng ma trận tương thích, và đề xuất kế hoạch nâng cấp theo từng giai đoạn, kiểm thử ở mỗi bước.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Supporting material availability

This catalog copy contains the inline guidance below, but does not include the following supporting paths. They are external prerequisites, not bundled files:

  • <support-root>/references/semver.md
  • <support-root>/references/compatibility-matrix.md
  • <support-root>/references/staged-upgrades.md
  • <support-root>/references/testing-strategy.md
  • <support-root>/assets/upgrade-checklist.md
  • <support-root>/assets/compatibility-matrix.csv
  • <support-root>/scripts/audit-dependencies.sh

Ask for the original supporting material or an existing installation before using a step that depends on these paths; this catalog does not identify a verified download source for them. Resolve each path relative to that installation, inspect its contents, and verify any applicable license and execution prerequisites. Do not run a command or claim a referenced procedure was followed until its required file exists. Do not fabricate the missing scripts or treat an unrelated file with the same name as equivalent. Independent steps fully documented here can proceed within the user’s authorized scope; report any dependent step as unavailable.

Dependency Upgrade

Master major dependency version upgrades, compatibility analysis, staged upgrade strategies, and comprehensive testing approaches.

Do not use this skill when

  • The task is unrelated to dependency upgrade
  • You need a different domain or tool outside this scope

Instructions

  • Clarify goals, constraints, and required inputs.
  • Apply relevant best practices and validate outcomes.
  • Provide actionable steps and verification.

Use this skill when

  • Upgrading major framework versions
  • Updating security-vulnerable dependencies
  • Modernizing legacy dependencies
  • Resolving dependency conflicts
  • Planning incremental upgrade paths
  • Testing compatibility matrices
  • Automating dependency updates

Semantic Versioning Review

MAJOR.MINOR.PATCH (e.g., 2.3.1)

MAJOR: Breaking changes
MINOR: New features, backward compatible
PATCH: Bug fixes, backward compatible

^2.3.1 = >=2.3.1 <3.0.0 (minor updates)
~2.3.1 = >=2.3.1 <2.4.0 (patch updates)
2.3.1 = exact version

Dependency Analysis

Audit Dependencies

# npm
npm outdated
npm audit
npm audit fix

# yarn
yarn outdated
yarn audit

# Check for major updates
npx npm-check-updates
npx npm-check-updates -u  # Update package.json

Analyze Dependency Tree

# See why a package is installed
npm ls package-name
yarn why package-name

# Find duplicate packages
npm dedupe
yarn dedupe

# Visualize dependencies
npx madge --image graph.png src/

Compatibility Matrix

// compatibility-matrix.js
const compatibilityMatrix = {
  'react': {
    '16.x': {
      'react-dom': '^16.0.0',
      'react-router-dom': '^5.0.0',
      '@testing-library/react': '^11.0.0'
    },
    '17.x': {
      'react-dom': '^17.0.0',
      'react-router-dom': '^5.0.0 || ^6.0.0',
      '@testing-library/react': '^12.0.0'
    },
    '18.x': {
      'react-dom': '^18.0.0',
      'react-router-dom': '^6.0.0',
      '@testing-library/react': '^13.0.0'
    }
  }
};

function checkCompatibility(packages) {
  // Validate package versions against matrix
}

Staged Upgrade Strategy

Phase 1: Planning

# 1. Identify current versions
npm list --depth=0

# 2. Check for breaking changes
# Read CHANGELOG.md and MIGRATION.md

# 3. Create upgrade plan
echo "Upgrade order:
1. TypeScript
2. React
3. React Router
4. Testing libraries
5. Build tools" > UPGRADE_PLAN.md

Phase 2: Incremental Updates

# Don't upgrade everything at once!

# Step 1: Update TypeScript
npm install typescript@latest

# Test
npm run test
npm run build

# Step 2: Update React (one major version at a time)
npm install react@17 react-dom@17

# Test again
npm run test

# Step 3: Continue with other packages
npm install react-router-dom@6

# And so on...

Phase 3: Validation

// tests/compatibility.test.js
describe('Dependency Compatibility', () => {
  it('should have compatible React versions', () => {
    const reactVersion = require('react/package.json').version;
    const reactDomVersion = require('react-dom/package.json').version;

    expect(reactVersion).toBe(reactDomVersion);
  });

  it('should not have peer dependency warnings', () => {
    // Run npm ls and check for warnings
  });
});

Breaking Change Handling

Identifying Breaking Changes

…

Câu hỏi thường gặp

Semantic Versioning (SemVer) là gì?

Đó là quy tắc về cách số phiên bản phần mềm thay đổi: MAJOR.MINOR.PATCH. MAJOR cho biết thay đổi làm hỏng tương thích, MINOR thêm tính năng tương thích ngược, và PATCH sửa lỗi.

Thay đổi phá vỡ tương thích (breaking changes) là gì?

Đó là các thay đổi trong phiên bản mới có thể làm hỏng dự án đang dùng phiên bản trước. Chúng thường xảy ra khi cập nhật phiên bản MAJOR.

Vì sao nên nâng cấp theo từng giai đoạn?

Nâng cấp tất cả cùng lúc có thể rủi ro và khó gỡ lỗi nếu có sự cố. Nâng cấp từng giai đoạn cho phép kiểm thử từng thay đổi riêng lẻ, giúp dễ phát hiện và sửa vấn đề.

Chi tiết

Mô tả gốc của tác giả

Master major dependency version upgrades, compatibility analysis, staged upgrade strategies, and comprehensive testing approaches.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#4370
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự