SKILL.md--- name: pro-upgrade description: > 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". allowed-tools: - Bash(git clone *) - Bash(diff *) - Bash(npm install) - Bash(npm run lint*) - Bash(npm run build*) - Bash(npm run tsc*) - Bash(npx antd *) - Bash(rm -rf /tmp/ant-design-pro-upgrade*) - Read - Edit - Write - Glob - Grep --- # 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 ```bash 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 framewor