Token导航 LogoToken导航

Agent Skill · 研究检索

code-connect-components(代码 connect 组件)

code-connect-components 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

code-connect-components 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为调用外部服务;许可证为 MIT,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 6,763。

总安装 21,004周安装 884GitHub Stars 1,273下载 7,355核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:code-connect-components(代码 connect 组件)
来源仓库:https://github.com/figma/mcp-server-guide
仓库路径:skills/code-connect-components
安装命令:
npx skills add https://github.com/figma/mcp-server-guide --skill code-connect-components
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/figma/mcp-server-guide --skill code-connect-components

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

使用 Code Connect 在 Figma 设计组件和代码实现之间建立双向链接。

需要 Figma MCP 服务器连接并在组织或企业计划上发布组件 自动识别 Figma 选择中未映射的组件,然后扫描您的代码库,按名称、结构和属性匹配代码组件 在创建映射之前向您展示匹配的组件以供审阅,从而允许选择性接受或拒绝 支持多种框架和语言(React、Vue、Swift UIKit、Compose、Flutter 等),可在单个操作中批量创建映射

来源仓库内路径:skills/code-connect-components

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/figma/mcp-server-guide --skill code-connect-co…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要调用外部服务,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

code-connect-components 怎么安装?

在终端执行 npx skills add https://github.com/figma/mcp-server-guide --skill code-connect-components。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

code-connect-components 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

code-connect-components 需要什么权限?

权限级别是调用外部服务。该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

code-connect-components 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

code-connect-components 用的人多吗?

公开数据是累计安装 21,004 次,近一周安装 884 次,下载 7,355 次,GitHub 1,273 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

code-connect-components 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 来源仓库有 1,273 星,维护活跃度相对可查。

先想清楚的地方

  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
code-connect-components

代码 connect 组件 · 本页

21,0041,273调用外部服务MIT有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Code Connect Components

Overview

This skill helps you connect Figma design components to their corresponding code implementations using Figma's Code Connect feature. It analyzes the Figma design structure, searches your codebase for matching components, and establishes mappings that maintain design-code consistency.

Prerequisites

  • Figma MCP server must be connected and accessible

- Before proceeding, verify the Figma MCP server is connected by checking if Figma MCP tools (e.g., get_code_connect_suggestions) are available. - If the tools are not available, the Figma MCP server may not be enabled. Guide the user to enable the Figma MCP server that is included with the plugin. They may need to restart their MCP client afterward.

  • User must provide a Figma URL with node ID: https://figma.com/design/:fileKey/:fileName?node-id=1-2

- IMPORTANT: The Figma URL must include the node-id parameter. Code Connect mapping will fail without it.

  • IMPORTANT: The Figma component must be published to a team library. Code Connect only works with published components or component sets.
  • IMPORTANT: Code Connect is only available on Organization and Enterprise plans.
  • Access to the project codebase for component scanning

Required Workflow

Follow these steps in order. Do not skip steps.

Step 1: Get Code Connect Suggestions

Call get_code_connect_suggestions to identify all unmapped components in a single operation. This tool automatically:

  • Fetches component info from the Figma scenegraph
  • Identifies published components in the selection
  • Checks existing Code Connect mappings and filters out already-connected components
  • Returns component names, properties, and thumbnail images for each unmapped component

Parse the URL to extract fileKey and nodeId, then call get_code_connect_suggestions.

IMPORTANT: When extracting the node ID from a Figma URL, convert the format:

  • URL format uses hyphens: node-id=1-2
  • Tool expects colons: nodeId=1:2

Parse the Figma URL:

  • URL format: https://figma.com/design/:fileKey/:fileName?node-id=1-2
  • Extract file key: :fileKey (segment after /design/)
  • Extract node ID: 1-2 from URL, then convert to 1:2 for the tool
get_code_connect_suggestions(fileKey=":fileKey", nodeId="1:2")

Handle the response:

  • If the tool returns "No published components found in this selection" → inform the user and stop. The components may need to be published to a team library first.
  • If the tool returns "All component instances in this selection are already connected to code via Code Connect" → inform the user that everything is already mapped.
  • Otherwise, the response contains a list of unmapped components, each with:

- Component name - Node ID - Component properties (JSON with prop names and values) - A thumbnail image of the component (for visual inspection)

Step 2: Scan Codebase for Matching Components

For each unmapped component returned by get_code_connect_suggestions, search the codebase for a matching code component.

What to look for:

  • Component names that match or are similar to the Figma component name
  • Component structure that aligns with the Figma hierarchy
  • Props that correspond to Figma properties (variants, text, styles)
  • Files in typical component directories (src/components/, components/, ui/, etc.)

Search strategy:

  1. Search for component files with matching names
  2. Read candidate files to check structure and props
  3. Compare the code component's props with the Figma component properties returned in Step 1
  4. Detect the programming language (TypeScript, JavaScript) and framework (React, Vue, etc.)
  5. Identify the best match based on structural similarity, weighing:

- Prop names and their correspondence to Figma properties - Default values that match Figma defaults - CSS classes or style objects - Descriptive comments that clarify intent

  1. If multiple candidates are equally good, pick the one with the closest prop-interface match and document your reasoning in a 1-2 sentence comment before your tool call

Example search patterns:

  • If Figma component is "PrimaryButton", search for Button.tsx, PrimaryButton.tsx, Button.jsx
  • Check common component paths: src/components/, app/components/, lib/ui/
  • Look for variant props like variant, size, color that match Figma variants

Step 3: Present Matches to User

Present your findings and let the user choose which mappings to create. The user can accept all, some, or none of the suggested mappings.

Present matches in this format:

The following components match the design:
- [ComponentName](path/to/component): DesignComponentName at nodeId [nodeId](figmaUrl?node-id=X-Y)
- [AnotherComponent](path/to/another): AnotherDesign at nodeId [nodeId2](figmaUrl?node-id=X-Y)

Would you like to connect these components? You can accept all, select specific ones, or skip.

If no exact match is found for a component:

  • Show the 2 closest candidates
  • Explain the differences
  • Ask the user to confirm which component to use or provide the correct path

If the user declines all mappings, inform them and stop. No further tool calls are needed.

Step 4: Create Code Connect Mappings

Once the user confirms their selections, call send_code_connect_mappings with only the accepted mappings. This tool handles batch creation of all mappings in a single call.

Example:

send_code_connect_mappings(
  fileKey=":fileKey",
  nodeId="1:2",
  mappings=[
    { nodeId: "1:2", componentName: "Button", source: "src/components/Button.tsx", label: "React" },
    { nodeId: "1:5", componentName: "Card", source: "src/components/Card.tsx", label: "React" }
  ]
)

Key parameters for each mapping:

  • nodeId: The Figma node ID (with colon format: 1:2)
  • componentName: Name of the component to connect (e.g., "Button", "Card")
  • source: Path to the code component file (relative to project root)
  • label: The framework or language label for this Code Connect mapping. Valid values include:

- Web: 'React', 'Web Components', 'Vue', 'Svelte', 'Storybook', 'Javascript' - iOS: 'Swift UIKit', 'Objective-C UIKit', 'SwiftUI' - Android: 'Compose', 'Java', 'Kotlin', 'Android XML Layout' - Cross-platform: 'Flutter' - Docs: 'Markdown'

After the call:

  • On success: the tool confirms the mappings were created
  • On error: the tool reports which specific mappings failed and why (e.g., "Component is already mapped to code", "Published component not found", "Insufficient permissions")

Provide a summary after processing:

Code Connect Summary:
- Successfully connected: 3
  - Button (1:2) → src/components/Button.tsx
  - Card (1:5) → src/components/Card.tsx
  - Input (1:8) → src/components/Input.tsx
- Could not connect: 1
  - CustomWidget (1:10) - No matching component found in codebase

Examples

Example 1: Connecting a Button Component

User says: "Connect this Figma button to my code: https://figma.com/design/kL9xQn2VwM8pYrTb4ZcHjF/DesignSystem?node-id=42-15"

Actions:

  1. Parse URL: fileKey=kL9xQn2VwM8pYrTb4ZcHjF, nodeId=42-15 → convert to 42:15
  2. Run get_code_connect_suggestions(fileKey="kL9xQn2VwM8pYrTb4ZcHjF", nodeId="42:15")
  3. Response shows: Button component (unmapped) with variant (primary/secondary) and size (sm/md/lg) properties, plus a thumbnail image
  4. Search codebase for Button components: Find src/components/Button.tsx
  5. Read Button.tsx and confirm it has variant and size props
  6. Present to user: "I found a match: Would you like to connect this component?"

- Button: Button at nodeId 42:15

  1. User confirms: "Yes"
  2. Detect that it's a TypeScript React component
  3. Run send_code_connect_mappings(fileKey="kL9xQn2VwM8pYrTb4ZcHjF", nodeId="42:15", mappings=[{nodeId: "42:15", componentName: "Button", source: "src/components/Button.tsx", label: "React"}])

Result: Figma button component is now connected to the code Button component.

Example 2: Multiple Components with Partial Selection

User says: "Connect components in this frame: https://figma.com/design/pR8mNv5KqXzGwY2JtCfL4D/Components?node-id=10-50"

Actions:

  1. Parse URL: fileKey=pR8mNv5KqXzGwY2JtCfL4D, nodeId=10-50 → convert to 10:50
  2. Run get_code_connect_suggestions(fileKey="pR8mNv5KqXzGwY2JtCfL4D", nodeId="10:50")
  3. Response shows 3 unmapped components: ProductCard, Badge, and CustomWidget
  4. Search codebase:

- ProductCard: Found src/components/ProductCard.tsx (props match) - Badge: Found src/components/Badge.tsx (props match) - CustomWidget: No matching component found

  1. Present to user: "The following components match the design: I couldn't find a match for CustomWidget (10:53). Would you like to connect these components? You can accept all, select specific ones, or skip."

- ProductCard: ProductCard at nodeId 10:51 - Badge: Badge at nodeId 10:52

  1. User: "Just connect ProductCard, skip Badge for now"
  2. Run send_code_connect_mappings(fileKey="pR8mNv5KqXzGwY2JtCfL4D", nodeId="10:50", mappings=[{nodeId: "10:51", componentName: "ProductCard", source: "src/components/ProductCard.tsx", label: "React"}])

Result: Only ProductCard is connected, per the user's selection.

Example 3: Component Needs Creation

User says: "Connect this icon: https://figma.com/design/8yJDMeWDyBz71EnMOSuUiw/Icons?node-id=5-20"

Actions:

  1. Parse URL: fileKey=8yJDMeWDyBz71EnMOSuUiw, nodeId=5-20 → convert to 5:20
  2. Run get_code_connect_suggestions(fileKey="8yJDMeWDyBz71EnMOSuUiw", nodeId="5:20")
  3. Response shows: CheckIcon component (unmapped) with color and size properties
  4. Search codebase for CheckIcon: No matches found
  5. Search for generic Icon components: Find src/icons/ directory with other icons
  6. Report to user: "I couldn't find a CheckIcon component, but I found an icons directory at src/icons/. Would you like to:

- Create a new CheckIcon.tsx component first, then connect it - Connect to a different existing icon - Provide the path to the CheckIcon if it exists elsewhere"

  1. User provides path: "src/icons/CheckIcon.tsx"
  2. Detect language and framework from the file
  3. Run send_code_connect_mappings(fileKey="8yJDMeWDyBz71EnMOSuUiw", nodeId="5:20", mappings=[{nodeId: "5:20", componentName: "CheckIcon", source: "src/icons/CheckIcon.tsx", label: "React"}])

Result: CheckIcon component is successfully connected to the Figma design.

Best Practices

Proactive Component Discovery

Don't just ask the user for the file path — actively search their codebase to find matching components. This provides a better experience and catches potential mapping opportunities.

Accurate Structure Matching

When comparing Figma components to code components, look beyond just names. Check that:

  • Props align (variant types, size options, etc.)
  • Component hierarchy matches (nested elements)
  • The component serves the same purpose

Clear Communication

When offering to create a mapping, clearly explain:

  • What you found
  • Why it's a good match
  • What the mapping will do
  • How props will be connected

Handle Ambiguity

If multiple components could match, present options rather than guessing. Let the user make the final decision about which component to connect.

Graceful Degradation

If you can't find an exact match, provide helpful next steps:

  • Show close candidates
  • Suggest component creation
  • Ask for user guidance

Common Issues and Solutions

Issue: "No published components found in this selection"

Cause: The Figma component is not published to a team library. Code Connect only works with published components. Solution: The user needs to publish the component to a team library in Figma:

  1. In Figma, select the component or component set
  2. Right-click and choose "Publish to library" or use the Team Library publish modal
  3. Publish the component
  4. Once published, retry the Code Connect mapping with the same node ID

Issue: "Code Connect is only available on Organization and Enterprise plans"

Cause: The user's Figma plan does not include Code Connect access. Solution: The user needs to upgrade to an Organization or Enterprise plan, or contact their administrator.

Issue: No matching component found in codebase

Cause: The codebase search did not find a component with a matching name or structure. Solution: Ask the user if the component exists under a different name or in a different location. They may need to create the component first, or it might be located in an unexpected directory.

Issue: "Published component not found" (CODE_CONNECT_ASSET_NOT_FOUND)

Cause: The source file path is incorrect, the component doesn't exist at that location, or the componentName doesn't match the actual export. Solution: Verify the source path is correct and relative to the project root. Check that the component is properly exported from the file with the exact componentName specified.

Issue: "Component is already mapped to code" (CODE_CONNECT_MAPPING_ALREADY_EXISTS)

Cause: A Code Connect mapping already exists for this component. Solution: The component is already connected. If the user wants to update the mapping, they may need to remove the existing one first in Figma.

Issue: "Insufficient permissions to create mapping" (CODE_CONNECT_INSUFFICIENT_PERMISSIONS)

Cause: The user does not have edit permissions on the Figma file or library. Solution: The user needs edit access to the file containing the component. Contact the file owner or team admin.

Issue: Code Connect mapping fails with URL errors

Cause: The Figma URL format is incorrect or missing the node-id parameter. Solution: Verify the URL follows the required format: https://figma.com/design/:fileKey/:fileName?node-id=1-2. The node-id parameter is required. Also ensure you convert 1-2 to 1:2 when calling tools.

Issue: Multiple similar components found

Cause: The codebase contains multiple components that could match the Figma component. Solution: Present all candidates to the user with their file paths and let them choose which one to connect. Different components might be used in different contexts (e.g., Button.tsx vs LinkButton.tsx).

Understanding Code Connect

Code Connect establishes a bidirectional link between design and code:

For designers: See which code component implements a Figma component For developers: Navigate from Figma designs directly to the code that implements them For teams: Maintain a single source of truth for component mappings

The mapping you create helps keep design and code in sync by making these connections explicit and discoverable.

Additional Resources

For more information about Code Connect:

平台分布

Claude Code

26.12%
按下载量换算1,921

Cursor

22.73%
按下载量换算1,672

OpenCode

18.89%
按下载量换算1,389

Antigravity

12.63%
按下载量换算929

Gemini CLI

8.05%
按下载量换算592

Codex

3.57%
按下载量换算263

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

调用外部服务

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。

继续浏览同类 Skills