跳到正文
Skillpedia
界面(UI/UX)48k · #6036

ui-component

它能做什么

这个智能体会按照一套特定的设计和编码规则,为网站或应用创建新的视觉组件。它能确保组件与项目整体的外观和风格完美契合。

适用场景

  • ✓当你需要一个特定样式的新按钮时。
  • ✓当你要创建一个符合项目风格的文本输入框时。
  • ✓当你想添加一个新的视觉元素,比如卡片或提示框时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/ui-component/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/ui-component/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“创建一个新的卡片组件,用于展示用户的个人资料信息。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会读取项目的设计规则,并据此编写新组件的代码。它会确保代码遵循既定约定,比如颜色、间距和无障碍等方面的用法。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

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.md for component conventions
    • Read css/theme.css for available design tokens
    • Read components/ui/button.tsx as a reference pattern
  2. Follow these conventions strictly:

    • Use function declaration (not const)
    • Add data-slot="component-name" attribute
    • Use cn() from @/components/ui/utils for all className merging
    • Use React.ComponentProps<> for prop typing
    • Always support className prop 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 of w-* h-*
    • Use ms-*/me-* instead of ml-*/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-ring for keyboard focus
    • Respect prefers-reduced-motion for 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.
常见问题

什么是“设计规范”?

设计规范是一套规则和指南,定义了网站或应用中的视觉元素应如何创建和设计样式,以保持风格统一。

什么是 “StyleSeed”?

这是一套具体的设计系统的名称,该智能体会将它作为创建组件的参考。

我能用这个智能体修改现有组件吗?

不能,这个智能体只用于创建新组件。如果要修改现有组件,你应该直接编辑对应文件。

详情

作者的原始描述

Generate a new UI component following the StyleSeed design conventions

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#6036
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能