Token导航 LogoToken导航TokenDH.com
前端设计操作浏览器github未标认证来源可访问许可证需确认审计异常

pixel-perfect-ui像素完美的用户界面

Agent Skill

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

总安装

1,333

周安装

55

GitHub Stars

公开资料未说明

下载量

436
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:pixel-perfect-ui(像素完美的用户界面)
来源仓库:https://github.com/corlab-tech/skills
仓库路径:skills/pixel-perfect-ui
安装命令:
npx skills add https://github.com/corlab-tech/skills --skill pixel-perfect-ui
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/corlab-tech/skills --skill pixel-perfect-ui

简介

pixel-perfect-ui 用于辅助界面设计、视觉规范和交互体验优化,适合生成 UI 方案和检查一致性。

  • 适用于页面结构整理、UI 方案生成和组件层级优化的前端设计场景。
  • 结合品牌和设计系统使用,避免堆砌装饰元素;涉及真实页面时需通过截图或预览检查表现。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装并使用该技能。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Pixel-Perfect UI Implementation

Autonomous workflow for converting Figma designs to production-ready, pixel-perfect React/Next.js implementations with visual validation.

🚀 AUTO-TRIGGER CONDITIONS

This skill MUST be invoked automatically when the user requests ANY of:

  • "implement this Figma design"
  • "build this page/component from Figma"
  • "create from Figma"
  • "implement the design"
  • "build this block/section"
  • "create component matching design"
  • Any request involving Figma URL or node ID
  • Any request to implement a page, block, or component from a design

Prerequisites

  • Figma MCP server connected (for design extraction)
  • Playwright MCP server connected (for visual validation)
  • Next.js or React project initialized

📋 PHASE 0: MANDATORY CHECKLIST CREATION (ALWAYS FIRST)

CRITICAL: Before ANY implementation, you MUST:

Step 0.1: Analyze Design & Identify Sections

First, get the full page/component from Figma and identify ALL sections:

mcp0_get_design_context --nodeId <page-node-id>
mcp0_get_metadata --nodeId <page-node-id>

List all sections/blocks in the design (e.g., Header, Hero, Features, CTA, Footer).

Step 0.2: Create Implementation Checklist File

Create a markdown checklist file at .windsurf/implementation-checklist.md:

# Implementation Checklist: [Component/Page Name]

**Created**: [Date]
**Figma Source**: [URL or Node ID]
**Target Path**: [e.g., src/app/page.tsx or src/components/MyComponent.tsx]
**Status**: 🟡 Pending Approval

---

## 📋 Sections to Implement

[List each section identified from Figma]

1. **Section Name 1** (node-id: xxx)
2. **Section Name 2** (node-id: xxx)
3. **Section Name 3** (node-id: xxx)
...

---

## 🔄 SECTION-BY-SECTION IMPLEMENTATION

> ⚠️ **CRITICAL RULE**: For EACH section below:
> 1. First EXTRACT fresh Figma data for that specific section
> 2. Then IMPLEMENT based on that fresh extraction
> 3. Mark section complete
> 4. Move to next section
>
> **NEVER rely on old/cached Figma data. Always re-extract before implementing!**

---

### Section 1: [Section Name]
**Node ID**: [figma-node-id]
**Status**: ⬜ Not Started

#### 1.1 Extract from Figma
- [ ] mcp0_get_design_context for this section
- [ ] mcp0_get_screenshot for visual reference
- [ ] Export any images/assets needed
- [ ] Note typography, colors, spacing

#### 1.2 Implement
- [ ] Create/update component structure
- [ ] Implement desktop layout (1440px)
- [ ] Implement tablet layout (768px)
- [ ] Implement mobile layout (375px)
- [ ] Add images with Next.js Image
- [ ] Apply styles (typography, colors, spacing)

#### 1.3 Validate
- [ ] Visual check matches Figma
- [ ] Responsive on all viewports
- [ ] No horizontal scroll

✅ **Section 1 Complete**: [ ]

---

### Section 2: [Section Name]
**Node ID**: [figma-node-id]
**Status**: ⬜ Not Started

#### 2.1 Extract from Figma
- [ ] mcp0_get_design_context for this section
- [ ] mcp0_get_screenshot for visual reference
- [ ] Export any images/assets needed
- [ ] Note typography, colors, spacing

#### 2.2 Implement
- [ ] Create/update component structure
- [ ] Implement desktop layout (1440px)
- [ ] Implement tablet layout (768px)
- [ ] Implement mobile layout (375px)
- [ ] Add images with Next.js Image
- [ ] Apply styles (typography, colors, spacing)

#### 2.3 Validate
- [ ] Visual check matches Figma
- [ ] Responsive on all viewports
- [ ] No horizontal scroll

✅ **Section 2 Complete**: [ ]

---

[Repeat for each section...]

---

## 🏁 Final Validation

- [ ] All sections implemented
- [ ] Full page visual comparison
- [ ] Resource validation passed (no broken links/images)
- [ ] Production checklist complete

---

## 📝 Notes

[Add any specific notes here]

---

## ✅ Completion Summary

**Completed**: [Date when finished]
**Final Status**: [Pending/Complete]

Step 0.3: Present Plan to User

After creating the checklist, ALWAYS:

  1. Display the plan to the user in chat (show all identified sections)
  2. Ask for confirmation: "I've created the implementation checklist at .windsurf/implementation-checklist.md with X sections. Should I proceed?"
  3. WAIT for user approval before proceeding

Step 0.4: Execute Section-by-Section

FOR EACH SECTION (in order):

┌─────────────────────────────────────────────────────┐
│  SECTION WORKFLOW (repeat for each section)         │
├─────────────────────────────────────────────────────┤
│  1. 📥 EXTRACT: Get fresh Figma data for section    │
│     - mcp0_get_design_context --nodeId <section-id> │
│     - mcp0_get_screenshot --nodeId <section-id>     │
│     - Export images if needed                       │
│                                                     │
│  2. 🔨 IMPLEMENT: Build based on fresh extraction   │
│     - Use the data you JUST extracted               │
│     - Do NOT use old/cached data                    │
│     - Implement responsive (desktop→tablet→mobile)  │
│                                                     │
│  3. ✅ VALIDATE: Check section matches Figma        │
│                                                     │
│  4. 📝 UPDATE CHECKLIST: Mark items [x] complete    │
│                                                     │
│  5. ➡️ MOVE TO NEXT SECTION                         │
└─────────────────────────────────────────────────────┘

CRITICAL:

  • Do NOT batch extract all sections at once
  • Do NOT implement from memory or old data
  • ALWAYS re-extract Figma data immediately before implementing each section
  • Update checklist after completing each section

Step 0.5: Track Progress

As you complete each section:

  1. Update the checklist file - Change - [] to - [x] for completed items
  2. Update section status: ⬜ Not Started → 🔵 In Progress → ✅ Complete
  3. Update overall Status field:

- 🟡 Pending Approval - 🔵 In Progress - Section X of Y - 🟢 Complete - 🔴 Blocked (with reason)


🚨 CRITICAL PRODUCTION RULES

Mobile-First Responsive Design (MANDATORY)

  • NEVER use hardcoded pixel widths (e.g., w-[1728px], width: 1728px)
  • ALWAYS use responsive units: max-w-7xl, percentages, or viewport units
  • ALWAYS test on mobile viewports (375px, 768px, 1024px, 1440px)
  • NO horizontal scroll - Use overflow-x-hidden on body if needed
  • Container pattern: Use max-w-[size] mx-auto px-4 sm:px-6 lg:px-8

Image Requirements (MANDATORY)

  • EXPORT all images from Figma - Never use placeholder paths
  • CHECK image existence before referencing
  • USE Next.js Image component with proper dimensions
  • PROVIDE fallbacks for missing images
  • OPTIMIZE images - WebP format preferred

Production Checklist (MUST COMPLETE)

  • All viewports tested (mobile, tablet, desktop)
  • No horizontal scroll on any device
  • All images exported and accessible
  • Touch targets minimum 44x44px on mobile
  • Text readable without zooming
  • Interactive elements have hover/focus states
  • Loading states implemented
  • Error boundaries added
  • Resource validation passed (no broken links/images)

Core Workflow

⚠️ REMINDER: Always complete Phase 0 (Checklist Creation) before starting these steps!

1. Design Extraction

Extract comprehensive design data from Figma:

# Get design context and code
mcp0_get_design_context --nodeId <node-id>
mcp0_get_variable_defs --nodeId <node-id>
mcp0_get_screenshot --nodeId <node-id>

Parse extracted data for:

  • Typography (font-family, size, weight, line-height, letter-spacing)
  • Colors (hex values, opacity)
  • Spacing (padding, margin, gap)
  • Layout (flexbox/grid properties, alignment)
  • Borders, shadows, radius values
  • Asset URLs and SVG exports

2. Project Analysis

Detect project configuration:

  • Framework: Next.js App Router vs Pages Router
  • Styling: Tailwind, CSS Modules, styled-components
  • Component library: shadcn/ui, MUI, Radix
  • Design tokens location: tailwind.config, theme.ts

Map Figma tokens to existing project tokens.

3. Implementation

Generate component with extracted values:

// For complex layouts, use references/layout-patterns.md
// For component patterns, use references/component-patterns.md
// For responsive patterns, use references/responsive-patterns.md

STRICT Implementation Rules:

  • FORBIDDEN: Hardcoded widths like w-[1728px], width: 1728px
  • REQUIRED: Responsive containers max-w-7xl mx-auto px-4
  • REQUIRED: Mobile-first breakpoints sm:, md:, lg:, xl:
  • REQUIRED: Export and validate all images from Figma
  • REQUIRED: Flexible layouts using Flexbox/Grid
  • REQUIRED: Test on 375px, 768px, 1024px, 1440px viewports

Image Handling:

// 1. Export from Figma
mcp0_get_screenshot --nodeId <id> --filename "hero-image.png"

// 2. Save to public/assets/
// 3. Use with Next Image
<Image src="/assets/hero-image.png" alt="..." width={...} height={...} />

4. Multi-Device Validation Loop

Mandatory: Run validation on ALL viewports:

# Desktop validation
python scripts/visual-compare.py --viewport 1440x900

# Tablet validation
python scripts/visual-compare.py --viewport 768x1024

# Mobile validation (CRITICAL)
python scripts/visual-compare.py --viewport 375x667

# Responsive issues check
python scripts/responsive-validation.py --url <url>

# Resource validation (CRITICAL - Run before deployment)
python scripts/resource-validator.py --directory src/app --strict

Validation Requirements:

  • ✅ No horizontal scroll on any viewport
  • ✅ All images loading correctly (verified by resource-validator.py)
  • ✅ No broken links or missing resources
  • ✅ No placeholder content (lorem ipsum, temp images)
  • ✅ Touch targets ≥ 44x44px on mobile
  • ✅ Text legible without zooming
  • ✅ Proper stacking on mobile (no overlaps)
  • ✅ Interactive elements accessible

Common Failures to Fix:

  • ❌ Hardcoded widths causing overflow
  • ❌ Missing or broken images (detected by resource-validator.py)
  • ❌ Broken internal/external links
  • ❌ Placeholder content (lorem ipsum, temp images)
  • ❌ External dependencies not cached locally
  • ❌ Text too small on mobile (<14px)
  • ❌ Elements overlapping on small screens
  • ❌ Fixed positioning breaking on mobile

5. Responsive Implementation

Extract breakpoint variations from Figma:

  • Desktop (1440px)
  • Tablet (768px)
  • Mobile (375px)

Apply responsive rules using project's breakpoint system.

Quick Commands

Full page implementation:

python scripts/extract-and-implement.py --figma-url <url> --output-path <path>

Component extraction:

python scripts/extract-component.py --node-id <id> --component-name <name>

Visual validation:

python scripts/visual-compare.py --implementation-url <url> --figma-node <id>

Resource validation (broken links, missing images):

# Validate single file
python scripts/resource-validator.py --file src/app/page.tsx

# Validate entire app (REQUIRED before production)
python scripts/resource-validator.py --directory src/app --strict --report validation-report.txt

File Organization

  • Pages: Follow project routing convention

- App Router: app/[route]/page.tsx - Pages Router: pages/[route].tsx

  • Components: components/ui/[component].tsx
  • Assets: public/assets/ or src/assets/
  • Styles: Co-located or in styles/

Token Mapping

See references/token-mapping.md for:

  • Figma → Tailwind mapping
  • Figma → CSS variables mapping
  • Shadow and gradient conversion
  • Typography scale mapping

Component Patterns

See references/component-patterns.md for:

  • Card layouts
  • Navigation patterns
  • Form components
  • Modal implementations
  • Grid systems

Validation Thresholds

Acceptable differences:

  • Font kerning: ±2px
  • Line height: ±1px
  • Anti-aliasing variations

Must match exactly:

  • Colors (hex values)
  • Border radius
  • Spacing values
  • Component dimensions
  • Shadow properties

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

34.42%
按下载量换算150

Claude

28.75%
按下载量换算125

Cursor

18.31%
按下载量换算80

Gemini CLI

10.64%
按下载量换算46

安全审计

Gen Agent Trust Hub

未通过

Socket

可疑

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

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

来源信息

继续浏览同类 Skills