shadcn-ui
Skill này làm gì
Skill này bảo agent dùng các phần giao diện có sẵn của ứng dụng và chủ đề của nó, thay vì đoán từ các ví dụ bên ngoài. Skill dành cho lập trình viên xây dựng hoặc thay đổi màn hình trong ứng dụng dùng các component kiểu shadcn.
Khi nào nên dùng
- ✓Khi bạn thêm một hộp thoại, menu, form hoặc nút vào màn hình ứng dụng.
- ✓Khi bạn đổi diện mạo một component và cần giữ đúng chủ đề.
- ✓Khi bạn cần một phần giao diện mà ứng dụng có thể đã cung cấp sẵn.
Liên kết skill
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/shadcn-ui/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 hộp thoại xác nhận có form vào màn hình này, dùng các nút và màu mà ứng dụng đã dùng.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent đọc cấu hình component của ứng dụng và dùng các biến thể và màu chủ đề có sẵn. Nó nhập các điều khiển qua wrapper cục bộ của ứng dụng, thay vì thay đổi giao diện chung chỉ cho một màn hì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.
shadcn/ui and Local UI Adapters
Use the components already provided by the app. Read the app's design-system configuration, Toolkit provider, and local UI components before adding or changing a control. Their exports, variants, and props are the contract; do not guess from upstream examples.
Keep imports behind the local adapter
Product pages and domain components should import standard controls through the
app's configured local UI alias. In the Chat starter, that is
@/components/ui/*; its app/components/ui/button.tsx is a one-line
re-export of @agent-native/toolkit/ui/button. Follow an adjacent local shim
when the app needs another Toolkit primitive that is already exported there.
Use the app's configured design system and provider mapping for controls passed
to shared Toolkit surfaces. For shared Toolkit feature presentation, use the
semantic components exposed by @agent-native/toolkit/design-system; keep the
feature behavior in its existing controller and customize only its supported
presentation seam.
Compose existing controls
- Prefer a primitive's built-in variant and size. Put page layout on a parent instead of overriding shared component appearance for one screen.
- Use the app's semantic theme tokens for reusable UI, such as
bg-background,text-muted-foreground,border-border, andbg-primary. Keep theme values in the app's existing CSS theme file. - Use the control that matches the choice:
Switchfor a binary setting,Checkboxfor independent multi-select,RadioGroupfor one choice from a short set, andSelector the app's combobox for a longer predefined list. - Compose cards and form fields from the primitives already available. Avoid
adding explanatory copy that repeats a visible title or label; see
frontend-designfor the app's surface-density rules. - Put selectable items inside their menu or list group primitives. Keep tab triggers inside the tab list. Supply an accessible title to dialog, sheet, drawer, and alert-dialog content.
- Match the trigger API to the actual local component. Toolkit wrappers may
expose a different API from the upstream primitive; inspect its props before
using options such as
asChildorrender.
Keep controls operable
Use the app's existing field components and validation pattern. Associate errors with their inputs and expose invalid state to assistive technology. Icon-only actions need an accessible name and a usable focus target. Use the icon package already installed by the app.
Do not recreate menus, popovers, dialogs, or confirmations with absolute
positioning and custom click-outside handlers. Never use browser alert,
confirm, or prompt; use the app's dialog primitives. Keep overlay focus,
keyboard, dismissal, and stacking behavior from the existing primitive.
For small visual refinements, use layout classes and semantic tokens. Avoid raw
palette overrides, arbitrary one-off values, and manual overlay z-index unless
you are fixing a reproduced bug. Use gap-* for layout spacing and the app's
class-merging helper when it has one.
Related skill
- frontend-design — Product UX, density, visual direction, and responsive behavior.
Câu hỏi thường gặp
Tôi có nên ghi đè kiểu của component cho một trang không?
Không. Skill nói nên đặt bố cục trang ở phần tử cha thay vì thay đổi giao diện chung.
Màu chủ đề nên lấy từ đâu?
Từ các token chủ đề của ứng dụng, chẳng hạn bg-background hoặc text-muted-foreground.
Nếu ví dụ upstream trông khác thì sao?
Các export, biến thể và props của chính ứng dụng là tài liệu tham chiếu.
Chi tiết
Mô tả gốc của tác giả
Using the app's local UI adapter and Toolkit or shadcn primitives. Use when choosing or composing standard controls, implementing dialogs, menus, or forms, or changing component variants and theme tokens.
repo: BuilderIO/agent-native
Độ phổ biến
- Sao GitHub
- 7.6k
- Vị trí xếp hạng
- #13183
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
design-exploration
7.6kGiúp agent của bạn khám phá nhiều hướng thiết kế giao diện song song, để bạn chọn một hướng rồi tinh chỉnh thiết kế đã chọn.
visual-edit
7.6kGiúp agent của bạn mở một ứng dụng cục bộ đang chạy trong trình chỉnh sửa trực quan, để bạn xem và sửa các màn hình thật cùng nhau.
turn-into-app
7.6kBiến quy trình, bảng tính hoặc dự án thành ứng dụng trực quan có màn hình đầy đủ dữ liệu, với agent làm việc phía sau các điều khiển.
visual-plan
7.6kBiến một kế hoạch viết bằng văn bản thuần thành kế hoạch trực quan tương tác, có sơ đồ, bản đồ file, đoạn code và các câu hỏi còn mở.
Skill tương tự
canvas
394kCho phép agent của bạn hiện một widget trực quan được lưu trữ trên bảng Mac đã kết nối, rồi ẩn bảng hoặc chuyển nó sang trang khác.
control-ui
394kGiúp agent của bạn sắp xếp và khắc phục sự cố Control UI của OpenClaw, gồm các phiên, bảng điều khiển và Gateway đã kết nối.
diagram-maker
394kGiúp agent của bạn vẽ sơ đồ rõ ràng dạng SVG, HTML hoặc Excalidraw có thể sửa, cho quy trình, kiến trúc hệ thống và bản phác bảng trắng.