antd
Skill này làm gì
Skill này cung cấp cho agent dữ liệu tham chiếu chính xác cho thư viện component Ant Design. Skill dành cho lập trình viên xây hoặc gỡ lỗi các màn hình React dùng antd.
Khi nào nên dùng
- ✓Khi bạn đang viết hoặc thay đổi một component Ant Design trong mã.
- ✓Khi bạn cần tìm đúng props, một demo hoạt động hoặc các design token cho một component.
- ✓Khi bạn đang nâng cấp giữa các phiên bản Ant Design hoặc gỡ lỗi một vấn đề antd.
Liên kết skill
https://github.com/ant-design/ant-design-pro/blob/master/.claude/skills/antd/SKILL.mdSao 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
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Thêm một date picker của Ant Design vào biểu mẫu này. Hãy kiểm tra các props có sẵn trước và dùng một ví dụ hoạt động.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent dùng một công cụ dòng lệnh cục bộ có sẵn dữ liệu Ant Design cho nhiều phiên bản. Nó tra cứu props, demo và theme token của từng component, rồi viết mã dựa trên thông tin đó thay vì trí nhớ.
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 CLI
You have access to @ant-design/cli — a local CLI tool with bundled antd metadata for v3/v4/v5/v6. Use it to query component knowledge, analyze projects, and guide migrations. All data is offline, no network needed.
Setup
The CLI is installed as a dev dependency. Use npx antd to run it.
Always use --format json for structured output you can parse programmatically.
Scenarios
1. Writing antd component code
Before writing any antd component code, look up its API first — don't rely on memory.
# Check what props are available
npx antd info Button --format json
# Get a working demo as starting point
npx antd demo Button basic --format json
# Check semantic classNames/styles for custom styling
npx antd semantic Button --format json
# Check component-level design tokens for theming
npx antd token Button --format json
Workflow: antd info → understand props → antd demo → grab a working example → write code.
2. Looking up full documentation
When you need comprehensive component docs (not just props):
npx antd doc Table --format json # full markdown docs for Table
npx antd doc Table --lang zh # Chinese docs
3. Debugging antd issues
When code isn't working as expected or the user reports an antd bug:
# Collect full environment snapshot (system, deps, browsers, build tools)
npx antd env --format json
# Check if the prop exists for the user's antd version
npx antd info Select --version 5.12.0 --format json
# Check if the prop is deprecated
npx antd lint ./src/components/MyForm.tsx --format json
# Diagnose project-level configuration issues
npx antd doctor --format json
Workflow: antd env → capture full environment → antd doctor → check configuration → antd info --version X → verify API against the user's exact version → antd lint → find deprecated or incorrect usage.
4. Migrating between versions
When the user wants to upgrade antd (e.g., v3 → v4 or v4 → v5):
# Get full migration checklist
npx antd migrate 3 4 --format json # v3 → v4
npx antd migrate 4 5 --format json # v4 → v5
# Check migration for a specific component
npx antd migrate 4 5 --component Select --format json
# See what changed between two versions
npx antd changelog 4.24.0 5.0.0 --format json
# See changes for a specific component
npx antd changelog 4.24.0 5.0.0 Select --format json
Workflow: antd migrate → get full checklist → antd changelog <v1> <v2> → understand breaking changes → apply fixes → antd lint → verify no deprecated usage remains.
5. Analyzing project antd usage
When the user wants to understand how antd is used in their project:
# Scan component usage statistics
npx antd usage ./src --format json
# Filter to a specific component
npx antd usage ./src --filter Form --format json
# Lint for best practice violations
npx antd lint ./src --format json
# Check only specific rule categories
npx antd lint ./src --only deprecated --format json
npx antd lint ./src --only a11y --format json
npx antd lint ./src --only performance --format json
6. Checking changelogs and version history
When the user asks about what changed in a version:
# Specific version changelog
npx antd changelog 5.22.0 --format json
# Version range (both ends inclusive)
npx antd changelog 5.21.0..5.24.0 --format json
7. Exploring available components
When the user is choosing which component to use:
# List all components with categories
npx antd list --format json
# List components for a specific antd version
npx antd list --version 5.0.0 --format json
8. Collecting environment info
When you need to understand the project's antd setup, or prepare info for a bug report:
# Full environment snapshot (text — paste into GitHub Issues)
npx antd env
# Structured JSON for programmatic use
npx antd env --format json
# Scan a specific project directory
npx antd env ./my-project --format json
9. Reporting antd bugs
When the user asks you to report an antd bug:
# Step 0: Collect environment info for reference (optional)
npx antd env --format json
# Step 1: Preview for user review
npx antd bug --title "DatePicker crashes when selecting date" \
--reproduction "https://codesandbox.io/s/xxx" \
--steps "1. Open DatePicker 2. Click a date" \
--expected "Date is selected" \
--actual "Component crashes with error" \
--format json
Câu hỏi thường gặp
Nó có cần truy cập internet không?
Không. Dữ liệu Ant Design được đóng gói cùng công cụ dòng lệnh cục bộ, nên tra cứu hoạt động ngoại tuyến.
Nó bao quát những phiên bản nào?
Ant Design phiên bản 3, 4, 5 và 6.
Nó có giúp được việc di chuyển không?
Có. Nó có thể hướng dẫn di chuyển giữa các phiên bản Ant Design và phân tích cách dùng antd trong dự án.
Chi tiết
Mô tả gốc của tác giả
Use when the user's task involves Ant Design (antd) — writing antd components, debugging antd issues, querying antd APIs/props/tokens/demos, migrating between antd versions, or analyzing antd usage in a project. Triggers on antd-related code, imports from 'antd', or explicit antd questions.
Độ phổ biến
- Sao GitHub
- 39k
- Vị trí xếp hạng
- #7484
- Giấy phép
- MIT
- Cập nhật
- 28/10/2026
Bình luận
- …
Thêm skill từ kho mã này
Skill tương tự
angular-developer
280kGiúp agent của bạn viết code Angular và tư vấn cấu trúc dự án, hữu ích khi bắt đầu dự án mới hoặc cải thiện hiệu suất.
frontend-a11y
280kGiúp agent của bạn làm cho giao diện web dễ tiếp cận với mọi người. Đảm bảo website và ứng dụng hoạt động tốt với trình đọc màn hình và điều hướng bằng bàn phím.
frontend-patterns
280kGiúp agent của bạn áp dụng các mẫu hiện đại trong phát triển frontend. Tối ưu hiệu năng, quản lý trạng thái và tuân theo thực hành tốt nhất với React và Next.js.