Deskhand

io.github.duncanbottrill由 GitHub 账号 duncanbottrill 发布v1.0.1更新于 Nov 1, 2026

Claude in your Figma file. Builds with your components, checks what it wrote. Runs on your computer.

已验证STDIO仅桌面开发者工具媒体与设计

概览

AI 生成的概览

Deskhand 通过本地插件把 Claude 接入 Figma 文件,让助手在本机读取、搭建、修改、导出并检查设计稿。

可以做什么
  • 查看当前 Figma 文档:文件信息、页面、选区与选区历史、节点详情、品牌样式、组件与变量
  • 创建与编辑设计内容:画框、矩形、文本、填充、描边、圆角、透明度、可见性、编组、克隆、移动、缩放、尺寸限制、图片填充
  • 在 Figma 插件中运行自定义 JavaScript,并支持任务状态查询与取消
  • 导出与渲染:单个或批量导出 PNG、SVG、JPG、PDF,内联截图,以及与参考节点做像素比对
  • 质量检查与素材:逐屏 lint 并给出修复建议、Lucide 图标查找与放置、iOS 界面模板
  • 支持 FigJam:便签、带文字形状、连接线、表格、代码块与链接预览
适用场景
适合希望助手直接在 Figma 文件里工作的场景:用已有组件和样式搭建界面、复刻参考设计、交付前审查画框、导出素材。更偏向设计与设计工程流程,而非通用编程。
运行要求
以本地 npm 包通过 stdio 运行,仅支持桌面端。需要 Figma 插件在 3055 端口运行并连接,否则所有工具返回 NOT_CONNECTED。试用期后需要 Deskhand 许可密钥。可选环境变量 DESKHAND_PROFILE 决定注册哪些工具(design、figjam 或 all)。
安装前请注意
该服务器会改动打开的 Figma 文档:创建、移动、缩放、改样式和删除节点,风险操作前应先做快照。figma_execute 会在插件内执行任意 JavaScript。figma_licence_activate 会提交许可密钥。图片填充可从 http(s) 网址获取图片,导出会在 ~/.deskhand 下写入文件。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Deskhand,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

工具

113

figma_server_info

Server version, WebSocket port, connection state and connected document info.

无需输入参数。

figma_get_context

File info, current page and selection. Call once per conversation; every tool reports NOT_CONNECTED if the plugin is down.

无需输入参数。

figma_get_selection_history

Recent selection changes, newest first, with timestamps. Default: the user's own selections; source: 'all' adds those made by bridge commands. Served from a server buffer, so it works after the plugin disconnects. If the default returns nothing, retry with source: 'all'.

输入参数limitsource

figma_bridge_diagnostics

Check the bridge end to end: versions, plugin handshake, buffered events, reverse round-trip timing. Call when a tool fails or after an upgrade.

无需输入参数。

figma_licence_status

Deskhand licence state: trial days left, masked key, last check.

无需输入参数。

figma_licence_activate

Activate a Deskhand licence key.

输入参数key必填

figma_execute

Run JavaScript in the Figma plugin: an async function body with figma (Plugin API) and bridge (log, sleep, icon, text, instance, image, snapshot; progress/cancelled in jobs). Return plain data, never nodes (EXECUTE_BAD_RETURN). Errors: EXECUTE_SYNC_API, EXECUTE_SYNTAX, EXECUTE_FAILED. job: true past 30 s, then figma_job_status (waits). screenshot renders it. Recipes: figma_get_design_rules.

输入参数jobcode必填lintlabeltimeoutMsscreenshot

figma_job_status

Waits for a figma_execute job to end (up to waitMs), then returns state (running | done | error | cancelled | timeout), progress and the result or error. Jobs live for the server session.

输入参数jobId必填waitMs

figma_job_cancel

Ask a running figma_execute job to stop (sets the flag bridge.cancelled() returns; scripts that never check it run to completion). Poll figma_job_status.

输入参数jobId必填

figma_list_pages

List pages (ids and names). The active page is in figma_get_context.

无需输入参数。

figma_get_nodes

Full node details by id: geometry, fills, strokes, effects, auto-layout, text, constraints, boundVariables, explicitVariableModes, childIds. Default-valued props are omitted unless verbose. Composite instance ids (I<inst>;<child>) resolve; unknown ids land in notFound. Find ids with figma_search_nodes/figma_get_children first.

输入参数depthnodeIds必填verbose

figma_set_fills

Set fill color. Accepts hex shorthand or fills array.

输入参数fills必填nodeId必填

figma_set_strokes

Set stroke color and/or weight. Per-side weights (strokeTopWeight etc., for border-top-only dividers) work on RECTANGLE and frame-like nodes only. Omit `strokes` to change weights only.

输入参数nodeId必填strokesstrokeWeightstrokeTopWeightstrokeLeftWeightstrokeRightWeightstrokeBottomWeight

figma_create_rectangle

Create a rectangle.

输入参数xynamefillswidthheightparentId

figma_set_text

Set text content. Auto-loads fonts.

输入参数text必填nodeId必填

figma_clone_nodes

Duplicate nodes.

输入参数offsetnodeIds必填parentId

figma_delete_nodes

Delete nodes.

输入参数nodeIds必填

figma_move_nodes

Move nodes. Use relative=true for offset.

输入参数xynodeIds必填relative

figma_resize_nodes

Resize nodes to explicit pixels. To fit a child to its parent prefer figma_set_layout_align STRETCH (keeps size binds). Instance sublayers are rejected (INSTANCE_SUBLAYER_RESTRICTED): resize the master. Size binds are re-applied; the result is read back: RESIZE_NO_OP for a no-op, a clamp is a warning.

输入参数widthheightnodeIds必填

figma_set_size_limits

Set or clear minWidth/maxWidth/minHeight/maxHeight: a number sets, null clears, omit leaves it. Applies to auto-layout frames and their direct children (others get a warning). Verified by readback (LIMIT_NOT_APPLIED / LIMIT_NOT_CLEARED). A variable-bound field keeps its bound value; unbind with figma_unbind_variable.

输入参数nodeIds必填maxWidthminWidthmaxHeightminHeight

figma_set_opacity

Set opacity (0-1).

输入参数nodeId必填opacity必填

figma_set_visible

Show or hide nodes via node.visible; don't bind a BOOLEAN variable or set opacity to 0 for this.

输入参数nodeIds必填visible必填

figma_set_clips_content

Set whether frame-like nodes (FRAME, COMPONENT, COMPONENT_SET, INSTANCE, SLOT, SLIDE) clip children to their bounds; others error.

输入参数nodeIds必填clipsContent必填

figma_set_corner_radius

Set corner radius. Use individual values for asymmetric.

输入参数nodeId必填radiustopLefttopRightbottomLeftbottomRight

figma_group_nodes

Group nodes.

输入参数namenodeIds必填

figma_ungroup_nodes

Ungroup nodes.

输入参数nodeIds必填

figma_create_frame

Create a frame.

输入参数xynamefillswidthheightparentId

figma_create_text

Create a text node.

输入参数xynametextfillsfontSizeparentIdfontStylefontFamily

figma_set_selection

Set selection. Empty array clears.

输入参数nodeIds必填

figma_set_current_page

Switch to a different page in the Figma document.

输入参数pageId必填

figma_export_node

Export a node as PNG, SVG, JPG or PDF to disk and return { path, format, scale, bytes }; read the file to view it. outputPath sets the destination; returnBase64: true inlines raw data instead. To see the render in context use figma_screenshot.

输入参数scaleformatnodeId必填outputPathreturnBase64

figma_screenshot

Render a node (or the selection) as PNG and return it inline, with path, pixel size and scale. Scale is reduced to fit maxPixels (default 1,000,000); the inline image stays under 200 KB (one retry at half scale), larger renders stay on disk. Use after layout changes: readback cannot see overlap, clipping or mid-word breaks.

输入参数scaleinlinenodeIdmaxPixels

figma_compare_to_reference

Pixel-diff a built frame against a reference node. Both render at the reference's effective scale; returns mismatchPercent, a per-quadrant breakdown (tl/tr/bl/br), the size delta and paths to the diff/ref/built PNGs. A mismatch in one quadrant usually means one misplaced element.

输入参数scalemaxPixelsrefNodeId必填thresholdinlineDiffbuiltNodeId必填

figma_export_batch

Export many nodes in one call, each at a scale or targetWidth (scale = targetWidth / node width, clamped 0.01–4). Files go to outputDir (default: a fresh folder under ~/.deskhand/exports/) named by namePattern with tokens {name} {id} {scale} {ext} {index}. One row per item (path and size, or an error); nothing is inlined.

输入参数items必填outputDirnamePattern

figma_resolve_icon

Check icon concepts against the bundled Lucide set before drawing anything; never hand-draw glyphs. Aliases resolve (close → x), then exact names; otherwise you get real-name suggestions: pick one, do not invent. Insert with figma_place_icon or bridge.icon.

输入参数concepts必填

figma_place_icon

Insert a Lucide icon as a vector frame named icon/<concept>. Resolves like figma_resolve_icon. Appended to parentId (or the current page) at x/y, scaled and stroked.

输入参数xysizecolorconcept必填parentId

figma_place_chrome

Insert an iOS chrome template (status-bar 393×54, home-indicator 393×34, keyboard 393×291), named chrome/<kind>. With parentId it scales to the parent width, top or bottom unless y is given.

输入参数ykind必填themeparentId

figma_review_screen

Per-screen quality gate: lint one frame → { pass, findings, counts, fixes }; a finding carries its own fix only when it differs from fixes[code]. Errors: invisible text, overflow, zero-size, collapsed auto-layout, low contrast. Warnings: misaligned rows, hand-drawn icons, placeholder avatars, raw fills/text, detached instances. Capped at 200, errors first.

输入参数checksnodeId必填

figma_brand_styles

Read the brand the open file already defines: local paint/text/effect styles, every component and set (keys, variant properties, all pages) and common frame sizes; samples fills and fonts when there are no styles. Use its colours, type and components in everything you build. Cached under ~/.deskhand/brands/ so bridge.instance(name) can import components later.

无需输入参数。

figma_set_image_fill

Fill a node with an image from an absolute path (~/ allowed) or http(s) URL: PNG, JPEG, GIF or WebP, up to 4096 px per side and 20 MB. Replaces the fills with one IMAGE fill. Use for photos, avatars and reference art instead of placeholder shapes; bridge.image does the same in scripts.

输入参数nodeId必填source必填scaleMode

figma_snapshot

Save a restorable copy of a node before a risky edit: cloned onto a "🗄 Bridge Snapshots" page with parent/index/position recorded. Keeps the newest 10 per file. Restore with figma_restore_snapshot or bridge.snapshot() in scripts.

输入参数labelnodeId必填

figma_restore_snapshot

Undo to a snapshot: removes the current node (if present) and moves the saved clone back to its recorded parent/index/position/name. New id: restoredId — update ids you held. Snapshot is consumed. SNAPSHOT_NOT_FOUND if unknown or the clone was deleted.

输入参数snapshotId必填

figma_list_snapshots

List saved snapshots in this file, newest first, with whether each clone still exists. Returns { count, page, snapshots }.

无需输入参数。

figma_get_design_rules

One cookbook section as markdown: rules plus a runnable figma_execute recipe. Sections: helpers, auto-layout, components, variants, text, lint, jobs, reference-match. Read it before building that kind of thing. Whole cookbook: skill://deskhand/COOKBOOK.md. Needs no plugin.

输入参数section必填

figma_create_ellipse

Create ellipse. Use arcData for arcs/rings.

输入参数xynamefillswidthheightarcDataparentId

figma_set_effects

Set effects. Replaces existing.

输入参数nodeId必填effects必填

figma_set_auto_layout

Configure auto-layout on a frame: direction, sizing modes, alignment, padding, spacing, wrap. Size variable binds are captured and re-applied (rebound/warnings). See skill://deskhand/SKILL.md.

输入参数nodeId必填layoutModelayoutWrappaddingTopitemSpacingpaddingLeftpaddingRightpaddingBottomcounterAxisSpacingcounterAxisAlignItemscounterAxisSizingModeprimaryAxisAlignItems另有 1 个

figma_get_local_styles

List all local styles (colors, text, effects, grids). To find specific styles by name use figma_search_styles: fewer tokens.

输入参数typelimitoffsetverbose

figma_apply_style

Apply a local style (paint, text, stroke, effect, grid) to a node using Figma's async setters. The applied id is read back: appliedStyleId with verified: true, or STYLE_NOT_APPLIED.

输入参数nodeId必填styleId必填property必填

figma_create_component

Create a component.

输入参数xynamefillswidthheightparentIdfromNodeIddescription

figma_create_instance

Create a component instance.

输入参数xynameparentIdcomponentId必填

figma_get_local_variables

All local variables and collections: types (COLOR, FLOAT, STRING, BOOLEAN), modes, values. Paged: limit (default 100) and offset; next gives the following page.

输入参数typelimitoffset

figma_search_variables

Search variables by name pattern (e.g. "tailwind/orange/*"). Compact results, far fewer tokens than figma_get_local_variables.

输入参数typelimitoffsetcompactnamePatternnameContainscollectionName

figma_search_nodes

Search nodes by name within a scope (parentId required). Preferred for finding frames, sections or elements; compact results (~50 tokens/node).

输入参数limittypesoffsetcompactmaxDepthparentId必填namePatternnameContains

figma_search_components

Search local components by name. Returns compact metadata.

输入参数limitoffsetcompactnamePatternnameContainsincludeVariants

figma_search_styles

Search local styles by name; cheaper than figma_get_local_styles.

输入参数typelimitoffsetcompactnameContains

figma_get_children

Immediate children of a node — more efficient than figma_get_nodes for browsing hierarchy. Default limit 100, with truncated/next for paging. Compact results include x/y for layout. Composite instance-sublayer parent IDs resolve too.

输入参数limitoffsetcompactparentId必填

figma_set_variable

Set a variable's value for a mode, or bind it to a node property or local style (styleId + field). Text styles bind font/spacing fields; paint styles bind 'paints'. Verified by readback (BIND_NOT_APPLIED otherwise). width/height on an instance sublayer: INSTANCE_SUBLAYER_RESTRICTED, bind the master.

输入参数fieldvaluemodeIdnodeIdstyleIdpaintIndexvariableId必填

figma_create_line

Create a line.

输入参数xynamelengthstrokesparentIdrotationstrokeCapstrokeWeight

figma_set_constraints

Set resize constraints on a node: how it resizes when its parent frame resizes. Only for nodes inside frames (not auto-layout frames).

输入参数nodeId必填verticalhorizontal

figma_detach_instance

Detach an instance into a regular frame: keeps overrides, severs the link to the main component.

输入参数nodeId必填

figma_set_layout_align

Set how a child behaves in an auto-layout frame: alignment (STRETCH), growth (fill container) and absolute positioning.

输入参数nodeId必填layoutGrowlayoutAlignlayoutPositioning

figma_rename_node

Rename one or more nodes (a batch shares one name).

输入参数name必填nodeIdnodeIds

figma_reorder_node

Change a node's z-order among its siblings. position is the FINAL index (0 = back/bottom, childCount-1 = front/top); 'back' and 'front' also work. Out-of-range values are clamped. Verified by readback (REORDER_FAILED otherwise). Children of instances cannot be reordered (INSTANCE_SUBLAYER_RESTRICTED): reorder on the master.

输入参数nodeId必填position必填

figma_set_text_style

Set text font properties.

输入参数nodeId必填fontSizetextCasefontStylefontFamilylineHeightletterSpacingtextDecorationtextAlignVerticaltextAlignHorizontal

figma_create_paint_style

Create a paint style.

输入参数name必填fills必填description

figma_create_text_style

Create a text style.

输入参数name必填fontSizetextCasefontStylefontFamilylineHeightdescriptionletterSpacingtextDecoration

figma_delete_style

Delete a local style (paint, text, effect or grid). Library styles return REMOTE_STYLE. Nodes keep their resolved values but lose the link.

输入参数styleId必填

figma_create_variable_collection

Create a variable collection.

输入参数name必填modes

figma_create_variable

Create a variable in a collection.

输入参数name必填type必填valuescopesaliasOfdescriptioncollectionId必填

figma_rename_variable

Rename a variable; "/" makes groups.

输入参数name必填variableId必填

figma_delete_variables

Delete variables. Cannot be undone.

输入参数variableIds必填

figma_delete_variable_collection

Delete a variable collection and all its variables. Cannot be undone.

输入参数collectionId必填

figma_rename_variable_collection

Rename a variable collection.

输入参数name必填collectionId必填

figma_rename_mode

Rename a mode in a variable collection.

输入参数name必填modeId必填collectionId必填

figma_add_mode

Add a new mode to a variable collection.

输入参数name必填collectionId必填

figma_delete_mode

Delete a mode from a variable collection. Cannot delete the last mode.

输入参数modeId必填collectionId必填

figma_set_variable_mode

Pin an explicit variable mode on nodes or pages (e.g. a mobile frame pinned to the Spacing collection's mobile mode), or clear: true to unpin. Works on scene nodes and page ids. Echoes explicitVariableModes ({} = nothing pinned).

输入参数clearmodeIdnodeIds必填collectionId必填

figma_unbind_variable

Remove a variable binding from a node property, verified by readback (UNBIND_FAILED otherwise). For minWidth/maxWidth/minHeight/maxHeight the leftover literal clamp is cleared too (previousLiteral, clearedLiteral).

输入参数field必填nodeId必填paintIndex

figma_create_page

Create a page. Figma Design only: FigJam returns FIGMA_DESIGN_ONLY (create FigJam pages in its UI).

输入参数name必填index

figma_rename_page

Rename a page.

输入参数name必填pageId必填

figma_delete_page

Delete a page. The last page cannot be deleted.

输入参数pageId必填

figma_reparent_nodes

Move nodes to a different parent.

输入参数indexnodeIds必填newParentId必填

figma_move_to_page

Move nodes from their current page to a different page.

输入参数xynodeIds必填targetPageId必填

figma_swap_instance

Swap an instance to a different component, keeping position and size.

输入参数instanceId必填newComponentId必填

figma_duplicate_page

Clone a page and its contents, inserted after the original. Figma Design only (FIGMA_DESIGN_ONLY in FigJam).

输入参数namepageId必填

figma_set_rotation

Rotate nodes by degrees. pivot 'center' (default) keeps the visual centre in place; 'top-left' is Figma's raw rotation, which moves the centre. Children of auto-layout parents (unless ABSOLUTE) cannot use a centre pivot: they get top-left plus a warning. Echoes appliedPivot, rotation and absoluteBoundingBox.

输入参数pivotnodeIds必填rotation必填

figma_combine_as_variants

Combine components into a variant set; names must use variant naming (e.g. "Size=Large").

输入参数componentIds必填

figma_create_sticky

FigJam only: create a sticky note (fixed 240×240). Author name/visibility are set by Figma and cannot be changed.

输入参数xytextfillsparentIdisWideWidth

figma_set_sticky

FigJam only: toggle a sticky between square and wide. Use figma_set_text for body text.

输入参数nodeId必填isWideWidth

figma_create_shape_with_text

FigJam only: flowchart shape with embedded text (30 shape types; cornerRadius is fixed).

输入参数xytextfillswidthheightstrokesparentIdshapeType必填strokeWeight

figma_set_shape_type

FigJam only: change the shape type of a shape-with-text node.

输入参数nodeId必填shapeType必填

figma_create_connector

FigJam only: connector (arrow) between two nodes. Endpoints attach via magnets (AUTO recommended), fixed positions, or float free. Default end cap ARROW_EQUILATERAL. STRAIGHT only supports CENTER/NONE magnets.

输入参数endtextstartendCapstrokeslineTypeparentIdstartCapstrokeWeight

figma_set_connector

FigJam only: modify an existing connector's endpoints, line type, end caps, or label.

输入参数endtextstartendCapnodeId必填lineTypestartCap

figma_create_section

Create a labeled section (works in both Figma Design and FigJam) to group content. Supports dev status (READY_FOR_DEV/COMPLETED).

输入参数xynamefillswidthheightparentIddevStatusdevStatusDescriptionsectionContentsHidden

figma_set_section

Update a section's name, dev status, or content visibility. Pass devStatus: null to clear.

输入参数namenodeId必填devStatusdevStatusDescriptionsectionContentsHidden

figma_create_table

FigJam only: create a table (default 2×2), optionally seeded via cells.

输入参数xycellsfillsnumRowsparentIdnumColumns

figma_set_table_cell

FigJam only: set the text and/or fill color of a single table cell.

输入参数row必填textfillscolumn必填nodeId必填

figma_insert_table_row

FigJam only: insert a row at the given index (existing rows at and after the index shift down).

输入参数nodeId必填rowIndex必填

figma_insert_table_column

FigJam only: insert a column at the given index (existing columns at and after the index shift right).

输入参数nodeId必填columnIndex必填

figma_remove_table_row

FigJam only: remove the row at the given index.

输入参数nodeId必填rowIndex必填

figma_remove_table_column

FigJam only: remove the column at the given index.

输入参数nodeId必填columnIndex必填

figma_resize_table_row

FigJam only: set the height of a table row.

输入参数height必填nodeId必填rowIndex必填

figma_resize_table_column

FigJam only: set the width of a table column.

输入参数width必填nodeId必填columnIndex必填

figma_move_table_row

FigJam only: move a row from one index to another.

输入参数nodeId必填toIndex必填fromIndex必填

figma_move_table_column

FigJam only: move a column from one index to another.

输入参数nodeId必填toIndex必填fromIndex必填

figma_create_code_block

FigJam only: create a syntax-highlighted code block.

输入参数xycode必填parentIdcodeLanguage

figma_set_code_block

FigJam only: update an existing code block's code text or language.

输入参数codenodeId必填codeLanguage

figma_get_reactions

Prototype (Figma Design only): get a node's reactions (trigger and action details).

输入参数nodeId必填

figma_add_reaction

Prototype (Figma Design only): add an interaction to a node; existing reactions are kept.

输入参数action必填nodeId必填trigger必填

figma_remove_reaction

Prototype (Figma Design only): remove a reaction by its zero-based index; find it with figma_get_reactions first.

输入参数index必填nodeId必填

figma_set_flow_starting_point

Prototype (Figma Design only): set a top-level frame as a flow starting point on the page, or clear it. Stored page-level as { nodeId, name } entries.

输入参数clearnodeId必填flowName

版本历史

1
  1. v1.0.1最新Nov 1, 2026

评分

已满足适用检查项的 65%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分

    请声明包含 README 的 GitHub 仓库,或在 OAuth 受保护资源元数据中提供 resource_documentation。

  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。