重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
component-interface-design by qodex-ai/ai-agent-skills
npx skills add https://github.com/qodex-ai/ai-agent-skills --skill component-interface-design设计任何用户界面时,请遵循以下理念:
"设计一个遵循 Shadcn 原则的现代、简洁的用户界面:运用极简主义,留足空白,采用简单的无衬线字体排版;使用策略性、微妙的阴影来营造深度和层次感;通过高对比度的中性色和可缩放元素确保可访问性;为按钮、卡片和表单提供美观的默认样式,使其能够模块化组合;融入流畅、非侵入式的动画;保持由柔和的灰色、白色和极少的强调色(如紫色)组成的专业调色板;输出为使用 Tailwind CSS 的响应式、可自定义的 React 代码。"
每个屏幕限制使用 2-3 种字体粗细和大小
使用 Inter 或系统字体以确保一致性
<h1 className="text-2xl font-semibold">标题</h1> <p className="text-sm text-muted-foreground">描述</p>基于 4px 的尺度 : 4px, 8px, 16px, 24px, 32px
Tailwind 工具类: p-1, p-2, p-4, p-6, p-8
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
基于 OKLCH 以实现感知均匀性
使用 50-950 级灰度(背景色、前景色、柔和色)
微妙的强调色,使用 10% 不透明度以避免视觉噪音
<Card className="bg-card text-card-foreground border-border"> <Button className="bg-primary text-primary-foreground">操作</Button> <div className="bg-primary/10">微妙的强调色</div> </Card>仅限 3 个层级 :
shadow-sm: 轻微提升 (0 1px 2px) - 用于卡片shadow-md: 中等深度 (0 4px 6px) - 用于下拉菜单shadow-lg: 高海拔 (0 10px 15px) - 用于模态框200-300 毫秒的持续时间
使用 ease-in-out 缓动曲线进行过渡
仅提供微妙的反馈(悬停、状态变化)- 无装饰性点缀
<Button className="transition-colors duration-200 hover:bg-primary/90"> <Card className="transition-transform duration-200 hover:scale-105">所有交互元素都添加 ARIA 标签
符合 WCAG 2.1 AA 对比度比率(最低 4.5:1)
键盘焦点样式与悬停状态匹配
语义化的 HTML 结构
<button aria-label="提交表单" className="focus:ring-2 focus:ring-primary focus:outline-none"
提交 </button>
import { Button } from "@/components/ui/button"
import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card"
export function MyComponent() {
return (
<div className="container mx-auto p-6 space-y-6">
<header>
<h1 className="text-2xl font-semibold">页面标题</h1>
</header>
<main className="grid gap-4">
<Card className="shadow-sm">
<CardHeader>
<CardTitle>部分</CardTitle>
</CardHeader>
<CardContent>
{/* 内容 */}
</CardContent>
</Card>
</main>
</div>
)
}
完成前,请验证:
<div className="container mx-auto p-6 space-y-6">
<header className="space-y-2">
<h1 className="text-2xl font-semibold">仪表板</h1>
<p className="text-sm text-muted-foreground">指标概览</p>
</header>
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4">
{stats.map(stat => (
<Card key={stat.id} className="shadow-sm">
<CardHeader className="pb-2">
<CardTitle className="text-sm font-medium text-muted-foreground">
{stat.title}
</CardTitle>
</CardHeader>
<CardContent>
<div className="text-2xl font-semibold">{stat.value}</div>
</CardContent>
</Card>
))}
</div>
</div>
<form className="space-y-6">
<div className="space-y-4">
<div className="space-y-2">
<Label htmlFor="name">全名</Label>
<Input id="name" placeholder="张三" />
</div>
<div className="space-y-2">
<Label htmlFor="email">邮箱</Label>
<Input id="email" type="email" placeholder="john@example.com" />
</div>
</div>
<Button type="submit" className="w-full transition-colors duration-200">
提交
</Button>
</form>
<Card className="shadow-sm">
<CardHeader>
<CardTitle className="text-xl font-semibold">近期订单</CardTitle>
</CardHeader>
<CardContent>
<Table>
<TableHeader>
<TableRow>
<TableHead>订单 ID</TableHead>
<TableHead>客户</TableHead>
<TableHead>状态</TableHead>
</TableRow>
</TableHeader>
<TableBody>
{orders.map(order => (
<TableRow key={order.id} className="hover:bg-muted/50 transition-colors">
<TableCell className="font-medium">{order.id}</TableCell>
<TableCell>{order.customer}</TableCell>
<TableCell>
<Badge variant="default">{order.status}</Badge>
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</CardContent>
</Card>
每周安装量
63
代码仓库
GitHub 星标数
5
首次出现
2026年1月22日
安全审计
安装于
opencode47
gemini-cli44
codex43
claude-code41
github-copilot39
cursor36
When designing any UI, apply this philosophy:
"Design a modern, clean UI following Shadcn principles: apply minimalism with ample white space and simple sans-serif typography; use strategic, subtle shadows for depth and hierarchy; ensure accessibility with high-contrast neutrals and scalable elements; provide beautiful defaults for buttons, cards, and forms that compose modularly; incorporate fluid, non-intrusive animations; maintain a professional palette of soft grays, whites, and minimal accents like purple; output as responsive, customizable React code with Tailwind CSS."
Limit to 2-3 font weights and sizes per screen
Use Inter or system fonts for consistency
<h1 className="text-2xl font-semibold">Title</h1> <p className="text-sm text-muted-foreground">Description</p>4px-based scale : 4px, 8px, 16px, 24px, 32px
Tailwind utilities: p-1, p-2, p-4, p-6, p-8
Base on OKLCH for perceptual uniformity
Use 50-950 scale grays (background, foreground, muted)
Subtle accents at 10% opacity to avoid visual noise
<Card className="bg-card text-card-foreground border-border"> <Button className="bg-primary text-primary-foreground">Action</Button> <div className="bg-primary/10">Subtle accent</div> </Card>3 levels only :
shadow-sm: Subtle lift (0 1px 2px) - for cardsshadow-md: Medium depth (0 4px 6px) - for dropdownsshadow-lg: High elevation (0 10px 15px) - for modals200-300ms durations
ease-in-out curves for transitions
Subtle feedback only (hovers, state changes) - no decorative flourishes
<Button className="transition-colors duration-200 hover:bg-primary/90"> <Card className="transition-transform duration-200 hover:scale-105">ARIA labels on all interactive elements
WCAG 2.1 AA contrast ratios (4.5:1 minimum)
Keyboard-focus styles matching hover states
Semantic HTML structure
<button aria-label="Submit form" className="focus:ring-2 focus:ring-primary focus:outline-none"
Submit </button>
import { Button } from "@/components/ui/button"
import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card"
export function MyComponent() {
return (
<div className="container mx-auto p-6 space-y-6">
<header>
<h1 className="text-2xl font-semibold">Page Title</h1>
</header>
<main className="grid gap-4">
<Card className="shadow-sm">
<CardHeader>
<CardTitle>Section</CardTitle>
</CardHeader>
<CardContent>
{/* Content */}
</CardContent>
</Card>
</main>
</div>
)
}
Before completing, verify:
<div className="container mx-auto p-6 space-y-6">
<header className="space-y-2">
<h1 className="text-2xl font-semibold">Dashboard</h1>
<p className="text-sm text-muted-foreground">Overview of metrics</p>
</header>
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4">
{stats.map(stat => (
<Card key={stat.id} className="shadow-sm">
<CardHeader className="pb-2">
<CardTitle className="text-sm font-medium text-muted-foreground">
{stat.title}
</CardTitle>
</CardHeader>
<CardContent>
<div className="text-2xl font-semibold">{stat.value}</div>
</CardContent>
</Card>
))}
</div>
</div>
<form className="space-y-6">
<div className="space-y-4">
<div className="space-y-2">
<Label htmlFor="name">Full Name</Label>
<Input id="name" placeholder="John Doe" />
</div>
<div className="space-y-2">
<Label htmlFor="email">Email</Label>
<Input id="email" type="email" placeholder="john@example.com" />
</div>
</div>
<Button type="submit" className="w-full transition-colors duration-200">
Submit
</Button>
</form>
<Card className="shadow-sm">
<CardHeader>
<CardTitle className="text-xl font-semibold">Recent Orders</CardTitle>
</CardHeader>
<CardContent>
<Table>
<TableHeader>
<TableRow>
<TableHead>Order ID</TableHead>
<TableHead>Customer</TableHead>
<TableHead>Status</TableHead>
</TableRow>
</TableHeader>
<TableBody>
{orders.map(order => (
<TableRow key={order.id} className="hover:bg-muted/50 transition-colors">
<TableCell className="font-medium">{order.id}</TableCell>
<TableCell>{order.customer}</TableCell>
<TableCell>
<Badge variant="default">{order.status}</Badge>
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</CardContent>
</Card>
Weekly Installs
63
Repository
GitHub Stars
5
First Seen
Jan 22, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode47
gemini-cli44
codex43
claude-code41
github-copilot39
cursor36
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
123,700 周安装
PHP/TYPO3安全审计技能 | OWASP Top 10自动化代码扫描与漏洞预防指南
93 周安装
阿里云AI搜索重排序插件:Model Studio重排模型集成,优化搜索结果相关性
92 周安装
Hugo 静态网站生成器完整指南:5分钟快速上手与7步设置流程
94 周安装
download-anything:一站式命令行下载工具包,支持视频、音频、图片、种子等资源下载
95 周安装
Solana智能合约安全审计工具 - 自动化扫描漏洞,支持Anchor框架
57 周安装
Stellar/Soroban智能合约开发环境设置与OpenZeppelin库集成指南
93 周安装