بنقرة واحدة
apply-design-system
Review an existing design and connect it to design system components.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Review an existing design and connect it to design system components.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
Audit a Figma screen or component for design-system integration drift, including missing shared components, local overrides, and unbound tokens.
Fix a specific design-system integration finding in a Figma screen or component, including missing shared components, local overrides, and unbound tokens.
استنادا إلى تصنيف SOC المهني
| name | apply-design-system |
| description | Review an existing design and connect it to design system components. |
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 systemLoad these capabilities first:
get_metadata, get_screenshot, and search_design_systemfigma-use-style helper before any use_figma call, when your environment requires oneDo 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.
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 bespokeBefore gathering replacement candidates, decide whether the screen needs an initial audit.
If scope is not already identified:
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.
Before writing:
get_metadata.get_screenshot.get_design_context and 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.
Before destructive edits, duplicate the frame or page and place the backup to the right.
Name it clearly, for example:
Backup - StartBackup - Mobile dashboardDo this in its own use_figma call and return the created node ID.
Inspect the target frame before searching the library.
Use use_figma to gather:
mainComponentPrefer 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);
}
})()
Prefer authoritative sources in this order:
use_figmasearch_design_system as a fallback onlyWhen using search_design_system, remember:
For each candidate, capture:
Do not default blindly to the library's primary or default variant.
Before choosing a variant, inspect the original node for:
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.
Use these heuristics:
exact-swap if a library component matches the section's job and structure closely enough that swapComponent() or a direct replacement preserves intent.compose-from-primitives if the section is really a container around library pieces such as avatar, badge, buttons, metrics, or nav items.blocked if the design system lacks the composite, the library is not published, imports fail, or the section should remain bespoke.Common patterns:
compose-from-primitives, not one component.exact-swap candidates.Never rewrite the entire screen in one script.
For each section:
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:
When the parent is not auto-layout, treat replacement as a layout-risk operation.
For non-auto-layout parents:
x and y explicitlyIf importComponentSetByKeyAsync() or importComponentByKeyAsync() fails or times out:
blocked and report the blocker clearly.Treat these as real blockers:
search_design_system finds the family, but the target file cannot import itAfter each section:
At the end, validate the full screen screenshot as well.
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 reasonIf everything is blocked, say that plainly and include the exact failure mode instead of a vague summary.