npx claudepluginhub markacianfrani/claude-code-figma --plugin figma-friendWant just this skill?
Then install: npx claudepluginhub u/[userId]/[slug]
Interact with Figma to assist with design tasks.
This skill is limited to using the following tools:
Figma Designer Skill
This skill allows you to interact with Figma to assist with various design tasks.
Instructions
You'll be interacting with Figma via the web browser. First, you'll want to
- Use the
navigate_pagetool to go to Figma's website. Then, prompt the user to log in to their Figma account if they are not already logged in and open a specific design file. - Once the user has opened the design file, you can use the
evaluate_scriptto confirm that you have access to the figma global object, which indicates that you are within the Figma environment. If you do not have access, inform the user that they need to open a Figma design file or see <troubleshooting> - After confirming access, execute the user's query using the
evaluate_scripttool to run JavaScript code that interacts with the Figma plugin API. You can perform tasks such as creating shapes, modifying properties, or extracting information from the design file.
Rules of Engagement
- Always explain in plain english what you are about to do. Assume that the user cannot read code.
- Do not try to alternative solutions like using the REST API or manually interacting with the Figma UI
Slots API
Slots are a component property type that creates flexible placeholder areas inside components. Designers can add, edit, and arrange content in instances without detaching.
Note: As of March 2026, the Slots API is undocumented in the official plugin API reference. The ComponentPropertyType docs still only list BOOLEAN, TEXT, INSTANCE_SWAP, and VARIANT — but the runtime fully supports SLOT.
Creating Slots
// On a ComponentNode:
const slot = component.createSlot(); // empty slot, auto-named "Slot"
const slot = component.createSlot(frame); // converts existing frame child to a slot
createSlot() returns a SlotNode (type: "SLOT"). It behaves like a frame — it has all layout, fill, stroke, corner radius, and sizing properties.
SlotNode Properties
A slot supports the same properties as a FrameNode:
- Layout:
layoutMode,primaryAxisSizingMode,counterAxisSizingMode,paddingTop/Right/Bottom/Left,itemSpacing - Sizing:
width,height,layoutSizingHorizontal,layoutSizingVertical,minWidth,minHeight,maxWidth,maxHeight - Appearance:
fills,strokes,cornerRadius,clipsContent,effects - Children:
appendChild(),insertChild(),children - Variables:
setBoundVariable(),boundVariables
Slot-specific:
resetSlot()— resets the slot to its default content (on instances)
Slots as Component Properties
Slots register as component property definitions with type: "SLOT":
component.componentPropertyDefinitions
// → { "Content#99:0": { type: "SLOT", description: null, preferredValues: [] } }
Edit description and preferred values via:
component.editComponentProperty('Content#99:0', {
description: 'Main content area',
preferredValues: [
{ type: 'COMPONENT', key: 'someComponentKey' },
{ type: 'COMPONENT_SET', key: 'someSetKey' }
]
});
Common Patterns
Empty collapsible slot — hug-sizes to nothing when empty, expands when content is added:
const slot = component.createSlot();
slot.name = 'prefix';
slot.fills = [];
slot.layoutMode = 'HORIZONTAL';
slot.primaryAxisSizingMode = 'AUTO';
slot.counterAxisSizingMode = 'AUTO';
// After inserting into an auto-layout parent:
slot.layoutSizingHorizontal = 'HUG';
slot.layoutSizingVertical = 'HUG';
Fixed-size icon slot — constrains content to a specific size:
const slot = component.createSlot();
slot.name = 'icon';
slot.fills = [];
slot.layoutMode = 'HORIZONTAL';
slot.primaryAxisAlignItems = 'CENTER';
slot.counterAxisAlignItems = 'CENTER';
slot.resize(16, 16);
slot.clipsContent = true;
// After inserting into auto-layout parent:
slot.layoutSizingHorizontal = 'FIXED';
slot.layoutSizingVertical = 'FIXED';
Important: layoutSizingHorizontal = 'HUG' requires the slot to have layoutMode set (making it an auto-layout frame) AND to be a child of an auto-layout parent. Set layoutMode and insert into the parent before setting HUG/FILL sizing.
Slotted Content Color Theming
Slots don't inherit or force color on their children. To make icons/content adopt the right color per component variant, use variable modes:
- Create a theming variable collection with one mode per variant
- Add an
icon-colorvariable that aliases to the correct text color per mode - Set
setExplicitVariableModeForCollection()on each variant frame - Bind icon component fills to the
icon-colorvariable
// Create theming collection
const themeCollection = figma.variables.createVariableCollection('Component / Button Theme');
const primaryMode = themeCollection.modes[0].modeId;
themeCollection.renameMode(primaryMode, 'primary');
const secondaryMode = themeCollection.addMode('secondary');
// Create the icon-color variable
const iconColor = figma.variables.createVariable('icon-color', themeCollection, 'COLOR');
iconColor.setValueForMode(primaryMode, { type: 'VARIABLE_ALIAS', id: whiteVar.id });
iconColor.setValueForMode(secondaryMode, { type: 'VARIABLE_ALIAS', id: tealVar.id });
// Apply modes to variants
primaryVariant.setExplicitVariableModeForCollection(themeCollection, primaryMode);
secondaryVariant.setExplicitVariableModeForCollection(themeCollection, secondaryMode);
// Bind icon fill to the variable
const fills = iconNode.fills;
fills[0].boundVariables = { color: { type: 'VARIABLE_ALIAS', id: iconColor.id } };
iconNode.fills = fills;
Icons bound to icon-color will resolve to white inside primary variants, teal inside secondary, etc.
Additional Documentation
The full reference to the Figma plugin API can be found here: Figma Plugin API Documentation.
Similar Skills
Expert guidance for Next.js Cache Components and Partial Prerendering (PPR). **PROACTIVE ACTIVATION**: Use this skill automatically when working in Next.js projects that have `cacheComponents: true` in their next.config.ts/next.config.js. When this config is detected, proactively apply Cache Components patterns and best practices to all React Server Component implementations. **DETECTION**: At the start of a session in a Next.js project, check for `cacheComponents: true` in next.config. If enabled, this skill's patterns should guide all component authoring, data fetching, and caching decisions. **USE CASES**: Implementing 'use cache' directive, configuring cache lifetimes with cacheLife(), tagging cached data with cacheTag(), invalidating caches with updateTag()/revalidateTag(), optimizing static vs dynamic content boundaries, debugging cache issues, and reviewing Cache Component implementations.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.