Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)39k · #7485

pro-upgrade

Skill này làm gì

Skill này hướng dẫn việc nâng cấp một dự án Ant Design Pro. Skill dành cho các nhóm đã xây trên template Pro và muốn chuyển sang phiên bản mới hơn mà không mất công việc riêng.

Khi nào nên dùng

  • ✓Khi bạn muốn nâng cấp dự án Ant Design Pro lên phiên bản mới nhất.
  • ✓Khi dự án Pro của bạn đã tụt lại sau template chính thức và cần bắt kịp.
  • ✓Khi bạn muốn giữ dự án được cập nhật trong khi vẫn bảo toàn mã tùy chỉnh.

Liên kết skill

https://github.com/ant-design/ant-design-pro/blob/master/.claude/skills/pro-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/ant-design/ant-design-pro/blob/master/.claude/skills/pro-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

“Nâng cấp dự án Ant Design Pro của chúng tôi lên phiên bản template mới nhất, và giữ tất cả các trang và cài đặt riêng của chúng tôi.”

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

Cách hoạt động

Agent trước hết kiểm tra các thay đổi của bạn đã được commit chưa, rồi tải template chính thức mới nhất. Nó phân loại các tệp thành tệp do template sở hữu và tệp nghiệp vụ của bạn, so sánh chúng, rồi gộp các thay đổi template trong khi giữ công việc của bạn.

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.

Ant Design Pro Upgrade Skill

You are an Ant Design Pro upgrade assistant. Your task is to help users upgrade their Pro-based project to the latest version by comparing it against the official template and intelligently merging changes.

Preflight

Before starting, confirm:

  1. The user has committed or stashed all changes (git status should be clean or they confirm it's OK to proceed).
  2. If not clean, remind them to commit or stash their changes first (e.g., "Please commit or stash your changes — the upgrade process will modify multiple files.") and wait for them to confirm.

Upgrade Flow

Step 1 — Fetch the latest template

rm -rf /tmp/ant-design-pro-upgrade
git clone --depth=1 https://github.com/ant-design/ant-design-pro.git /tmp/ant-design-pro-upgrade

Read the template's package.json to confirm its version.

Step 2 — Classify files

Separate the user's project files into framework files (Pro-owned, rarely customized) and business files (user-written, must be preserved).

Framework files — diff these against the template:

Path Notes
package.json dependencies, scripts, devDependencies only
config/config.ts framework config
config/routes.ts structure only — preserve user-added routes
config/defaultSettings.ts layout/theme defaults
config/proxy.ts structure only — preserve user targets
src/app.tsx runtime config
src/access.ts permission definitions
src/global.tsx global side effects
src/loading.tsx loading component
src/requestErrorConfig.ts request interceptor
src/typings.d.ts global type declarations
tsconfig.json TypeScript config
biome.json or biome.jsonc linter config
.husky/ git hooks
commitlint.config.* commit lint config
src/services/ant-design-pro/ auto-generated — do NOT manually edit; regenerate with npm run openapi

Business files — preserve these, only adjust imports/APIs if needed:

  • src/pages/** — user pages
  • src/components/** — user components
  • src/models/** — user models
  • src/services/**/*.ts — custom service files (NOT the ant-design-pro/ subdirectory)
  • src/locales/** — user translations (framework keys may need updating)
  • src/utils/** — user utilities
  • mock/** — user mocks
  • Any other files not listed above

Step 3 — Diff framework files

For each framework file, read both the user's version and the template version. Identify:

  • New dependencies or version bumps in package.json
  • New/changed config options in config/ files
  • Import path changes (e.g., from 'umi' → from '@umijs/max')
  • API changes in src/app.tsx, src/access.ts, etc.
  • New files that exist in template but not in user's project

Step 4 — Merge intelligently

Apply changes with these rules:

Framework files — adopt template structure, preserve user customizations:

  • package.json: update dependency versions to match template. Keep any extra deps the user added. If a dependency exists in the user's project but not in the template, assume it is a user customization and preserve it.
  • config/routes.ts: adopt the template's route structure for framework pages, but keep all user-added routes intact.
  • config/proxy.ts: adopt structure, preserve user's proxy targets.
  • Other framework files: adopt the template version, preserving any user customizations that are clearly intentional (comments, extra exports, business logic mixed in).

Business files — minimal changes only:

  • Update import paths if framework modules moved (e.g., 'umi' → '@umijs/max').
  • Update deprecated API calls if the template shows a new pattern.
  • Never rewrite business logic, restructure components, or change styling approaches unless the old approach is broken.

Auto-generated files:

  • src/services/ant-design-pro/: do NOT edit. Tell the user to run npm run openapi after upgrade.

Step 5 — Antd-specific migration checks

Run these commands to catch antd API changes:

npx antd env --format json
npx antd lint ./src --format json --only deprecated

If the user is upgrading across major antd versions, also run:

npx antd migrate <current_major> <target_major> --format json

Detect the current major version from the user's package.json and the target from the template's.

Address any findings by updating the flagged code.

Step 6 — Install and verify

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

Tôi có cần lưu thay đổi trước không?

Có. Skill yêu cầu bạn commit hoặc stash thay đổi trước khi nâng cấp bắt đầu.

Các trang của tôi có bị ghi đè không?

Không. Các tệp nghiệp vụ bạn đã viết được giữ lại, và các route bạn thêm được bảo toàn.

Template là gì?

Đó là dự án khởi đầu chính thức của Ant Design Pro, mà ứng dụng của bạn được xây dựng từ đó.

Chi tiết

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

Use when the user wants to upgrade their Ant Design Pro project to the latest version. Triggers on: upgrade pro, pro upgrade, migrate pro, update pro, 升级, 迁移项目, "how to upgrade", "update to latest", "keep project up to date".

repo: ant-design/ant-design-pro

Độ phổ biến

Sao GitHub
39k
Vị trí xếp hạng
#7485
Giấy phép
MIT
Cập nhật
28/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ự