شعار Figma Agent

Figma Agent

المجتمع
Lincb522
figma-agent

通过本机 Figma Agent CLI 检查连接、启动桥接并按需获取一次性配对码,在 Figma 中设计可编辑 UI、小图标、App Icon、Keyline 构造底板、布尔造型与原型交互动画,支持先 image_gen 生图再复刻,以及导出代码交接包供 Agent 实现参考。用户要求在 Figma 中设计、修改或复刻,把设计转代码或写回项目,连接 Figma Agent,添加点击、悬停、弹层、Smart Animate 或组件状态动画,或明确调用 figma-agent 时使用。

نظرة عامة

الناشرLincb522
المستودعfigma-agent-cli
اسم المهارةfigma-agent
النجوم
43
التفريعات
1
الملفات المرفقة
2
الترخيصMIT
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • الملفات المرفقة: 2

    نصوص برمجية وقوالب ومراجع يمكن للنموذج قراءتها أثناء عمله. الملفات للقراءة فقط ولا تُنفّذ أبدًا.

  • مفتوحة المصدر

    نشرها Lincb522 على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Figma Agent في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى الإضافات → المهارات.
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/Lincb522/figma-agent-cli/tree/main/skills/figma-agent
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات → المهارات → إضافة مهارة → من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Lincb522/figma-agent-cli.git /tmp/figma-agent-cli
mkdir -p .claude/skills
cp -r /tmp/figma-agent-cli/skills/figma-agent .claude/skills/figma-agent
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Figma Agent في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج Figma Agent تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Figma Agent بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تترتب أي تكلفة على المهارة غير المستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

Figma Agent

Use the local CLI and paired Figma development plugin. This skill supplies the installed tool location and workflow across conversations; the invoking agent performs the design work.

The host must be able to run the local Node CLI and read/write project files. Load this SKILL.md through the host's supported mechanism; $figma-agent is Codex invocation syntax, not a CLI requirement. For hosts without skill discovery, explicitly read this file and run the CLI's agent guide. Image generation requires the named tool in the host; supplied reference images can still use design import without it.

Install and locate the tool

The skill includes scripts/setup.mjs. At the beginning of a conversation, run it with Node using its absolute path resolved from this SKILL.md directory:

sh
node <absolute-skill-directory>/scripts/setup.mjs

It downloads the prebuilt CLI and Figma plugin on first use, starts a background bridge when needed, and prints the absolute CLI and manifest paths. A first download also generates a one-time pairing code and Figma import instructions. Node.js 22+, curl, tar and the Figma desktop app are prerequisites; do not claim to install these applications. If Node is missing, guide the user to install it before continuing.

A repository installation records its project path in adjacent local-install.json (no credentials). A standalone skill defaults to ~/.local/share/figma-agent-cli; FIGMA_AGENT_HOME or --project <path> explicitly selects another location. If a recorded directory exists but is incomplete, repair it instead of overwriting it. Keep using the same installation across conversations. Do not rebuild or download another copy when the current tool is present.

Use the CLI path returned by setup for all subsequent commands. Let the CLI consume its normal credentials; never read .figma-agent/session.json or .figma-agent/authorizations.json. Do not install another Figma connector or request API keys.

Begin a task

Read the installed CLI's current guide before the first operation in a conversation:

sh
node <absolute-cli-path> agent

Then run sessions and document; inspect selection when the task refers to selected content. Invoke all commands as node <absolute-cli-path> <command>. Use schema for command arguments, node properties, and supported operations instead of guessing flags.

Resolve the actual target from the live session and user request. Never reuse a remembered session or node ID. When several files are connected, supply --session <actual-id> for every operation targeting a file. Read relevant layers, fonts, styles, and variables before changing an existing design.

Check the local installation when connecting or updating

Read the built CLI version with node <absolute-cli-path> --help. Use 0.6.0 or newer for continuous reconnection; it includes persistent pairing and the embedded-panel startup fix. Read the package version only as source metadata; it does not establish which built CLI or plugin is running.

When the user reports that their local copy is stale, resolve the actual development-plugin directory from their manifest path or Figma process metadata before updating it. Update the installed skill and the local runtime files in that installation, not just a remote repository or ZIP. Preserve .figma-agent and the manifest plugin ID so existing bindings survive. Rebuild using that project's normal build command when its sources have changed; a working installation does not need rebuilding for each design task.

Figma's already-open plugin panel keeps running its loaded code. After replacing the plugin files, have the user close and reopen Figma Agent in the target file. Check the displayed panel/main-thread versions in connection diagnostics when available. Do not report a runtime upgrade from a source version or successful build alone. A plugin-only update does not require restarting the bridge. Version 0.6.0 adds prototype-get/prototype-set to the protocol: a bridge started before this update must be restarted once to accept these commands, and the plugin must be reopened. Do not repeatedly retry INVALID_METHOD against that old process. Restart the bridge only when its loaded server code needs updating and that restart is authorized.

If connecting opens a blank panel, stop generating pairing codes. Check the built plugin version and loaded manifest first; 0.4.1 adds startup diagnostics and prevents the pairing form from navigating away when initialization fails. Ask for the first panel diagnostic or console error only if it is needed to continue diagnosis.

Connect without repeated setup

Preserve a running bridge. If sessions reports BRIDGE_NOT_RUNNING or BRIDGE_UNREACHABLE, run the setup helper again; it starts a detached bridge, prints its PID and log path, and verifies readiness. Keep this recovery information and verify sessions again. If the port is already occupied, identify the existing installation instead of stopping it or overwriting its state.

Binding is remembered on this Figma client and reused across files. Reopening the plugin or restarting the bridge restores authorization automatically. Each target file still needs Figma Agent running; files have separate sessions, even when their names match. Never merge or guess sessions by file name. Clearing Figma client storage, changing the plugin ID, or deleting the bridge authorization file requires a new binding.

When no file is connected, ask the user to open Figma Agent in the target file. A remembered binding reconnects automatically while the plugin remains open, including after the bridge has been offline for a long time; no new pairing code is needed. Start the bridge if necessary, allow up to 30 seconds for automatic recovery, and check sessions again. Use 重试连接 only if the user stopped reconnection or manually disconnected. Preserve an explicit stop until the user requests reconnection. The plugin retains a paused state after recovery, and an uncertain mutation still requires document inspection before continuing. Show the manifest path and guide first-time users through Figma desktop → Plugins → Development → Import plugin from manifest…, then run Figma Agent. Importing the plugin is a manual Figma step; never claim setup performed it. If setup already returned a code, reuse that code. Otherwise, for first-time binding, an invalid saved binding, or an explicit request for a code, run node <absolute-cli-path> pair yourself and show the returned one-time six-digit code with its ten-minute validity. Tell the user to enter it in Figma Agent and click 连接. Do not tell them to restart the terminal to get a code. Only generate another code when the previous one expired or the user requests it.

The user authorizes showing this temporary pairing code to complete binding. This does not authorize reading or displaying persistent credentials: never open .figma-agent/session.json, .figma-agent/authorizations.json, or dump Figma clientStorage. Let the CLI and plugin handle them normally. A sessions response without persistentPairing: true means the running bridge predates persistent binding; explain that a one-time bridge restart and plugin reload are needed after updating. Do not stop another task's active bridge without authorization.

After binding, continue the requested design and verify the current document. Keep the bridge process, file, and plugin open; the setup helper’s background bridge does not require an open terminal. Disconnecting a file keeps the saved binding; 取消此设备绑定 revokes it for every file using that device binding.

Design workflows

Use the installed agent guide as the maintained command reference. Execute the requested design, rather than returning instructions for the user to type commands.

  • UI: Create and edit native frames, text, components, and layout. Use apply for new node trees, patch for focused edits, and exec for advanced Plugin API work. Preserve the existing file's design language and unrelated content.
  • Interactive animation: Use prototype get to inspect existing reactions, then prototype set <id> <json> to replace the node’s Reaction[] while preserving unrelated interactions. prototype clear removes all reactions. Use schema.prototype for supported triggers/actions, transitions and spring/cubic-bezier easing. Times are seconds, so 300 ms is 0.3; instant transitions use null. Use actions[], never deprecated action. For advanced variable/conditional actions outside the dedicated schema, preserve them through native setReactionsAsync in exec rather than dropping them. Build matching named layers across animation states. For interactive controls, create main component variants in one component set using figma.combineAsVariants, connect them with CHANGE_TO, and place an instance in the preview frame. h.prototype(id, reactions) is available inside exec. Read <project>/docs/PROTOTYPES.md and <project>/examples/interactive-toggle.js when creating a first interactive component. Select the preview frame and guide the user to Figma Present; verify both forward and return interactions, interruption, and hover/pressed states where applicable. Reading stored reactions and exporting PNGs do not prove animation playback. Do not call a static preview a tested interaction or promise GIF/video export.
  • Icons: Support both small UI icons and App Icons. The user's Keyline “底板” is a geometry construction grid, distinct from a colored icon background. Keep locked Guides separate from editable Artwork. Use native boolean operands or vector paths for the mark; never consume guide nodes as boolean inputs. Use the guide's icon, boolean, and clean Artwork export workflow.
  • Image-first reconstruction: When requested, use design prepare and design generate to obtain the host image_gen request, actually call that tool, inspect its returned image, and accept the actual PNG with its generation receipt. design generate alone does not generate an image. Reconstruct native text, controls, layout, and vector/boolean icon shapes; retain raster assets where appropriate. Use design apply and design capture to produce a real Figma render and comparison. For a supplied image, use design import. If the host image tool is unavailable, report that fact rather than presenting a placeholder as generated output.

Save task layouts, scripts, returned node IDs, and exports in a task-specific directory in the current user workspace. Keep reusable CLI source and shipped examples intact during design tasks.

Hand a completed design back to the agent

After verifying a design or reconstruction, inspect the current project to choose its framework when the task includes code handoff or implementation. Use CLI 0.7.1 or newer for code export; this command reuses the existing eval/export bridge protocol and does not require restarting an already compatible bridge. Export the reference into that project:

sh
node <absolute-cli-path> code export <frame-id> --dir <current-project>/design-reference/<new-name> --format react

Omit the node ID only when exactly one intended node is selected. Use --format html for SwiftUI and other non-React projects as a portable visual reference, or react for React projects and an additional FigmaDesign.tsx; both include index.html, styles, local assets, native structure, actual Figma preview and HANDOFF.md. Pick a new directory for each export; existing source files are never overwritten. The CLI prints absolute paths so the invoking agent task can read the handoff directly, without sending a message to another task.

Read HANDOFF.md, handoff.json and design.json, and view preview.png before implementation. Choose the target framework from the current project. For SwiftUI or another framework, generate a matching reference implementation alongside the handoff files using the native structure, assets and project conventions; do not claim the CLI emits those languages. Generated HTML/React uses fixed source dimensions as a visual reference. Preserve auto-layout and constraint metadata when building responsive layouts. Prototype reactions, component properties and variable bindings are reference data, not implemented application behavior. Review the exported warnings, fonts and any flattened assets. Only integrate into application source when implementation is part of the user's request.

Verify and recover

After a design mutation, export the affected frames from Figma and inspect the actual images with the available image-viewing tool. Check the requested sizes, layout, text, clipping, and icon geometry; fix observed issues and export again when necessary. For image reconstruction, inspect the live render against the reference. Report actual node IDs, output paths, and any remaining unverified behavior.

An uncertain mutation may already have executed. Preserve its request ID and query request; for image reconstruction use design recover. Do not retry with a new ID or duplicate a screen just because a reply was lost. Inspect the affected document before deciding the next action.

Reading a document proves the connection and read path only. Do not infer successful native booleans, editable reconstruction, or visual quality from connection status, a local preview, or a test fixture.

Multiple agents and concurrent routes

Multiple CLI processes may share the bridge. Always resolve live sessions and explicitly route each operation. Use CLI 0.8.0 or newer and batch <routes.json> --concurrency 4 to run independent session routes in parallel (1–32 active routes). The input is {routes:[{name,sessionId,commands:[{id,method,params,timeoutMs}]}]}. Each session occurs once per batch; request IDs are unique, stable, and supplied before dispatch. Use underlying methods/params from schema, not CLI command strings. Inline assets must already be hydrated. Route steps execute serially; a failure stops that route and reports skipped IDs while other routes continue. Batch is not atomic, does not lock out other clients, and has no output interpolation. Use separate calls when later parameters depend on earlier outputs. Keep mutations to shared nodes coordinated. A transport failure may hide an executed mutation: query the original request ID before retrying. Never silently reroute disconnected work.

الملفات المرفقة

يقرأ النموذج هذه الملفات عند الحاجة أثناء تحميل المهارة. وهي متاحة للقراءة ولا تُنفّذ أبدًا.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي Figma Agent؟

通过本机 Figma Agent CLI 检查连接、启动桥接并按需获取一次性配对码,在 Figma 中设计可编辑 UI、小图标、App Icon、Keyline 构造底板、布尔造型与原型交互动画,支持先 image_gen 生图再复刻,以及导出代码交接包供 Agent 实现参考。用户要求在 Figma 中设计、修改或复刻,把设计转代码或写回项目,连接 Figma Agent,添加点击、悬停、弹层、Smart Animate 或组件状态动画,或明确调用 figma-agent 时使用。

لماذا تستخدم Figma Agent على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Figma Agent عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Figma Agent في TypingMind؟

افتح الإضافات → المهارات → التثبيت من GitHub في TypingMind والصق https://github.com/Lincb522/figma-agent-cli/tree/main/skills/figma-agent. يقرأ TypingMind ملف SKILL.md الخاص بها، ويجمع ملفاتها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Figma Agent؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Figma Agent؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Figma Agent معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Figma Agent مجانية؟

نعم. نشرها Lincb522 على GitHub بموجب ترخيص MIT. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا البريدية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇