
Apply Design System
Skill把已有的 Figma 设计重新接回已发布的设计系统组件:先备份画框,逐个区块判断已接入、可直接替换、需用基础组件重组还是无法处理,再一次只改一个区块,替换掉脱离组件的图层、本地封装与一次性组件。需要 Figma MCP 的读写能力。
name: apply-design-system
description: Review an existing design and connect it to design system components.
Connect A Design To A Design System
Use this skill for an existing Figma design that should reuse a published design system instead of detached layers, local wrappers, or one-off components.
This skill supports two entry modes:
review-then-apply: the user wants a broad pass, but the exact offending sections are not yet identifiedapply-known-scope: the user already knows which sections or clusters should be brought onto the design system
Load these capabilities first:
- Figma MCP read access for tools such as
get_metadata,get_screenshot, andsearch_design_system - a
figma-use-style helper before anyuse_figmacall, when your environment requires one - a screen-building companion workflow, when available, if you are reconnecting a full screen or page
Do not use this skill as the default follow-up to a single audit-design-system finding. For one targeted issue, use fix-design-system-finding so the write scope stays narrow.
Core Rule
Do not treat a section as "connected" just because it contains a few design-system buttons or icons.
This skill is for multi-section reconciliation. If the task can be satisfied by fixing one specific reviewed node, the narrower finding-fix skill is the better choice.
Classify each section into exactly one bucket:
already-connected: the section itself is a library instance or a composition the user explicitly accepts as already canonicalexact-swap: a published library component or variant can replace the section directlycompose-from-primitives: no single library component exists, but the section can be rebuilt from published library primitivesblocked: the library does not expose the needed components, imports fail, or the section is intentionally bespoke
Required Workflow
1. Determine Scope First
Before gathering replacement candidates, decide whether the screen needs an initial audit.
If scope is not already identified:
- Run audit-design-system or perform an equivalent internal audit pass.
- Collapse the review output into section-sized work packages instead of treating every micro-finding as a separate rewrite task.
- If the review produces only one narrow finding, switch to fix-design-system-finding instead of continuing here.
If scope is already identified, continue directly.
Do not skip component discovery just because a review already exists. Review identifies drift; this skill still has to choose the actual replacement primitives and variants.
2. Capture the Current State
Before writing:
- Get the target frame metadata with
get_metadata. - Get a screenshot with
get_screenshot. - If you need
get_design_contextand Figma asks the Code Connect question, ask the user exactly as instructed by the tool before proceeding.
For this skill, prefer get_metadata plus use_figma for structure discovery. get_design_context is optional unless it unlocks missing context.
3. Back Up the Target Screen
Before destructive edits, duplicate the frame or page and place the backup to the right.
Name it clearly, for example:
Backup - StartBackup - Mobile dashboard
Do this in its own use_figma call and return the created node ID.
4. Inventory the Existing Screen
Inspect the target frame before searching the library.
Use use_figma to gather:
- top-level section instances
- each section's
mainComponent - whether that component is local, remote, or missing
- nested published components already used inside each local wrapper
- exposed text and variant properties when present
Prefer exact keys over names. Names are only hints.
Useful read-only inventory pattern:
(async () => {
try {
await figma.setCurrentPageAsync(figma.root.children.find(p => p.id === "PAGE_ID"));
const frame = await figma.getNodeByIdAsync("FRAME_ID");
const sections = frame.findAll(n => n.type === "INSTANCE").map(inst => {
const mc = inst.mainComponent;
const cs = mc?.parent?.type === "COMPONENT_SET" ? mc.parent : null;
return {
instanceId: inst.id,
instanceName: inst.name,
componentName: mc?.name ?? null,
componentKey: mc?.key ?? null,
componentSetName: cs?.name ?? null,
componentSetKey: cs?.key ?? null,
};
});
figma.closePlugin(JSON.stringify({ createdNodeIds: [], mutatedNodeIds: [], sections }));
} catch (e) {
figma.closePluginWithFailure(e.message);
}
})()
5. Build a Component Map From the Design System
Prefer authoritative sources in this order:
- Existing screens in the same library or workfile that already use the system
- Known library pages inspected directly with
use_figma search_design_systemas a fallback only
When using search_design_system, remember:
- results may include unrelated team or community libraries
- broad queries are useful for discovery, but do not trust them without verifying the actual file or page
- once the right library is known, prefer direct inspection of that file over repeated search calls
For each candidate, capture:
- component or component-set key
- exact variant name
- whether the section is a one-to-one swap or a composition
- text property keys or nested instance properties needed for overrides
Do not default blindly to the library's primary or default variant.
Before choosing a variant, inspect the original node for:
- semantic cues from the name, copy, and usage context
- visual cues such as fills, strokes, effects, corner radius, and typography treatment
- existing variant-like traits already visible in the screen, such as primary vs secondary button treatment
Then compare those cues against the available component-set variants and choose the closest match. If the family is correct but the variant match is ambiguous, call that out instead of silently using the default variant.
6. Decide Section Strategy
Use these heuristics:
exact-swapif a library component matches the section's job and structure closely enough thatswapComponent()or a direct replacement preserves intent.compose-from-primitivesif the section is really a container around library pieces such as avatar, badge, buttons, metrics, or nav items.blockedif the design system lacks the composite, the library is not published, imports fail, or the section should remain bespoke.
Common patterns:
- Header summary blocks are often
compose-from-primitives, not one component. - Alerts and metrics often have strong
exact-swapcandidates. - Appointment or patient cards often require composition unless the system explicitly ships those domain cards.
- Bottom nav bars are frequently custom containers built from nav-item primitives.
7. Update One Section At A Time
Never rewrite the entire screen in one script.
For each section:
- Read the current node IDs.
- Import or locate the library component.
- Match the closest variant to the original section before swapping or rebuilding.
- Detect whether the parent uses auto-layout.
- Create or swap only that section.
- Return all mutated node IDs.
- Validate with
get_screenshot.
Prefer swapComponent() when the existing node is already an instance of a compatible family and you want to preserve overrides.
Prefer rebuilding beside the original when:
- the old section is a local wrapper around mixed content
- you need to compare the result visually before replacing the original
- you are composing from multiple primitives
When the parent is not auto-layout, treat replacement as a layout-risk operation.
For non-auto-layout parents:
- preserve
xandyexplicitly - preserve width and height explicitly when the replacement should occupy the same footprint
- do not assume the new instance will inherit the old node's position or size
- warn the user that absolute-positioned or grouped parents can cause drift after swaps or rebuilds
- suggest converting the parent to auto-layout only when the user wants structural cleanup, not as the default move
8. Handle Import Failures Explicitly
If importComponentSetByKeyAsync() or importComponentByKeyAsync() fails or times out:
- Stop.
- Do not continue making unrelated edits and pretend the section is connected.
- Check whether exact component keys already exist elsewhere in the target file.
- If the library file is accessible, verify the exact component key there.
- Try importing the exact component key instead of the component-set key.
- If imports still fail, mark the section
blockedand report the blocker clearly.
Treat these as real blockers:
- published key exists in the library but import times out
search_design_systemfinds the family, but the target file cannot import it- only nested primitives can be imported, not the intended composite
9. Validate What Actually Changed
After each section:
- screenshot the changed section, not only the full frame
- confirm placeholder text is gone
- confirm the instance is really linked to a library component
- confirm spacing did not regress
At the end, validate the full screen screenshot as well.
Writing Rules
- Work incrementally and preserve a backup.
- Prefer direct library inspection over noisy search results.
- Prefer exact component keys over names.
- Match the variant to the original visual treatment, not just the correct component family.
- Preserve position and size explicitly when replacing content inside non-auto-layout parents.
- Use imperative evidence in the report: node names, keys, component families, and whether the final node is local or library-backed.
- Do not claim full reconnection when the result is still a local shell around a few shared children.
- If a section must remain bespoke, say so and explain why.
Deliverable Format
When closing the task, report:
Swapped: sections replaced directly with library instancesComposed: sections rebuilt from library primitivesAlready connected: sections that were already validBlocked: sections that could not be connected, with the concrete reason
If everything is blocked, say that plainly and include the exact failure mode instead of a vague summary.
相关资源

Create Anatomy
Skill在 Figma 里为组件生成结构解剖标注:在组件实例上放置编号标记并填写属性表,再为每个子组件单独生成一节,列出包括隐藏元素在内的内部结构。属于 uSpec 技能集,需要 create-component-md 生成的组件 .md 规格、Figma MCP,以及在 uspecs.config.json 中配置好的模板。
redongreen/uSpec251
Audit Design System
Skill只读审查 Figma 页面或组件与设计系统脱节的地方:用普通框架手搭的共享组件、本应合并的重复结构、未绑定变量的硬编码颜色与间距、变体走样等,每条发现都要有 Figma 结构上的证据,可附建议替换的组件,输出 Markdown 或 JSON。需要 Figma MCP。
edenspiekermann/Skills68
Fix Design System Finding
Skill针对设计系统审查给出的单条问题修复 Figma 设计:先判断能否干净地修,只备份受影响的节点,再按替换组件实例、用基础组件重组、绑定变量或对齐变体中的一种方式做最小改动,并只验证这一处;做不到就标为受阻。需要 Figma MCP。
edenspiekermann/Skills68
figma-generate-design
Skill把代码里的页面、弹窗、侧栏等界面或文字描述,搭建成 Figma 画布上可编辑的设计稿,优先复用文件里已发布设计系统的组件与变量。Figma 官方维护,需连接 Figma 远程 MCP 服务器,并同时安装 figma-use 技能。
figma/mcp-server-guide2.2k
Figma Design to Code
Skill把 Figma 设计稿还原成项目里的生产代码:以设计截图为视觉目标,优先复用已有组件、设计变量与 Code Connect 映射。Figma 官方维护,需连接 Figma MCP 服务(免费计划每月仅 6 次调用)。
figma/mcp-server-guide2.2k
Figma Skills (mcp-server-guide)
SkillFigma 官方技能合集:把设计稿还原成代码、用 Code Connect 映射组件、从代码生成设计系统组件库、在画布上搭建页面和 FigJam 图表。需连接 Figma MCP 服务器;写入画布目前处于 Beta 阶段,暂时免费。
figma/mcp-server-guide2.2k