@ -40,10 +40,23 @@ Other: `npm run openapi` (regenerate `src/services/`), `npm run simple` (**irrev
**Cloudflare Worker**: `cloudflare-worker/` — separate Hono app, own `package.json`, not an npm workspace.
## Upgrading
## AI Skills
This project ships with two built-in Claude Code Skills (`.claude/skills/`). If you already have these skills in your project, no installation is needed — just run them directly. To update to the latest skill definitions, run `npx skills add ant-design/ant-design-pro`.
### `/pro-upgrade` — Project Upgrade
Run `/pro-upgrade` in Claude Code to auto-upgrade the project to the latest Ant Design Pro version. It diffs the latest template against this project and merges framework changes while preserving business code. Works for any version gap (v5→v6, v6.x→latest, etc.).
### `/antd` — Ant Design CLI
Run `/antd` in Claude Code for any antd-related work. It provides access to `@ant-design/cli` with offline metadata for antd v3/v4/v5/v6. Key commands:
- `npx antd info <Component>` — look up props/API before writing code (mandatory)
- `npx antd lint ./src` — check for deprecated or problematic usage (must pass before commit)
- `npx antd demo <Component> <demo>` — get working code examples
- `npx antd migrate <from> <to>` — migration checklist between major versions
## Page Co-location
Each page dir: `index.tsx`, optional `service.ts`, `_mock.ts`, `data.d.ts`, style files. Keep page-specific code with the page.
This project ships with two built-in [Claude Code Skills](https://docs.anthropic.com/en/docs/claude-code/skills) in `.claude/skills/`:
| Skill | Trigger | Description |
|---|---|---|
| `/pro-upgrade` | "upgrade pro", "update to latest" | Auto-upgrade to the latest Ant Design Pro version. Diffs the latest template, merges framework changes while preserving your business code. |
| `/antd` | antd-related code or questions | Query antd component APIs, props, tokens, demos; lint for deprecated usage; migrate between versions — all via `@ant-design/cli`. |
**Usage in Claude Code:**
```bash
# Upgrade the project to latest Pro version
/pro-upgrade
# Query antd component info, debug issues, run lint, etc.
/antd
```
> 💡 If your project was cloned from this repo, these skills are already included — no installation needed. To get the latest skill definitions, pull the updates from the template or run `npx skills add ant-design/ant-design-pro` to refresh them.
This project includes two built-in [Claude Code Skills](https://docs.anthropic.com/en/docs/claude-code/skills) (`.claude/skills/`):
### `/pro-upgrade` — Project Upgrade Assistant
Auto-upgrade to the latest Ant Design Pro version. Diffs the latest template against your project and merges framework changes while preserving business code.
```bash
# In Claude Code, just run:
/pro-upgrade
```
What it does:
1. Clones the latest Pro template
2. Classifies framework vs. business files
3. Merges dependency updates, config changes, and code pattern migrations
4. Runs `npx antd lint` to catch antd-specific issues
5. Verifies with `npm run lint && npm run build`
### `/antd` — Ant Design CLI Helper
Query antd component APIs, debug issues, lint for deprecated usage, and assist migrations — all via `@ant-design/cli` with offline bundled metadata.
```bash
# In Claude Code, just run:
/antd
```
Key commands available:
- `npx antd info <Component>` — props, types, version info
- `npx antd demo <Component> <demo>` — working code examples
- `npx antd lint ./src` — check for deprecated/problematic usage
- `npx antd doc <Component>` — full component documentation
### Installation & Updates
> 💡 If your project was cloned from this repo, these skills are already included — no installation needed.
To get the latest skill definitions (or add them to an existing project):
```bash
npx skills add ant-design/ant-design-pro
```
For other AI assistants (Cursor, etc.), paste the content of `.claude/skills/pro-upgrade/SKILL.md` or `.claude/skills/antd/SKILL.md` into the assistant's context.
## Constraints & Gotchas
- **`src/services/ant-design-pro/`** is auto-generated code. Do NOT edit manually. Modify `config/oneapi.json` and run `npm run openapi` to regenerate.