Token导航 LogoToken导航

Agent Skill · 研究检索

design-system-validator(设计系统验证器)

用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。它适合让 Agent 根据产品场景整理页面结构、生成 UI 方案、检查视觉一致性或改进组件层级。使用时需要结合现有品牌、设计系统和用户任务,不应只堆装饰元素;涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出、对齐和响应式表现。

design-system-validator 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 23,344。

总安装 4,293周安装 220GitHub Stars 1下载 2,977核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:design-system-validator(设计系统验证器)
来源仓库:https://github.com/ankish8/storybook-npm
仓库路径:skills/design-system-validator
安装命令:
npx skills add https://github.com/ankish8/storybook-npm --skill 'Design System Validator'
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/ankish8/storybook-npm --skill 'Design System Validator'

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于强制设计系统一致性,验证 CSS 变量使用、响应式和无障碍标准合规性。适合组件开发或设计还原阶段,防止硬编码颜色和无效媒体查询。使用时需激活校验规则,自动拦截违规代码模式并提供修正建议。必须使用 CSS 变量替代所有固定值,确保主题切换和跨平台兼容性。

design-system-validator 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/design-system-validator

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/ankish8/storybook-npm --skill 'Design System V…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

design-system-validator 怎么安装?

在终端执行 npx skills add https://github.com/ankish8/storybook-npm --skill 'Design System Validator'。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

design-system-validator 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

design-system-validator 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

design-system-validator 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

design-system-validator 用的人多吗?

公开数据是累计安装 4,293 次,近一周安装 220 次,下载 2,977 次,GitHub 1 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

design-system-validator 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
design-system-validator

设计系统验证器 · 本页

4,2931只读未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Design System Validator Skill

This skill enforces design system consistency by validating CSS variable usage, responsive design patterns, and accessibility standards.

When to Activate

Activate this skill when:

  • Creating a new component
  • Reviewing component code
  • Mapping Figma designs to code
  • Validating color usage
  • Checking responsive patterns
  • Ensuring accessibility compliance

Validation Rules

1. CSS Variable Enforcement

Rule: NEVER use hardcoded color values

Prohibited patterns:

// ❌ WRONG - Hardcoded hex colors
className="bg-[#343E55] text-[#FFFFFF]"

// ❌ WRONG - Hardcoded RGB/HSL
className="bg-[rgb(52,62,85)] text-[hsl(0,0%,100%)]"

// ❌ WRONG - Hardcoded named colors
className="bg-white text-black"

// ❌ WRONG - Hardcoded Tailwind colors
className="bg-gray-50 text-gray-900"

Required patterns:

// ✅ CORRECT - Semantic CSS variables
className="bg-primary text-primary-foreground"
className="bg-semantic-bg-primary text-semantic-text-primary"
className="border-semantic-border-layout"

2. CSS Variable Mapping

Map all colors to appropriate semantic tokens:

Core Tokens (from shadcn/ui)
Color ContextCSS VariableTailwind ClassUsage
Backgrounds
Page background--backgroundbg-backgroundMain page background
Foreground text--foregroundtext-foregroundPrimary text on background
Card background--cardbg-cardRaised surfaces
Card text--card-foregroundtext-card-foregroundText on cards
Popover background--popoverbg-popoverFloating elements
Popover text--popover-foregroundtext-popover-foregroundText on popovers
Actions
Primary background--primarybg-primaryPrimary buttons
Primary text--primary-foregroundtext-primary-foregroundText on primary
Secondary background--secondarybg-secondarySecondary buttons
Secondary text--secondary-foregroundtext-secondary-foregroundText on secondary
Muted background--mutedbg-mutedDisabled states
Muted text--muted-foregroundtext-muted-foregroundMuted/disabled text
Accent background--accentbg-accentAccent highlights
Accent text--accent-foregroundtext-accent-foregroundText on accent
Destructive background--destructivebg-destructiveError/delete actions
Destructive text--destructive-foregroundtext-destructive-foregroundText on destructive
Borders & Inputs
Border color--borderborder-borderStandard borders
Input border--inputborder-inputInput field borders
Ring color--ringring-ringFocus rings
Semantic Tokens (myOperator-specific)
ContextCSS VariableTailwind ClassUsage
Backgrounds
Primary--semantic-bg-primarybg-semantic-bg-primaryComponent backgrounds
Secondary--semantic-bg-secondarybg-semantic-bg-secondaryAlternative backgrounds
Subtle--semantic-bg-subtlebg-semantic-bg-subtleHover/selected states
Text
Primary--semantic-text-primarytext-semantic-text-primaryMain text content
Secondary--semantic-text-secondarytext-semantic-text-secondarySupporting text
Muted--semantic-text-mutedtext-semantic-text-mutedDisabled/placeholder
Link--semantic-text-linktext-semantic-text-linkInteractive links
Borders
Layout--semantic-border-layoutborder-semantic-border-layoutContainer borders
Input--semantic-border-inputborder-semantic-border-inputForm field borders
Focus--semantic-border-focusborder-semantic-border-focusFocus indicators
States
Error primary--semantic-error-primarytext-semantic-error-primaryError messages
Error subtle--semantic-error-subtlebg-semantic-error-subtleError backgrounds
Success primary--semantic-success-primarytext-semantic-success-primarySuccess messages
Success subtle--semantic-success-subtlebg-semantic-success-subtleSuccess backgrounds
Warning primary--semantic-warning-primarytext-semantic-warning-primaryWarning messages
Warning subtle--semantic-warning-subtlebg-semantic-warning-subtleWarning backgrounds
Info
Info primary--semantic-info-primarytext-semantic-info-primaryInformational messages
Info subtle--semantic-info-subtlebg-semantic-info-subtleInformational backgrounds

3. Color Mapping from Figma

When extracting colors from Figma, map them to semantic tokens:

Mapping algorithm:

  1. Identify color purpose from context:

- Button background → bg-primary or bg-secondary - Text color → text-foreground, text-primary-foreground, or semantic text token - Border → border-border, border-input, or semantic border token - Background → bg-background, bg-card, or semantic bg token

  1. Match to existing tokens by usage pattern: Figma: #343E55 (dark blue) → Used for primary button Mapping: bg-primary (primary action color) Figma: #F3F4F6 (light gray) → Used for disabled state Mapping: bg-muted (disabled/inactive state) Figma: #EF4444 (red) → Used for error text Mapping: text-destructive or text-semantic-error-primary

2b. Verify token existence via codebase grep (MANDATORY):

  • Before using any CSS variable token, search src/index.css for the actual variable definition
  • This prevents using tokens that don't exist or have different names than expected
# Verify a semantic token exists
grep "--semantic-success-primary" src/index.css

# If not found, search for alternatives
grep "success" src/index.css
  • Common pitfalls:

- Figma may use naming like "success/primary" but the CSS variable may be --semantic-success-primary or just --success - Info-level tokens (blue/informational) may use --semantic-info-primary — always verify - Some tokens exist in :root (light) but not [data-theme="dark"] (dark) — check both

  • If a required token doesn't exist, document it and use the closest available token
  1. Document custom mappings: If a color doesn't match existing tokens, document it: // Note: Figma uses #4275D6 for links // Mapped to: text-semantic-text-link className="text-semantic-text-link"

4. Responsive Design Validation

Rule: Components must be mobile-first and responsive

Required patterns:

// ✅ CORRECT - Mobile-first responsive padding
className="px-4 py-2 sm:px-6 sm:py-3 lg:px-8 lg:py-4"

// ✅ CORRECT - Responsive text sizes
className="text-sm md:text-base lg:text-lg"

// ✅ CORRECT - Responsive layout
className="flex flex-col sm:flex-row gap-2 sm:gap-4"

// ✅ CORRECT - Responsive visibility
className="hidden md:block"

Breakpoint reference:

  • sm: 640px - Small tablets
  • md: 768px - Tablets
  • lg: 1024px - Laptops
  • xl: 1280px - Desktops
  • 2xl: 1536px - Large desktops

Validation checklist:

  • Padding scales responsively
  • Text sizes adjust for readability
  • Layout adapts for small screens
  • Touch targets are at least 44px on mobile
  • Horizontal scrolling is avoided

5. Typography Validation

Rule: Use semantic typography tokens

// ✅ CORRECT - Semantic font sizes
className="text-sm"      // 14px - Small text, captions
className="text-base"    // 16px - Default body text
className="text-lg"      // 18px - Large body text
className="text-xl"      // 20px - Headings
className="text-2xl"     // 24px - Section headers

// ✅ CORRECT - Font weights
className="font-normal"     // 400 - Body text
className="font-medium"     // 500 - Emphasized text
className="font-semibold"   // 600 - Headings
className="font-bold"       // 700 - Strong emphasis

// ✅ CORRECT - Line heights
className="leading-none"     // 1 - Tight spacing
className="leading-tight"    // 1.25 - Headings
className="leading-normal"   // 1.5 - Body text
className="leading-relaxed"  // 1.625 - Comfortable reading

// ✅ CORRECT - Letter spacing
className="tracking-tight"   // -0.025em
className="tracking-normal"  // 0em
className="tracking-wide"    // 0.025em

Typography table format for Storybook:

## Typography

| Element | Font Size | Line Height | Weight | Letter Spacing |
|---------|-----------|-------------|--------|----------------|
| Title | 16px (`text-base`) | 24px (`leading-6`) | 600 (`font-semibold`) | 0px (`tracking-[0px]`) |
| Description | 14px (`text-sm`) | 20px (`leading-relaxed`) | 400 (`font-normal`) | 0.035px (`tracking-[0.035px]`) |

6. Accessibility Validation

Rule: Components must meet WCAG 2.1 AA standards

Required checks:

Color Contrast:

// ✅ CORRECT - Sufficient contrast
className="bg-primary text-primary-foreground"  // Ensures contrast
className="bg-background text-foreground"       // Theme-aware contrast

// ❌ WRONG - Potentially low contrast
className="bg-gray-100 text-gray-300"  // May fail contrast check

Focus States:

// ✅ CORRECT - Visible focus indicator
className="focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2"

// ✅ CORRECT - Focus-visible for keyboard only
className="focus-visible:ring-2 focus-visible:ring-ring"

Keyboard Navigation:

// ✅ CORRECT - Keyboard accessible
<button onClick={...}>  // Inherently keyboard accessible

// ✅ CORRECT - Custom interactive element with keyboard support
<div role="button" tabIndex={0} onKeyDown={handleKeyPress} onClick={...}>

// ❌ WRONG - Not keyboard accessible
<div onClick={...}>  // Missing role and tabIndex

ARIA Attributes:

// ✅ CORRECT - Proper ARIA labels
<button aria-label="Close dialog">
<input aria-invalid={hasError} aria-describedby="error-message">
<div role="alert" aria-live="polite">

// ✅ CORRECT - Form field associations
<label htmlFor="email">Email</label>
<input id="email" name="email">

Validation Workflow

Step 1: Scan Component Code

Search for prohibited patterns:

# Check for hardcoded hex colors
grep -r "#[0-9A-Fa-f]\{3,6\}" src/components/ui/component.tsx

# Check for RGB/HSL values
grep -r "rgb\|hsl" src/components/ui/component.tsx

# Check for hardcoded Tailwind colors
grep -r "bg-\(gray\|red\|blue\|green\|yellow\)-[0-9]" src/components/ui/component.tsx

Step 2: Map to Semantic Tokens

For each color found, provide mapping:

Found: bg-[#343E55]
Context: Primary button background
Suggested mapping: bg-primary

Found: text-[#FFFFFF]
Context: Text on primary button
Suggested mapping: text-primary-foreground

Found: border-[#E4E4E4]
Context: Container border
Suggested mapping: border-semantic-border-layout

Step 3: Validate Responsive Design

Check for responsive classes:

// Check padding is responsive
✓ Found: px-4 sm:px-6 lg:px-8
✓ Found: py-2 sm:py-3

// Check text sizing is responsive
✓ Found: text-sm md:text-base

// Check layout is responsive
✓ Found: flex-col sm:flex-row

Step 4: Validate Accessibility

// Check focus states
✓ Found: focus:ring-2 focus:ring-ring

// Check ARIA labels
✓ Found: aria-label="Close"

// Check keyboard support
✓ Found: onKeyDown handler for custom interactive element

Step 5: Generate Validation Report

# Design System Validation Report

## CSS Variables
✅ All colors use semantic tokens
- bg-primary, text-primary-foreground
- border-semantic-border-layout
- text-semantic-text-muted

## Responsive Design
✅ Mobile-first breakpoints used
- Padding: px-4 sm:px-6 lg:px-8
- Text: text-sm md:text-base
- Layout: flex-col sm:flex-row

## Typography
✅ Semantic typography tokens
- Font sizes: text-sm, text-base
- Weights: font-normal, font-semibold
- Line heights: leading-normal, leading-relaxed

## Accessibility
✅ WCAG 2.1 AA compliant
- Focus states: focus:ring-2
- ARIA labels: aria-label present
- Keyboard: onKeyDown handlers

## Issues Found
❌ Hardcoded color at line 45: bg-[#F3F4F6]
   Suggested fix: bg-muted

## Recommendations
- Replace bg-[#F3F4F6] with bg-muted
- Add responsive padding to container
- Consider adding aria-describedby for error states

Color Mapping Examples

Example 1: Button Component

Figma Design:

  • Default: #F3F4F6 background, #333333 text
  • Primary: #343E55 background, #FFFFFF text
  • Destructive: #EF4444 background, #FFFFFF text

CSS Variable Mapping:

const buttonVariants = cva(
  "inline-flex items-center justify-center",
  {
    variants: {
      variant: {
        default: "bg-secondary text-secondary-foreground",       // #F3F4F6 → bg-secondary
        primary: "bg-primary text-primary-foreground",           // #343E55 → bg-primary
        destructive: "bg-destructive text-destructive-foreground", // #EF4444 → bg-destructive
      },
    },
  }
)

Example 2: Alert Component

Figma Design:

  • Error: #FEE2E2 background, #B42318 text, #EF4444 border
  • Success: #DCFCE7 background, #15803D text, #22C55E border
  • Warning: #FEF3C7 background, #92400E text, #F59E0B border

CSS Variable Mapping:

const alertVariants = cva(
  "rounded-lg border p-4",
  {
    variants: {
      variant: {
        destructive: "bg-semantic-error-subtle text-semantic-error-primary border-destructive",
        success: "bg-semantic-success-subtle text-semantic-success-primary border-success",
        warning: "bg-semantic-warning-subtle text-semantic-warning-primary border-warning",
      },
    },
  }
)

Example 3: Form Input

Figma Design:

  • Border: #E4E4E4 (normal), #4275D6 (focus), #B42318 (error)
  • Background: #FFFFFF
  • Text: #333333
  • Placeholder: #9CA3AF

CSS Variable Mapping:

const inputVariants = cva(
  "flex h-10 w-full rounded-md px-3 py-2",
  "bg-background text-foreground",                    // Background & text
  "border border-input",                              // Normal border
  "placeholder:text-muted-foreground",                // Placeholder
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", // Focus
  "disabled:cursor-not-allowed disabled:opacity-50",
  {
    variants: {
      state: {
        default: "border-input",
        error: "border-semantic-error-primary",        // Error border
        success: "border-semantic-success-primary",
      },
    },
  }
)

Best Practices

  1. Always use semantic tokens - Enables theme switching (dark mode)
  2. Document color mappings - Help future maintainers understand choices
  3. Validate against Figma - Ensure visual accuracy while using tokens
  4. Test in light/dark themes - Verify color contrast in both modes
  5. Mobile-first responsive - Start with mobile, enhance for larger screens
  6. Accessible by default - Build accessibility in, don't bolt it on

Error Messages

When validation fails, provide specific, actionable feedback:

❌ Hardcoded color detected at line 45

Found:
  className="bg-[#343E55] text-white"

Issue:
  - bg-[#343E55]: Hardcoded hex color
  - text-white: Hardcoded color name

Fix:
  className="bg-primary text-primary-foreground"

Reasoning:
  - #343E55 is the primary brand color → use bg-primary
  - white on primary needs high contrast → use text-primary-foreground
  - Enables automatic theme switching (dark mode)

This skill ensures design system consistency, theme compatibility, and accessibility compliance across all components.

平台分布

Claude

33.75%
按下载量换算1,005

Codex

33%
按下载量换算982

Cursor

18%
按下载量换算536

Gemini CLI

9.9%
按下载量换算295

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills