- Preflight warning: change from Chinese-only to English
- Dependency merging: preserve user deps not found in template by default
- antd migrate: use version placeholders instead of hardcoded "5 6"
- Business files: use recursive glob src/services/**/*.ts
- Cheatsheet: temper "upgrade" to "assist" to avoid overpromising
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@ -29,7 +29,7 @@ You are an Ant Design Pro upgrade assistant. Your task is to help users upgrade
Before starting, confirm:
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).
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: **"请先 commit 或 stash 你的更改,升级过程会修改多个文件。"** and wait for them to confirm.
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
## Upgrade Flow
@ -72,7 +72,7 @@ Separate the user's project files into **framework files** (Pro-owned, rarely cu
- `src/pages/**` — user pages
- `src/pages/**` — user pages
- `src/components/**` — user components
- `src/components/**` — user components
- `src/models/**` — user models
- `src/models/**` — user models
- `src/services/*.ts` — custom service files (NOT the `ant-design-pro/` subdirectory)
- `src/services/**/*.ts` — custom service files (NOT the `ant-design-pro/` subdirectory)
- `src/locales/**` — user translations (framework keys may need updating)
- `src/locales/**` — user translations (framework keys may need updating)
- `src/utils/**` — user utilities
- `src/utils/**` — user utilities
- `mock/**` — user mocks
- `mock/**` — user mocks
@ -93,7 +93,7 @@ For each framework file, read both the user's version and the template version.
Apply changes with these rules:
Apply changes with these rules:
**Framework files — adopt template structure, preserve user customizations:**
**Framework files — adopt template structure, preserve user customizations:**
- `package.json`: update dependency versions to match template. Keep any extra deps the user added. Remove deps only if the template explicitly removed them (check the template's `package.json`).
- `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/routes.ts`: adopt the template's route structure for framework pages, but keep all user-added routes intact.
- Other framework files: adopt the template version, preserving any user customizations that are clearly intentional (comments, extra exports, business logic mixed in).
- Other framework files: adopt the template version, preserving any user customizations that are clearly intentional (comments, extra exports, business logic mixed in).
@ -497,7 +497,7 @@ First, install the pro-upgrade skill into your project:
```bash
```bash
npx skills add ant-design/ant-design-pro
npx skills add ant-design/ant-design-pro
```
```
Then run `/pro-upgrade` in Claude Code at the project root — AI will auto-diff the latest template and upgrade your project (deps, config, code patterns, etc.). For other AI assistants, paste the content of `.claude/skills/pro-upgrade/SKILL.md` to them.
Then run `/pro-upgrade` in Claude Code at the project root — AI will auto-diff the latest template and assist your upgrade (deps, config, code patterns, etc.), with conservative handling for ambiguous merges. For other AI assistants, paste the content of `.claude/skills/pro-upgrade/SKILL.md` to them.
**Q: How to deploy?**
**Q: How to deploy?**
`npm run build` generates `dist/`. Deploy to any static file server. Set `publicPath` for non-root deployments. `npm run deploy` builds and publishes to GitHub Pages automatically (pushes to gh-pages branch).
`npm run build` generates `dist/`. Deploy to any static file server. Set `publicPath` for non-root deployments. `npm run deploy` builds and publishes to GitHub Pages automatically (pushes to gh-pages branch).
然后在项目根目录用 Claude Code 运行 `/pro-upgrade`,AI 会自动对比最新模板并完成升级(依赖、配置、代码模式等)。如使用其他 AI 助手,可将 `.claude/skills/pro-upgrade/SKILL.md` 中的内容提供给它。
然后在项目根目录用 Claude Code 运行 `/pro-upgrade`,AI 会自动对比最新模板并辅助完成升级(依赖、配置、代码模式等),遇到冲突时会保守处理并询问确认。如使用其他 AI 助手,可将 `.claude/skills/pro-upgrade/SKILL.md` 中的内容提供给它。
**Q: 如何部署?**
**Q: 如何部署?**
`npm run build` 生成 `dist/` 目录,部署到任意静态服务器。配置 `publicPath` 处理非根目录部署。`npm run deploy` 会自动构建并发布到 GitHub Pages(推送到 gh-pages 分支)。
`npm run build` 生成 `dist/` 目录,部署到任意静态服务器。配置 `publicPath` 处理非根目录部署。`npm run deploy` 会自动构建并发布到 GitHub Pages(推送到 gh-pages 分支)。