AgentSkillsCN

figma-pilot

在使用 figma_execute 之前,请务必阅读相关文档。文档中包含了 API 语法、参数格式及示例。请仔细阅读 rules/*.md 文件,以确保正确使用。

SKILL.md
--- frontmatter
name: figma-pilot
description: REQUIRED reading before using figma_execute. Contains API syntax, parameter formats, and examples. READ rules/*.md files for correct usage.
metadata:
  tags: figma, mcp, design, ai, components, accessibility, tokens

When to use

ALWAYS read this skill BEFORE calling figma_execute! This skill contains the correct API syntax, parameter formats, and examples that you MUST follow. Failure to read this will result in syntax errors.

Use this skill whenever you are working with figma-pilot MCP tools to create or modify Figma designs.

Code Execution Mode

figma-pilot uses a code execution mode for maximum efficiency. Instead of 15+ individual tools, you use figma_execute to run JavaScript code with access to all Figma APIs.

Available Tools

ToolDescription
figma_statusCheck connection to Figma plugin (call first)
figma_executeExecute JavaScript with all Figma APIs
figma_get_api_docsGet detailed API documentation

Quick Example

javascript
// figma_execute
// Create a card and modify selection
await figma.create({
  type: 'card',
  name: 'Welcome Card',
  children: [
    { type: 'text', content: 'Hello!', fontSize: 24 }
  ]
});

const { nodes } = await figma.query({ target: 'selection' });
for (const node of nodes) {
  await figma.modify({ target: node.id, fill: '#0066FF' });
}
console.log(`Modified ${nodes.length} elements`);

Benefits

  • 90%+ fewer tokens - 3 tools instead of 15+
  • Batch operations - Modify many elements in one call
  • Data filtering - Filter results before returning to context
  • Complex workflows - Loops, conditionals, error handling

API Reference

Read individual rule files for detailed API documentation:

Getting Started

Core APIs

Creating Elements

  • rules/create.md - figma.create() - Create elements (frames, text, shapes, semantic types)
  • rules/layout.md - Auto-layout configuration and patterns

Modifying Elements

Styling

Text

Components

  • rules/components.md - figma.listComponents(), figma.instantiate(), figma.toComponent(), figma.createVariants()

Accessibility

Design Tokens

  • rules/tokens.md - figma.createToken(), figma.bindToken(), figma.syncTokens()

Export

Common Patterns

Reference