Ui Analyzer 标志

Ui Analyzer

社区
smallnest
ui-analyzer

分析 UI 设计截图,并使用 TypeScript 和 Tailwind CSS 生成 React 组件。当用户提供 UI 线框图、设计截图或 Figma 导出文件并要求实现时,使用此技能。提供详细的布局分析、组件拆解和设计 Token 提取,并遵循最佳实践生成可用于生产环境的代码。

Add to TypingMind

概览

发布者smallnest
代码仓库langgraphgo
技能名称ui-analyzer
星标数
304
复刻数
51
附带文件
3
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 3 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 smallnest 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Ui Analyzer AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/smallnest/langgraphgo/tree/master/testdata/skills/ui-analyzer
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/smallnest/langgraphgo.git /tmp/langgraphgo
mkdir -p .claude/skills
cp -r /tmp/langgraphgo/testdata/skills/ui-analyzer .claude/skills/ui-analyzer
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Ui Analyzer,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Ui Analyzer。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Ui Analyzer 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

UI Analyzer

This skill provides a systematic approach to analyzing UI design screenshots and translating them into production-ready React components using TypeScript and Tailwind CSS.

Purpose

Transform UI design screenshots into well-structured, accessible, and maintainable React components. The skill guides through analyzing layouts, extracting design tokens, identifying components, and generating clean code that matches the design while following best practices.

When to Use This Skill

Use this skill when:

  • The user provides a UI design screenshot, mockup, or Figma export
  • The user requests "implement this design" or "build this UI"
  • The user asks to "analyze this screenshot"
  • The user wants to convert a design to code
  • The user needs help understanding a UI's structure
  • The user requests matching an existing design

Analysis Workflow

Follow these steps systematically when analyzing a UI screenshot:

Step 1: Initial Observation and Screenshot Reading

Read the provided screenshot first using the Read tool if a file path is provided, or if the user has shared an image in the conversation.

After viewing the screenshot:

  1. Describe what you see in the UI
  2. Identify the screen/page type (login, dashboard, form, etc.)
  3. Determine the target device (desktop, mobile, responsive)
  4. Note the overall aesthetic (modern, minimal, colorful, etc.)
  5. Confirm understanding with the user before proceeding

Step 2: Layout Analysis

Identify the high-level layout structure:

  1. Main layout type - Consult references/layout-patterns.md to identify:

    • Single column
    • Sidebar layout
    • Header + content
    • Grid layout
    • Split screen
    • Dashboard
    • Master-detail
    • Other patterns
  2. Layout hierarchy - Break down into sections:

    • Header/navigation
    • Main content area
    • Sidebar (if present)
    • Footer (if present)
    • Nested structures
  3. Responsive considerations:

    • How should layout adapt to mobile?
    • Which elements stack or hide?
    • Breakpoint strategy

Reference references/layout-patterns.md for Tailwind implementation patterns.

Step 3: Component Identification

Systematically identify all UI components using references/ui-analysis-checklist.md:

Navigation Components:

  • Top nav, sidebar nav, breadcrumbs, tabs, etc.

Data Display Components:

  • Cards, tables, lists, stats, badges, avatars, icons, etc.

Input Components:

  • Text inputs, selects, checkboxes, radios, switches, date pickers, etc.

Action Components:

  • Buttons (primary, secondary, etc.), icon buttons, links, etc.

Feedback Components:

  • Alerts, toasts, progress bars, loading states, etc.

Overlay Components:

  • Modals, drawers, tooltips, popovers, dropdowns, etc.

List all identified components with:

  • Component type and purpose
  • Location in the layout
  • Approximate size and styling
  • Interactive states (if visible)

Step 4: Design Token Extraction

Extract design system values using references/design-tokens.md:

Color Palette:

  1. Identify all unique colors in the design
  2. Categorize by usage:
    • Primary brand color
    • Secondary/accent colors
    • Background colors (main, secondary)
    • Text colors (primary, secondary, muted)
    • Border colors
    • State colors (success, warning, error, info)
  3. Map each color to nearest Tailwind color or note custom color needed
  4. Create a color reference table

Typography:

  1. Identify font family (serif, sans-serif, monospace)
  2. List all text sizes observed
  3. Map to Tailwind typography scale (text-xs to text-6xl)
  4. Note font weights used (normal, medium, semibold, bold)
  5. Identify heading hierarchy (H1-H6)

Spacing:

  1. Observe padding patterns (card padding, button padding, etc.)
  2. Observe margin/gap patterns (between sections, between items)
  3. Map to Tailwind spacing scale (p-4, m-6, gap-8, etc.)
  4. Note the spacing unit (usually 4px or 8px base)

Other Tokens:

  • Border radius (rounded-none to rounded-full)
  • Shadows (shadow-sm to shadow-2xl)
  • Border widths
  • Icon sizes

Reference references/design-tokens.md for complete mapping tables.

Step 5: Detailed Component Analysis

For each major component identified:

  1. Component boundaries - Where does it start/end?
  2. Props/data - What data does it receive?
  3. Internal structure - Sub-components and elements
  4. Styling details:
    • Background color
    • Text color and size
    • Padding and margins
    • Border and radius
    • Shadow
  5. Interactive states (if visible or inferable):
    • Hover
    • Active/pressed
    • Focused
    • Disabled
    • Loading
    • Error
  6. Accessibility needs:
    • ARIA labels
    • Semantic HTML
    • Keyboard navigation

Step 6: Implementation Strategy

Plan the implementation approach:

  1. Component hierarchy - Which components to build first?
  2. Reusability - Which patterns repeat? Extract to reusable components
  3. State management - Does any component need Zustand or just local state?
  4. Integration with react-component-generator - Can existing templates be used?
  5. File structure - Where should components live?

If the react-component-generator skill is available:

  • Reference its templates for common components (forms, cards, buttons, modals, etc.)
  • Use its best practices for component structure
  • Follow its naming conventions

Step 7: Code Generation

Generate React components following these principles:

Structure:

  1. Start with TypeScript interfaces for props
  2. Use functional components with React.FC
  3. Include JSDoc comments
  4. Export both named and default exports

Styling:

  1. Use Tailwind CSS exclusively for styling
  2. Apply extracted design tokens
  3. Organize classes logically (layout → spacing → colors → effects → states)
  4. Use responsive classes where needed (sm:, md:, lg:, xl:)

Best Practices:

  1. Use semantic HTML elements
  2. Include ARIA attributes for accessibility
  3. Handle loading and error states
  4. Support keyboard navigation
  5. Use proper TypeScript types (no any)
  6. Keep components focused and composable

Example Component Template:

tsx
import React from 'react';

interface ComponentNameProps {
  // Props based on analysis
  title: string;
  description?: string;
  onClick?: () => void;
  className?: string;
}

/**
 * ComponentName - Brief description based on UI purpose
 *
 * @param props - Component props
 * @returns JSX.Element
 */
export const ComponentName: React.FC<ComponentNameProps> = ({
  title,
  description,
  onClick,
  className = ''
}) => {
  return (
    <div className={`/* Tailwind classes from design */ ${className}`}>
      {/* Implementation based on screenshot */}
    </div>
  );
};

export default ComponentName;

Step 8: Verification and Refinement

After generating code:

  1. Review against screenshot - Does it match the design?
  2. Check responsiveness - Will it work on different screen sizes?
  3. Verify accessibility - Are ARIA labels and semantic HTML present?
  4. Validate design tokens - Are colors, spacing, typography correct?
  5. Consider edge cases - Long text, empty states, loading states
  6. Note assumptions - Clearly state what was assumed vs confirmed

Step 9: Deliverables

Provide the user with:

  1. Analysis Summary:

    • Layout description
    • Component breakdown
    • Design tokens extracted
  2. Generated Code:

    • Complete React component(s)
    • TypeScript interfaces
    • Tailwind classes applied
  3. Implementation Notes:

    • Installation requirements (if any packages needed)
    • Usage examples
    • Customization suggestions
    • Responsive behavior notes
  4. Next Steps:

    • Suggest improvements or variations
    • Note areas that might need refinement
    • Offer to generate additional related components

Common Scenarios

Scenario 1: Simple Form Screenshot

User: "Implement this login form design [screenshot]"

Approach:

  1. Read screenshot
  2. Identify: Centered card layout with form inputs and button
  3. Extract: Colors, input styling, button styling, spacing
  4. Reference layout-patterns.md → "Centered Modal/Card" pattern
  5. Reference react-component-generator → FormComponent template
  6. Generate: LoginForm.tsx with proper validation structure
  7. Apply Tailwind classes matching the design

Scenario 2: Dashboard Screenshot

User: "Build this dashboard UI [screenshot]"

Approach:

  1. Read screenshot
  2. Identify: Header + sidebar layout with grid of stat cards
  3. Break down into components:
    • Header component
    • Sidebar navigation
    • StatCard component (repeated)
    • Main dashboard layout
  4. Extract design tokens for consistency
  5. Reference layout-patterns.md → "Dashboard Layout" pattern
  6. Generate components starting with reusable StatCard
  7. Compose into main Dashboard component

Scenario 3: Complex Page with Multiple Sections

User: "Implement this landing page [screenshot]"

Approach:

  1. Read screenshot
  2. Identify sections: Hero, features grid, testimonials, CTA
  3. Analyze each section separately using checklist
  4. Extract shared design tokens
  5. Generate section components one by one
  6. Show how sections compose into the full page
  7. Provide responsive behavior notes

Scenario 4: Component Library Screenshot

User: "Create components from this design system screenshot [screenshot]"

Approach:

  1. Read screenshot
  2. Identify: Multiple variations of buttons, inputs, cards shown
  3. Extract design tokens for the system
  4. Generate each component variant
  5. Document the prop variations
  6. Create a usage guide
  7. Suggest how to organize in the project

Reference Files Usage

references/ui-analysis-checklist.md

  • When to use: During Step 3 (Component Identification) and as a comprehensive analysis guide
  • Purpose: Ensures no components or details are missed
  • How: Work through checklist sections systematically

references/layout-patterns.md

  • When to use: During Step 2 (Layout Analysis) and Step 7 (Code Generation)
  • Purpose: Quickly identify common patterns and get implementation code
  • How: Match observed layout to pattern, adapt provided code

references/design-tokens.md

  • When to use: During Step 4 (Design Token Extraction) and Step 7 (Code Generation)
  • Purpose: Map visual elements to Tailwind classes accurately
  • How: Use color tables, spacing scale, and component size guides

Tips for Accurate Analysis

  1. Be systematic - Follow the workflow steps in order, don't skip ahead
  2. Take measurements - Estimate sizes and spacing carefully
  3. Look for patterns - Repeated elements indicate design system consistency
  4. Note uncertainties - Clearly mark assumptions vs confirmed details
  5. Think responsive - Always consider mobile behavior
  6. Prioritize accessibility - Include ARIA labels and semantic HTML from the start
  7. Stay DRY - Extract reusable components when patterns repeat
  8. Consult references - Use the reference files liberally for accuracy
  9. Verify with user - Confirm understanding before extensive code generation
  10. Iterate - Expect refinement based on user feedback

Integration with Other Skills

With react-component-generator skill

When both skills are available:

  1. Use ui-analyzer to understand the design and extract requirements
  2. Reference react-component-generator templates for similar components
  3. Apply ui-analyzer's extracted design tokens to the templates
  4. Follow react-component-generator's naming and structure conventions

This creates a powerful workflow: analyze → identify template → customize → implement.

Example Full Workflow

User provides login page screenshot

  1. ✅ Read screenshot and describe the UI
  2. ✅ Identify: Centered card layout, split-screen with image
  3. ✅ Extract design tokens:
    • Primary blue: #3B82F6 → bg-blue-500
    • Text: #1F2937 → text-gray-800
    • Background: #F9FAFB → bg-gray-50
    • Card padding: ~32px → p-8
    • Input height: ~40px → h-10
    • Button: blue background, white text, rounded-md
  4. ✅ Identify components:
    • Logo/brand element
    • Heading and subheading
    • Email input (with label)
    • Password input (with label, show/hide icon)
    • "Remember me" checkbox
    • "Forgot password?" link
    • Submit button
    • Sign up link at bottom
  5. ✅ Reference layout-patterns.md → Split Screen + Centered Card patterns
  6. ✅ Generate LoginForm.tsx:
    • TypeScript interfaces for props
    • Form validation structure
    • Tailwind classes matching design
    • Accessibility attributes
    • Responsive behavior (stacked on mobile)
  7. ✅ Provide usage example and notes
  8. ✅ Offer to generate the accompanying image section or adjust styling

Notes

  • Always read the screenshot first before any analysis
  • Prioritize user confirmation of understanding before extensive code generation
  • When in doubt about colors or spacing, choose the closest Tailwind default
  • Document all assumptions clearly
  • Provide complete, runnable code, not pseudocode
  • Consider suggesting improvements while matching the design
  • Be prepared to iterate based on user feedback

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Ui Analyzer AI 技能有什么作用?

分析 UI 设计截图,并使用 TypeScript 和 Tailwind CSS 生成 React 组件。当用户提供 UI 线框图、设计截图或 Figma 导出文件并要求实现时,使用此技能。提供详细的布局分析、组件拆解和设计 Token 提取,并遵循最佳实践生成可用于生产环境的代码。

为什么在 TypingMind 中使用 Ui Analyzer?

因为您只需安装一次,就能搭配任何模型使用。Ui Analyzer 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Ui Analyzer?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/smallnest/langgraphgo/tree/master/testdata/skills/ui-analyzer。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Ui Analyzer?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Ui Analyzer 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Ui Analyzer 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Ui Analyzer AI 技能免费吗?

是的。smallnest 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇