ui-component – skill Thiết kế & UI cho agent AI
Tạo component UI mới theo quy ước thiết kế của StyleSeed.
Cài skill ui-component bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/ui-component-3e566.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /ui-component – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/ui-component-3e566.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $ui-component – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/ui-component-3e566.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /ui-component – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/ui-component-3e566.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /ui-component – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
UI Component Generator
When to Use
Use this skill when you need generate a new UI component following the StyleSeed design conventions.
When NOT to use
- For full-page scaffolding → use
/ss-page - For composed multi-component patterns → use
/ss-pattern - For tweaking an existing component — just edit the file directly
- For non-StyleSeed projects (no
components/ui/directory or no Tailwind v4)
Generate a new component: $0
Description: $ARGUMENTS
Instructions
1. First, read the design system seed for context:
- Read
CLAUDE.mdfor component conventions - Read
css/theme.cssfor available design tokens - Read
components/ui/button.tsxas a reference pattern
2. Follow these conventions strictly:
- Use
functiondeclaration (notconst) - Add
data-slot="component-name"attribute - Use
cn()from@/components/ui/utilsfor all className merging - Use
React.ComponentProps<>for prop typing - Always support
classNameprop for overrides - Use CVA (
class-variance-authority) if the component has variants - Use semantic color tokens (
bg-card,text-foreground) — never inline hex
3. Design token usage:
- Colors:
text-foreground,bg-card,text-brand,text-muted-foreground,border-border - Shadows:
shadow-[var(--shadow-card)],shadow-[var(--shadow-elevated)] - Radius:
rounded-md,rounded-lg,rounded-2xl - Spacing: multiples of 6px (
p-1.5,p-3,p-6) - Motion:
duration-[var(--duration-fast)],ease-[var(--ease-default)]
4. Typography rules:
- Display (36-48px):
leading-none tracking-[-0.02em] - Heading (18-24px):
leading-snug tracking-[-0.01em] - Body (14-17px):
leading-normal(default tracking) - Caption uppercase (10-13px):
tracking-[0.05em] - Use
size-*shorthand instead ofw-* h-* - Use
ms-*/me-*instead ofml-*/mr-*(logical properties)
5. Accessibility requirements:
- Minimum touch target: 44x44px (
min-h-11 min-w-11) - Support
aria-*attributes passthrough - Use
focus-visible:ring-2 focus-visible:ring-ringfor keyboard focus - Respect
prefers-reduced-motionfor animations
6. Export the component as a named export (not default)
7. Place the file in the appropriate directory:
- Primitive/reusable →
src/components/ui/ - Composed pattern →
src/components/patterns/
Example
User request:
> Generate a new UI component following the StyleSeed design conventions.
Limitations
- Use this skill only when the task clearly matches its upstream source and local project context.
- Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.
- Do not treat examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.
Execution boundaries
This guide targets an existing StyleSeed project. The listed project paths, components, tokens and /ss-* commands are not bundled in this single-file entrypoint. Discover the actual project root and verify those prerequisites before edits; report absent resources instead of inventing them. Use host-supported invocation and existing project conventions. Layout numbers are design-system choices, not universal usability guarantees. Test keyboard access, responsive overflow and reduced motion on the actual interface.
Skill liên quan
- ui-from-screenshot – Chuyển ảnh chụp màn hình hoặc mockup thành giao diện tương ứng bằng chính các component…
- ui-lint – Lint tự động nhanh — phát hiện các vi phạm design system phổ biến chỉ trong vài giây.
- ui-motion – Áp dụng một chuyển động StyleSeed có tên cho component — hoặc một trong 5 seed tính cách…
- ui-page – Khởi tạo khung trang/màn hình mobile mới theo các pattern layout của StyleSeed.
- ui-pattern – Tạo pattern UI ghép sẵn (bố cục card, danh sách, khối form, grid, v.v.) từ các primitive…
- ui-review – Review code UI về mức tuân thủ design system, khả năng truy cập và các thực hành tốt nhất.
- ui-score – Chấm điểm chất lượng thiết kế của file UI theo thang 0-100 dựa trên ngôn ngữ thiết kế…
- ui-setup – Trình hướng dẫn cài đặt tương tác — dẫn bạn từng bước để cấu hình design system cho dự án.