Figma Design Analysis & Export
Professional-grade Figma integration for design system analysis, asset export, and comprehensive design auditing.
Core Capabilities
1. File Operations & Analysis
- - File inspection: Get complete JSON representation of any Figma file
- Component extraction: List all components, styles, and design tokens
- Asset export: Batch export frames, components, or specific nodes as PNG/SVG/PDF
- Version management: Access specific file versions and branch information
Example usage:
- - "Export all components from this design system file"
- "Get the JSON data for these specific frames"
- "Show me all the colors and typography used in this file"
2. Design System Management
- - Style auditing: Analyze color usage, typography consistency, spacing patterns
- Component analysis: Identify unused components, measure usage patterns
- Brand compliance: Check adherence to brand guidelines across files
- Design token extraction: Generate CSS/JSON design tokens from Figma styles
Example usage:
- - "Audit this design system for accessibility issues"
- "Generate CSS custom properties from these Figma styles"
- "Find all inconsistencies in our component library"
3. Bulk Asset Export
- - Multi-format exports: Export assets as PNG, SVG, PDF, or WEBP
- Platform-specific sizing: Generate @1x, @2x, @3x assets for iOS/Android
- Organized output: Automatic folder organization by format or platform
- Client packages: Complete deliverable packages with documentation
Example usage:
- - "Export all components in PNG and SVG formats"
- "Generate complete asset package for mobile app development"
- "Create client deliverable with all marketing assets"
4. Accessibility & Quality Analysis
- - Contrast checking: Verify WCAG color contrast requirements
- Font size analysis: Ensure readable typography scales
- Interactive element sizing: Check touch target requirements
- Focus state validation: Verify keyboard navigation patterns
Example usage:
- - "Check this design for WCAG AA compliance"
- "Analyze touch targets for mobile usability"
- "Generate an accessibility report for this app design"
Quick Start
Authentication Setup
CODEBLOCK0
Basic Operations
CODEBLOCK1
Workflow Patterns
Design System Audit Workflow
- 1. Extract file data → Get components, styles, and structure
- Analyze consistency → Check for style variations and unused elements
- Generate report → Create detailed findings and recommendations
- Manual implementation → Use findings to guide design improvements
Asset Export Workflow
- 1. Identify export targets → Specify frames, components, or nodes
- Configure export settings → Set formats, sizes, and naming conventions
- Batch process → Export multiple assets simultaneously
- Organize output → Structure files for handoff or implementation
Analysis & Documentation Workflow
- 1. Extract design data → Pull components, styles, and design tokens
- Audit compliance → Check accessibility and brand consistency
- Generate documentation → Create style guides and component specs
- Export deliverables → Package assets for development or client handoff
Resources
scripts/
- -
figma_client.py - Complete Figma API wrapper with all REST endpoints - INLINECODE1 - Professional asset export with multiple formats and scales
- INLINECODE2 - Design system analysis and brand consistency checking
- INLINECODE3 - Comprehensive WCAG compliance validation and reporting
references/
- -
figma-api-reference.md - Complete API documentation and examples - INLINECODE5 - UI patterns and component best practices
- INLINECODE6 - WCAG compliance requirements
- INLINECODE7 - Asset export options and specifications
assets/
- -
templates/design-system/ - Pre-built component library templates - INLINECODE9 - Standard brand guideline structures
- INLINECODE10 - Common layout patterns and flows
Integration Examples
With Development Workflows
CODEBLOCK2
With Brand Management
CODEBLOCK3
With Client Deliverables
CODEBLOCK4
Limitations & Scope
Read-Only Operations
This skill provides
read-only access to Figma files through the REST API. It can:
- - ✅ Extract data, components, and styles
- ✅ Export assets in multiple formats
- ✅ Analyze and audit design files
- ✅ Generate comprehensive reports
What It Cannot Do
- - ❌ Modify existing files (colors, text, components)
- ❌ Create new designs or components
- ❌ Batch update multiple files
- ❌ Real-time collaboration features
For file modifications, you would need to develop a Figma plugin using the Plugin API.
Technical Features
API Rate Limiting
Built-in rate limiting and retry logic to handle Figma's API constraints gracefully.
Error Handling
Comprehensive error handling with detailed logging and recovery suggestions.
Multi-Format Support
Export assets in PNG, SVG, PDF, and WEBP with platform-specific sizing.
Figma 设计分析与导出
专业级 Figma 集成,用于设计系统分析、资源导出和全面设计审计。
核心能力
1. 文件操作与分析
- - 文件检查:获取任意 Figma 文件的完整 JSON 表示
- 组件提取:列出所有组件、样式和设计令牌
- 资源导出:批量导出画板、组件或特定节点为 PNG/SVG/PDF 格式
- 版本管理:访问特定文件版本和分支信息
使用示例:
- - 从该设计系统文件中导出所有组件
- 获取这些特定画板的 JSON 数据
- 显示该文件中使用的所有颜色和排版
2. 设计系统管理
- - 样式审计:分析颜色使用、排版一致性、间距模式
- 组件分析:识别未使用组件,衡量使用模式
- 品牌合规性:检查跨文件对品牌指南的遵循情况
- 设计令牌提取:从 Figma 样式生成 CSS/JSON 设计令牌
使用示例:
- - 审计该设计系统的可访问性问题
- 从这些 Figma 样式生成 CSS 自定义属性
- 查找组件库中的所有不一致之处
3. 批量资源导出
- - 多格式导出:将资源导出为 PNG、SVG、PDF 或 WEBP 格式
- 平台特定尺寸:为 iOS/Android 生成 @1x、@2x、@3x 资源
- 组织化输出:按格式或平台自动进行文件夹组织
- 客户包:包含文档的完整可交付成果包
使用示例:
- - 以 PNG 和 SVG 格式导出所有组件
- 为移动应用开发生成完整资源包
- 创建包含所有营销资源的客户交付物
4. 可访问性与质量分析
- - 对比度检查:验证 WCAG 颜色对比度要求
- 字体大小分析:确保可读的排版比例
- 交互元素尺寸:检查触摸目标要求
- 焦点状态验证:验证键盘导航模式
使用示例:
- - 检查该设计是否符合 WCAG AA 标准
- 分析移动端可用性的触摸目标
- 为该应用设计生成可访问性报告
快速开始
身份验证设置
bash
设置你的 Figma 访问令牌
export FIGMA
ACCESSTOKEN=your-token-here
或存储在 .env 文件中
echo FIGMA
ACCESSTOKEN=your-token >> .env
基本操作
bash
获取文件信息和结构
python scripts/figma_client.py get-file your-file-key
将画板导出为图片
python scripts/export_manager.py export-frames file-key --formats png,svg
分析设计系统一致性
python scripts/style_auditor.py audit-file file-key --generate-html
检查可访问性合规性
python scripts/accessibility_checker.py file-key --level AA --format html
工作流程模式
设计系统审计工作流程
- 1. 提取文件数据 → 获取组件、样式和结构
- 分析一致性 → 检查样式变化和未使用元素
- 生成报告 → 创建详细发现和建议
- 手动实施 → 使用发现结果指导设计改进
资源导出工作流程
- 1. 识别导出目标 → 指定画板、组件或节点
- 配置导出设置 → 设置格式、尺寸和命名约定
- 批量处理 → 同时导出多个资源
- 组织输出 → 为交接或实施结构化文件
分析与文档工作流程
- 1. 提取设计数据 → 拉取组件、样式和设计令牌
- 审计合规性 → 检查可访问性和品牌一致性
- 生成文档 → 创建样式指南和组件规范
- 导出交付物 → 为开发或客户交接打包资源
资源
scripts/
- - figmaclient.py - 包含所有 REST 端点的完整 Figma API 封装器
- exportmanager.py - 支持多种格式和比例的专业资源导出
- styleauditor.py - 设计系统分析和品牌一致性检查
- accessibilitychecker.py - 全面的 WCAG 合规性验证和报告
references/
- - figma-api-reference.md - 完整的 API 文档和示例
- design-patterns.md - UI 模式和组件最佳实践
- accessibility-guidelines.md - WCAG 合规要求
- export-formats.md - 资源导出选项和规范
assets/
- - templates/design-system/ - 预构建的组件库模板
- templates/brand-kits/ - 标准品牌指南结构
- templates/wireframes/ - 常见布局模式和流程
集成示例
与开发工作流程集成
bash
为 CSS 生成设计令牌
python scripts/export_manager.py export-tokens file-key --format css
创建组件文档
python scripts/figma_client.py document-components file-key --output docs/
与品牌管理集成
bash
审计设计中的品牌合规性
python scripts/style_auditor.py audit-file file-key --brand-colors #FF0000,#00FF00,#0000FF
提取当前品牌颜色用于分析
python scripts/figma_client.py extract-colors file-key --output brand-colors.json
与客户交付物集成
bash
生成客户演示资源
python scripts/export_manager.py client-package file-key --template presentation
创建开发交接资源
python scripts/export_manager.py dev-handoff file-key --include-specs
限制与范围
只读操作
该技能通过 REST API 提供对 Figma 文件的
只读访问。它可以:
- - ✅ 提取数据、组件和样式
- ✅ 以多种格式导出资源
- ✅ 分析和审计设计文件
- ✅ 生成全面报告
不能执行的操作
- - ❌ 修改现有文件(颜色、文本、组件)
- ❌ 创建新设计或组件
- ❌ 批量更新多个文件
- ❌ 实时协作功能
如需修改文件,你需要使用插件 API 开发一个 Figma 插件。
技术特性
API 速率限制
内置速率限制和重试逻辑,优雅处理 Figma 的 API 约束。
错误处理
全面的错误处理,包含详细日志记录和恢复建议。
多格式支持
以 PNG、SVG、PDF 和 WEBP 格式导出资源,支持平台特定尺寸。