Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

figma-to-design-auditFigma TO 设计审核

Agent Skill

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

总安装

312

周安装

13

GitHub Stars

公开资料未说明

下载量

104
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:figma-to-design-audit(Figma TO 设计审核)
来源仓库:https://github.com/codestate-cs/figma-to-design
仓库路径:skills/figma-to-design-audit
安装命令:
npx skills add https://github.com/codestate-cs/figma-to-design --skill figma-to-design-audit
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/codestate-cs/figma-to-design --skill figma-to-design-audit

简介

用于优化界面设计、视觉规范、排版、配色、布局和交互体验。

  • 可整理页面结构、生成 UI 方案或检查视觉一致性,改进组件层级。
  • 需结合品牌、设计系统和用户任务,避免堆砌装饰元素;改动后应通过截图或浏览器预览检查表现。
  • 安装命令:npx skills add https://github.com/codestate-cs/figma-to-design --skill figma-to-design-audit
  • 适用于 Codex、Claude、Cursor、Gemini CLI,需授权访问 Figma 文件。

SKILL.md

Design Token Drift Audit

You are auditing this project's codebase to find violations of the design system. Your job is to detect hardcoded values that should use design tokens, find unused tokens, and report components that bypass the design system.


Pre-flight Check

  1. Check that .claude/design-tokens/design-tokens.json exists. If it doesn't, tell the user to run /figma-to-design-init first and stop.
  2. Read .claude/design-tokens/design-tokens.json fully into context.

Audit 1: Hardcoded Values That Should Be Tokens

Scan all React/Next.js source files (.tsx, .jsx, .ts, .js) and style files (.css, .scss, .module.css, .module.scss) for hardcoded values that exist in the design tokens or should be using them.

Colors

  • Search for raw hex colors (#[0-9a-fA-F]{3,8}), rgb(, rgba(, hsl(, hsla( in component files and style files.
  • Exclude: SVG files, image assets, config files (tailwind.config.*, postcss.config.*), node_modules, .next, test files.
  • Color comparison rule (exact match only): Convert all found colors to lowercase 6-digit hex before comparison. Convert rgb() and hsl() values to hex. A match is exact hex equality only — no fuzzy matching, no "near-equivalent" matching.
  • For each hardcoded color found, check if it exactly matches any value in design-tokens.jsoncolors. If yes, label it definite — this value should use the token.
  • Also flag colors that do NOT exactly match any token value — label these undocumented.

Spacing

  • Search for hardcoded pixel values in padding, margin, gap, width, height properties: padding: 16px, margin: 24px, gap: 8px, p-[16px], m-[24px], etc.
  • In Tailwind projects, look for arbitrary value brackets: p-[...], m-[...], gap-[...], w-[...], h-[...] with pixel values that match the spacing scale.
  • Flag values that match the spacing scale but use raw numbers instead of tokens.

Typography

  • Search for hardcoded font sizes: font-size: 14px, text-[14px], etc.
  • Search for hardcoded font weights: font-weight: 600, font-[600], etc.
  • Search for hardcoded line heights in style declarations.
  • Flag values that match the typography scale but use raw numbers instead of tokens.

Shadows & Borders

  • Search for hardcoded box-shadow values and border-radius values.
  • Flag values that match tokens but are hardcoded.

Audit 2: Unused Tokens

Check each token defined in design-tokens.json to see if it's actually used in the codebase.

Search patterns by styling approach (deterministic):

  • For Tailwind projects — color tokens: Search for each color token name prefixed with bg-, text-, border-, ring-, fill-, stroke-, decoration-, accent-, outline-, shadow-. A color token is "used" if ANY of these prefixed forms appear in source files.
  • For Tailwind projects — spacing tokens: Search for each spacing token name prefixed with p-, px-, py-, pt-, pr-, pb-, pl-, m-, mx-, my-, mt-, mr-, mb-, ml-, gap-, gap-x-, gap-y-, w-, h-, space-x-, space-y-, inset-, top-, right-, bottom-, left-. A spacing token is "used" if ANY of these prefixed forms appear.
  • For Tailwind projects — typography tokens: Search for font family with font-, font size with text-, font weight with font-, line height with leading-.
  • For Tailwind projects — shadow tokens: Search with shadow- prefix.
  • For Tailwind projects — border tokens: Search with rounded- and border- prefixes.
  • For CSS variable projects: Search for var(--token-name) usage. Exact string match.
  • For CSS-in-JS projects: Search for theme.colors.tokenName, theme.spacing.tokenName, etc. Exact property path match.

Report tokens that exist in the token file but have zero references in the codebase. Label each as:

  • unused — zero matches found across all search patterns
  • build-only — if the token appears only in files under .next/, dist/, or build/ (false positive — note this)

Audit 3: Component Reuse Violations

Check if page-level files use raw HTML elements instead of existing reusable components.

Detection method (deterministic):

  1. Search for raw HTML elements (<button, <input, <select, <textarea, <dialog, <table) in files under app/ and src/pages/ (page-level files only, NOT files inside component directories).
  2. For each raw HTML element found, check if a corresponding component exists in the components array of design-tokens.json. Match by element type to component name:

- <button → any component with button (case-insensitive) in its name - <input → any component with input or textfield in its name - <select → any component with select or dropdown in its name - <textarea → any component with textarea in its name - <dialog → any component with dialog or modal in its name - <table → any component with table in its name

  1. If a raw element is found AND a matching component exists, flag it as a violation.
  2. Do NOT flag raw elements in component files themselves (they are the implementation).

Audit 4: Preferred Library Violations (if applicable)

If preferred_libraries exists in design-tokens.json:

4a: Data fetching violations. If preferred_libraries.data_fetching exists, check that components use the selected data fetching library, not alternatives:

  • If selected is @tanstack/react-query but a component uses raw fetch or useEffect + useState for data fetching, flag it.
  • If selected is @tanstack/react-query but a component imports swr, flag it.
  • If selected is axios but a component uses raw fetch, flag it.
  • Check for missing error handling on API calls (no onError, no .catch(), no error state).
  • Check for missing loading states on API calls.

4b: Other library category violations. For each category in preferred_libraries where installed has more than 1 entry, check that source files use the selected library and not a non-selected alternative:

  • If dates.selected is date-fns but a file imports moment, flag it.
  • If forms.selected is react-hook-form but a file imports formik, flag it.
  • Apply the same check for all categories with competing libraries.

Detection method: For each non-selected library in a category, grep for its import statement (import... from '<package>' or require('<package>')). Any match in source files (excluding node_modules, config files, and lock files) is a violation.


Report Format

Present the audit results as a structured report:

## Design Token Drift Audit Report

### Hardcoded Values Found
| File | Line | Value | Should Be | Token Name |
|------|------|-------|-----------|------------|
| src/components/Header.tsx | 42 | #3B82F6 | Token | primary |
| src/app/dashboard/page.tsx | 87 | padding: 24px | Token | spacing-6 |

**Total: X hardcoded values across Y files**

### Unused Tokens
| Token | Category | Defined Value |
|-------|----------|---------------|
| warning | colors | #F59E0B |

**Total: X unused tokens**

### Component Reuse Violations
| File | Line | Issue | Suggested Component |
|------|------|-------|-------------------|
| src/app/settings/page.tsx | 23 | Inline button styling | Use Button component |

**Total: X potential violations**

### Preferred Library Violations (if applicable)
| File | Line | Issue | Category | Selected | Used Instead |
|------|------|-------|----------|----------|-------------|
| src/app/users/page.tsx | 15 | Uses raw fetch | data_fetching | @tanstack/react-query | fetch |
| src/utils/format.ts | 8 | Imports moment | dates | date-fns | moment |

**Total: X library violations**

### Summary
- Hardcoded values: X (Y are direct token matches, Z are new/undocumented)
- Unused tokens: X
- Component reuse violations: X
- Preferred library violations: X
- **Design system adherence score: X/100**

Calculate the adherence score as: 100 - (total_violations * penalty) where each hardcoded value = -1 point, each unused token = -0.5 points, each component violation = -2 points, each library violation = -2 points. Floor at 0, cap at 100.


Important Rules

  • Only scan source files. Skip node_modules, .next, dist, build, coverage, test files (*.test.*, *.spec.*, __tests__/), and config files (*.config.*, postcss.*).
  • Flag ALL matches from regex scans. Label each as either definite (the hardcoded value exactly matches a token value) or undocumented (the hardcoded value has no matching token). Do not skip any regex match. Do not use subjective confidence — every match is either exact-match or not.
  • Do not modify any files. This is a read-only audit.
  • If the project is small (< 10 source files), say so and note that the audit may be less meaningful.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.88%
按下载量换算39

Claude

31.01%
按下载量换算32

Cursor

17.85%
按下载量换算19

Gemini CLI

9.63%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

来源信息

继续浏览同类 Skills