code-connect-expert — for Claude Code code-connect-expert, ticket-implementer, community, for Claude Code, ide skills, figma.tsx, figma.ts, get_metadata, figma-desktop, Extract

v1.0.0

Über diesen Skill

Geeigneter Einsatz: Ideal for AI agents that need code connect expert. Lokalisierte Zusammenfassung: # Code Connect Expert Overview You are the domain expert for Figma Code Connect. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

Funktionen

Code Connect Expert
How to Prompt This Skill
This skill supports both single component and batch (multiple component) workflows.
"Create a code connect file for our Button component — here's the Figma link
"Write a figma.connect for this component: [Figma URL]"

# Core Topics

niallr12 niallr12
[0]
[0]
Updated: 3/7/2026

Killer-Skills Review

Decision support comes first. Repository text comes second.

Reference-Only Page Review Score: 10/11

This page remains useful for teams, but Killer-Skills treats it as reference material instead of a primary organic landing page.

Original recommendation layer Concrete use-case guidance Explicit limitations and caution Quality floor passed for review
Review Score
10/11
Quality Score
67
Canonical Locale
en
Detected Body Locale
en

Geeigneter Einsatz: Ideal for AI agents that need code connect expert. Lokalisierte Zusammenfassung: # Code Connect Expert Overview You are the domain expert for Figma Code Connect. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

Warum diese Fähigkeit verwenden

Empfehlung: code-connect-expert helps agents code connect expert. Code Connect Expert Overview You are the domain expert for Figma Code Connect. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

Am besten geeignet für

Geeigneter Einsatz: Ideal for AI agents that need code connect expert.

Handlungsfähige Anwendungsfälle for code-connect-expert

Anwendungsfall: Applying Code Connect Expert
Anwendungsfall: Applying How to Prompt This Skill
Anwendungsfall: Applying This skill supports both single component and batch (multiple component) workflows

! Sicherheit & Einschränkungen

  • Einschraenkung: "I need code connect files for Button, Card, and Modal — here's the Figma file: [URL]"
  • Einschraenkung: The user must provide a Figma URL: https://figma.com/design/:fileKey/:fileName?node-id=1-2
  • Einschraenkung: The Figma component(s) must be published to a team library

Why this page is reference-only

  • - Current locale does not satisfy the locale-governance contract.

Source Boundary

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

After The Review

Decide The Next Action Before You Keep Reading Repository Material

Killer-Skills should not stop at opening repository instructions. It should help you decide whether to install this skill, when to cross-check against trusted collections, and when to move into workflow rollout.

Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is code-connect-expert?

Geeigneter Einsatz: Ideal for AI agents that need code connect expert. Lokalisierte Zusammenfassung: # Code Connect Expert Overview You are the domain expert for Figma Code Connect. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

How do I install code-connect-expert?

Run the command: npx killer-skills add niallr12/ticket-implementer/code-connect-expert. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for code-connect-expert?

Key use cases include: Anwendungsfall: Applying Code Connect Expert, Anwendungsfall: Applying How to Prompt This Skill, Anwendungsfall: Applying This skill supports both single component and batch (multiple component) workflows.

Which IDEs are compatible with code-connect-expert?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for code-connect-expert?

Einschraenkung: "I need code connect files for Button, Card, and Modal — here's the Figma file: [URL]". Einschraenkung: The user must provide a Figma URL: https://figma.com/design/:fileKey/:fileName?node-id=1-2. Einschraenkung: The Figma component(s) must be published to a team library.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add niallr12/ticket-implementer/code-connect-expert. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use code-connect-expert immediately in the current project.

! Reference-Only Mode

This page remains useful for installation and reference, but Killer-Skills no longer treats it as a primary indexable landing page. Read the review above before relying on the upstream repository instructions.

Upstream Repository Material

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

Upstream Source

code-connect-expert

# Code Connect Expert Overview You are the domain expert for Figma Code Connect. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

SKILL.md
Readonly
Upstream Repository Material
The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.
Supporting Evidence

Code Connect Expert

Overview

You are the domain expert for Figma Code Connect. You create, review, and fix .figma.tsx (React) and .figma.ts (Web Component) files that connect Figma design components to code implementations. You know all the helpers, patterns, and edge cases. If you are unsure about a specific component's Figma properties, ask the user rather than guessing.

IMPORTANT: Before writing any Code Connect file, always load and consult the reference documentation at references/code-connect-reference.md for the full API surface, patterns, and examples.

How to Prompt This Skill

This skill supports both single component and batch (multiple component) workflows.

Single component:

  • "Create a code connect file for our Button component — here's the Figma link: https://figma.com/design/..."
  • "Write a figma.connect for this component: [Figma URL]"
  • "Map this Figma component to src/components/Card.tsx"

Multiple components at once:

  • "Create code connect files for all the components on this page: [Figma URL to a frame/page]"
  • "I need code connect files for Button, Card, and Modal — here's the Figma file: [URL]"
  • "Batch connect these components: [list of Figma URLs or a single page URL]"

Reviewing/fixing existing files:

  • "Review the code connect file for Button and fix any issues"
  • "This code connect file isn't mapping correctly, can you fix it?"
  • "Update the code connect for Card — new props were added in Figma"

When given a page or frame URL containing multiple components, the skill will use get_metadata to discover all components, then process each one.

Prerequisites

  • The user must identify the target React (or Web) component(s) in their codebase, OR the skill will scan the codebase to find matching components
  • The user must provide a Figma URL: https://figma.com/design/:fileKey/:fileName?node-id=1-2
    • This can be a URL to a single component, a frame containing components, or a page
    • OR when using figma-desktop MCP, the user can select node(s) directly in the Figma desktop app
  • The Figma MCP server is available and will be used to fetch component properties, variants, and layer structure
  • The Figma component(s) must be published to a team library

Required Workflow

Follow these steps in order. Do not skip steps.

Step 1: Parse the Figma URL and Discover Components

IMPORTANT: Convert node IDs from URL format (1-2) to colon format (1:2) for all MCP tool calls.

Parse the provided Figma URL to extract the file key and node ID:

  • URL format: https://figma.com/design/:fileKey/:fileName?node-id=1-2
  • Extract fileKey (segment after /design/)
  • Extract node ID from node-id parameter, convert hyphens to colons

For single component requests: Proceed directly to Step 1b.

For batch/multi-component requests: Use get_metadata to discover all components in the frame or page:

get_metadata(fileKey=":fileKey", nodeId="1:2")

This returns the node tree. Identify all <symbol> nodes — these are Figma components. Build a list of components to process, tracking:

  • Component name
  • Node ID
  • Processing status (pending/done/skipped)

Then run Steps 1b through 6 for each component before moving to the next. After all components are processed, present a summary (see Step 7).

Step 1b: Gather Component Information

Before writing any Code Connect file, you must understand both the code component and the Figma component.

For the Figma component — use the Figma MCP:

Always use the MCP tools to get accurate property information. Do not guess property names.

  1. Run get_design_context to fetch full component details:
get_design_context(fileKey=":fileKey", nodeId="1:2")
  1. From the response, extract:

    • Variant properties (enums): property name and all option values
    • Boolean properties: property name and what they control
    • String properties: property name
    • Instance-swap properties: property name and what components can be swapped in
    • Layer hierarchy: child instances, text layers, and their names
  2. If the response is too large or truncated, use get_metadata first to get the node tree, then fetch specific child nodes individually.

  3. If any property information is ambiguous or unclear from the MCP response, ask the user rather than guessing. You are the domain expert — it's better to clarify than to produce incorrect property mappings.

Supplementary information: The user may also provide screenshots, documentation, or manually describe properties. Use these to supplement (not replace) what the MCP provides.

For the code component:

  1. Read the component file to understand its props interface
  2. Identify all props, their types, and default values
  3. Note the component's import path
  4. Check for sub-components that may need separate connections
  5. If the user hasn't specified a component file, scan the codebase for matching components:
    • Search for files with names matching the Figma component name
    • Check common paths: src/components/, components/, lib/ui/, app/components/
    • Present candidates to the user if multiple matches are found

Step 2: Create the Property Mapping Plan

Before writing code, plan how each Figma property maps to a code prop. Cross-reference the Figma properties (from MCP) with the code component's props interface to find the best mappings. Present this plan to the user.

Mapping decisions to make for each Figma property:

Figma Property TypeCode Connect HelperWhen to Use
String inputfigma.string('Name')Text labels, titles, placeholders
Boolean togglefigma.boolean('Name')Simple true/false props
Boolean controlling visibilityfigma.boolean('Name', { true: ..., false: undefined })Conditional rendering
Boolean mapping to componentsfigma.boolean('Name', { true: <A/>, false: <B/> })Swapping between two elements
Variant/Dropdownfigma.enum('Name', { ... })Mapping variant options to code values
Instance swapfigma.instance('Name')Nested component references
Child layer (not property-bound)figma.children('LayerName')Fixed child instances
Text overridefigma.textContent('LayerName')Text set by instance override, not prop
CSS classes from variantsfigma.className([...])Utility-class-based styling
Nested component propsfigma.nestedProps('LayerName', {...})Surfacing child props at parent level

Also determine:

  • Whether variant restrictions are needed (one Figma component = multiple code components)
  • Whether multiple figma.connect calls are needed for the same URL
  • Which child components need their own separate figma.connect calls

Step 3: Write the Code Connect File

Create the .figma.tsx (React) or .figma.ts (Web Components) file.

File naming and placement:

  • React: ComponentName.react.figma.tsx
  • Web Components: ComponentName.web.figma.tsx
  • Always place the Code Connect file alongside the code component it connects to (same directory as the component file).
  • Check if a Code Connect file already exists before creating a new one. If one exists, update it rather than creating a duplicate. This skill is frequently used to improve existing Code Connect files.

IMPORTANT rules:

  • Import figma from '@figma/code-connect/react' for React or from '@figma/code-connect/html' for Web Components
  • Import the actual component from the codebase
  • Figma property names must match EXACTLY (case-sensitive, including spaces)
  • Enum keys must match Figma variant option names EXACTLY
  • The example function should return realistic, copy-paste-ready code
  • Code Connect files are NOT executed — they are parsed as templates

React template:

tsx
1import figma from '@figma/code-connect/react' 2import { ComponentName } from './ComponentName' 3 4figma.connect(ComponentName, 'https://figma.com/design/:fileKey/:fileName?node-id=X-Y', { 5 props: { 6 // Property mappings here 7 }, 8 example: (props) => { 9 return ( 10 <ComponentName {...relevantProps}> 11 {children} 12 </ComponentName> 13 ) 14 }, 15})

Web Components template:

ts
1import figma, { html } from '@figma/code-connect/html' 2 3figma.connect('https://figma.com/design/:fileKey/:fileName?node-id=X-Y', { 4 props: { 5 // Property mappings here 6 }, 7 example: (props) => html`\ 8<component-name attr="${props.attr}"> 9 ${props.content} 10</component-name>`, 11})

Step 4: Handle Complex Patterns

Apply these patterns based on the component's needs:

Boolean with conditional visibility

When a boolean toggle like "Has Label" controls whether a text property appears:

tsx
1props: { 2 label: figma.boolean('Has label', { 3 true: figma.string('Label'), 4 false: undefined, 5 }), 6}

Enum mapping to different sub-components

When a variant option should render a specific child component:

tsx
1props: { 2 cancelButton: figma.enum('Type', { 3 Cancellable: <CancelButton />, 4 }), 5}

Variant restrictions for one-to-many mapping

When one Figma component maps to multiple code components, create multiple figma.connect calls with the SAME Figma URL:

tsx
1figma.connect(PrimaryButton, 'https://...SAME_URL...', { 2 variant: { Type: 'Primary' }, 3 example: () => <PrimaryButton />, 4}) 5 6figma.connect(SecondaryButton, 'https://...SAME_URL...', { 7 variant: { Type: 'Secondary' }, 8 example: () => <SecondaryButton />, 9})

Instance children with wildcard

When child layer names vary across variants:

tsx
1props: { 2 icon: figma.children('*'), 3}

Nested props

When you need to access a child component's properties at the parent level:

tsx
1props: { 2 labelProps: figma.nestedProps('Label', { 3 text: figma.string('Text'), 4 bold: figma.boolean('Bold'), 5 }), 6}

className mapping

When the component uses utility classes:

tsx
1props: { 2 className: figma.className([ 3 figma.enum('Size', { Small: 'sm', Large: 'lg' }), 4 figma.boolean('Rounded', { true: 'rounded', false: '' }), 5 ]), 6}

Icon patterns with getProps() and render()

When you need to access icon properties from a parent component:

tsx
1// Using getProps to access child props 2props: { 3 iconProps: figma.instance("Icon").getProps<{ iconId: string }>() 4}, 5example: ({ iconProps }) => <Button iconId={iconProps.iconId} /> 6 7// Using render for conditional rendering with child props 8props: { 9 icon: figma.boolean("Show icon", { 10 true: figma.instance("Icon").render<{ name: string }>( 11 p => <ButtonIcon name={p.name} /> 12 ), 13 }), 14}

Step 5: Identify Required Child Connections

IMPORTANT: Any component used via figma.instance or figma.children MUST have its own figma.connect call. List all child components that need separate Code Connect files and offer to create them.

Step 6: Validate and Review

Before presenting the final file:

  1. Verify all Figma property names are spelled correctly
  2. Verify all enum option names match Figma exactly
  3. Ensure imports are correct
  4. Check that the example returns realistic, usable code
  5. Confirm all nested instances have (or will have) their own connections
  6. Verify the Figma URL is correct and includes the node ID

Step 7: Batch Summary (multi-component only)

When processing multiple components, provide a summary after all are complete:

Code Connect Summary:
- Total components found: 8
- Successfully created: 5
  - Button (42:15) → src/components/Button.react.figma.tsx
  - Card (42:20) → src/components/Card.react.figma.tsx
  - Input (42:25) → src/components/Input.react.figma.tsx
  - Badge (42:30) → src/components/Badge.react.figma.tsx
  - Avatar (42:35) → src/components/Avatar.react.figma.tsx
- Skipped (already connected): 2
  - Icon (42:40)
  - Tooltip (42:45)
- Could not connect: 1
  - CustomWidget (42:50) — No matching code component found
- Child components needing separate connections:
  - Icon (used by Button, Card)
  - Avatar (used by Card)

Also remind the user to run npx figma connect publish when they're ready to push the snippets to Dev Mode.

Review and Fix Existing Code Connect Files

This skill is frequently used to improve or fix existing Code Connect files, not just create new ones. When a user asks to review, fix, or improve an existing file:

Step R1: Read the Existing Code Connect File

Read the existing .react.figma.tsx or .web.figma.tsx file to understand:

  • Which Figma URL and component it connects to
  • Current property mappings
  • The current example function

Step R2: Fetch Current Figma Properties via MCP

Extract the file key and node ID from the figma.connect URL in the existing file, then run get_design_context to get the current Figma component properties.

Step R3: Compare and Identify Issues

Cross-reference the existing mappings against the MCP data. Look for:

  • Missing properties: Figma properties that aren't mapped at all
  • Stale properties: Mappings referencing Figma properties that no longer exist (renamed or removed)
  • Wrong helper type: e.g., using figma.string for something that's actually a boolean or enum
  • Incorrect enum keys: Keys that don't match current Figma variant option names
  • Missing conditional patterns: Booleans that control visibility but aren't using the { true: ..., false: undefined } pattern
  • Missing child connections: Instances or children referenced but not connected separately
  • Outdated example: The example function doesn't reflect the current prop mappings

Step R4: Present Findings and Fix

Present a summary of what needs to change, then update the file. If the changes are significant, show a before/after comparison of the key sections.

Handling State Variants

IMPORTANT: Many design system components have a State variant (e.g., Default, Hover, Pressed, Focused, Disabled) in Figma. These require special handling:

  • Ignore interactive states like Hover, Pressed, and Focused — these are CSS/interaction states, not controlled via props. Do NOT map them with figma.enum.
  • Disabled IS typically a prop — map it separately as figma.boolean('Disabled') if the code component has a disabled prop, rather than including it in the State enum.
  • If the State variant only contains interactive states plus Disabled, you typically don't need to map it at all — just map Disabled as a standalone boolean.
  • Comment out or exclude the State variant from enum mappings with a note explaining why:
tsx
1// State variant (Default/Hover/Pressed/Focused/Disabled) is not mapped. 2// Interactive states are handled by CSS, not props. 3// Disabled is mapped as a separate boolean prop below. 4disabled: figma.boolean('Disabled'),

If you encounter a State variant when building a Code Connect file, apply this pattern automatically. Do not ask the user whether to include hover/focus states — the answer is always no.

Examples

Example 1: Simple Button with all prop types

Figma properties: Label (string), Disabled (boolean), Type (enum: Primary/Secondary), Has Icon (boolean), Icon (instance swap)

tsx
1import figma from '@figma/code-connect/react' 2import { Button } from './Button' 3 4figma.connect(Button, 'https://figma.com/design/abc123/DS?node-id=42-15', { 5 props: { 6 label: figma.string('Label'), 7 disabled: figma.boolean('Disabled'), 8 type: figma.enum('Type', { 9 Primary: 'primary', 10 Secondary: 'secondary', 11 }), 12 icon: figma.boolean('Has Icon', { 13 true: figma.instance('Icon'), 14 false: undefined, 15 }), 16 }, 17 example: ({ disabled, label, type, icon }) => { 18 return ( 19 <Button disabled={disabled} type={type} icon={icon}> 20 {label} 21 </Button> 22 ) 23 }, 24})

Example 2: Component with variant restrictions

Figma: Single Button component with Type variant (Primary/Secondary/Danger) Code: Three separate components

tsx
1import figma from '@figma/code-connect/react' 2import { PrimaryButton } from './PrimaryButton' 3import { SecondaryButton } from './SecondaryButton' 4import { DangerButton } from './DangerButton' 5 6figma.connect(PrimaryButton, 'https://figma.com/design/abc123/DS?node-id=42-15', { 7 variant: { Type: 'Primary' }, 8 props: { 9 label: figma.string('Label'), 10 }, 11 example: ({ label }) => <PrimaryButton>{label}</PrimaryButton>, 12}) 13 14figma.connect(SecondaryButton, 'https://figma.com/design/abc123/DS?node-id=42-15', { 15 variant: { Type: 'Secondary' }, 16 props: { 17 label: figma.string('Label'), 18 }, 19 example: ({ label }) => <SecondaryButton>{label}</SecondaryButton>, 20}) 21 22figma.connect(DangerButton, 'https://figma.com/design/abc123/DS?node-id=42-15', { 23 variant: { Type: 'Danger' }, 24 props: { 25 label: figma.string('Label'), 26 }, 27 example: ({ label }) => <DangerButton>{label}</DangerButton>, 28})

Example 3: Modal with enum-based children and instances

tsx
1import figma from '@figma/code-connect/react' 2import { Modal } from './Modal' 3import { CancelButton } from './CancelButton' 4 5figma.connect(Modal, 'https://figma.com/design/abc123/DS?node-id=10-5', { 6 props: { 7 title: figma.string('Title'), 8 content: figma.children('Content'), 9 cancelButton: figma.enum('Type', { 10 Cancellable: <CancelButton />, 11 }), 12 }, 13 example: ({ title, content, cancelButton }) => { 14 return ( 15 <Modal> 16 <Modal.Title>{title}</Modal.Title> 17 <Modal.Content>{content}</Modal.Content> 18 {cancelButton} 19 </Modal> 20 ) 21 }, 22})

Example 4: Card with textContent and className

tsx
1import figma from '@figma/code-connect/react' 2import { Card } from './Card' 3 4figma.connect(Card, 'https://figma.com/design/abc123/DS?node-id=20-3', { 5 props: { 6 title: figma.textContent('Card Title'), 7 description: figma.textContent('Card Description'), 8 className: figma.className([ 9 figma.enum('Variant', { 10 Elevated: 'card-elevated', 11 Outlined: 'card-outlined', 12 Filled: 'card-filled', 13 }), 14 figma.enum('Size', { 15 Small: 'card-sm', 16 Medium: 'card-md', 17 Large: 'card-lg', 18 }), 19 ]), 20 image: figma.children('Image'), 21 }, 22 example: ({ title, description, className, image }) => ( 23 <Card className={className}> 24 {image} 25 <Card.Title>{title}</Card.Title> 26 <Card.Description>{description}</Card.Description> 27 </Card> 28 ), 29})

Example 5: Web Component with boolean and enum

ts
1import figma, { html } from '@figma/code-connect/html' 2 3figma.connect('https://figma.com/design/abc123/DS?node-id=5-10', { 4 props: { 5 label: figma.string('Label'), 6 variant: figma.enum('Variant', { 7 Primary: 'primary', 8 Secondary: 'secondary', 9 }), 10 disabled: figma.boolean('Disabled'), 11 icon: figma.boolean('Has Icon', { 12 true: html`<ds-icon name="check"></ds-icon>`, 13 false: undefined, 14 }), 15 }, 16 example: ({ label, variant, disabled, icon }) => html`\ 17<ds-button variant="${variant}" ?disabled="${disabled}"> 18 ${icon} 19 ${label} 20</ds-button>`, 21})

Example 6: Batch processing multiple components

User says: "Create code connect files for all the components in this frame: https://figma.com/design/abc123/DS?node-id=1-0"

Actions:

  1. Parse URL: fileKey=abc123, nodeId=1-0 → convert to 1:0
  2. Run get_metadata(fileKey="abc123", nodeId="1:0") to discover all components
  3. Metadata returns 4 <symbol> nodes: Button (42:15), Card (42:20), Input (42:25), Badge (42:30)
  4. For each component: a. Run get_design_context to get properties and structure b. Scan codebase for matching component c. Present mapping plan to user d. Write the .react.figma.tsx (or .web.figma.tsx) file
  5. Track child instances discovered (e.g., Icon used by Button and Card)
  6. Offer to create Code Connect files for child components too
  7. Present final summary

Key: Process components one at a time, confirming each with the user before moving to the next. For large batches, the user may say "go ahead with all" — in that case, proceed without individual confirmations but still present the final summary.

Common Issues and Solutions

Issue: Property name mismatch

Cause: The string passed to helpers doesn't exactly match the Figma property name. Solution: Property names are case-sensitive and must include spaces. Check the Figma component's properties panel. "Has icon" is NOT the same as "Has Icon" or "hasIcon".

Issue: Enum key mismatch

Cause: Enum mapping keys don't match the Figma variant option names. Solution: Keys must match exactly. If Figma shows "Primary", use Primary: not primary: as the key.

Issue: Code snippet not appearing in Dev Mode

Cause: Files haven't been published, or the component isn't published to a team library. Solution: Run npx figma connect publish --token=TOKEN. Ensure the Figma component is published to a team library.

Issue: Nested instance shows generic code instead of connected snippet

Cause: The nested component doesn't have its own figma.connect call. Solution: Create a separate Code Connect file for the nested component. Every instance used via figma.instance or figma.children needs its own connection.

Issue: Boolean variant not mapping correctly

Cause: Using figma.enum instead of figma.boolean for a two-option variant, or vice versa. Solution: figma.boolean normalizes "Yes"/"No", "True"/"False", "On"/"Off" to true/false. If the variant has other labels, use figma.enum instead.

Issue: Layer name not found for figma.children

Cause: Using a Figma property name instead of a layer name, or the layer was renamed. Solution: figma.children takes the layer name from the component's layer hierarchy, NOT a property name. Check the Figma layers panel. Use figma.children('*') if layer names vary across variants.

Issue: Import paths are wrong in published snippets

Cause: Code Connect auto-generates imports based on relative paths. Solution: Configure importPaths in figma.config.json to override import paths, or use the imports option in figma.connect to specify exact imports.

Decision Framework

Use this to determine which helper to use:

Is it a Figma property (shown in the properties panel)?
├── Yes
│   ├── Is it a string input? → figma.string()
│   ├── Is it a boolean toggle?
│   │   ├── Maps directly to a boolean prop? → figma.boolean('Name')
│   │   ├── Controls visibility of another prop? → figma.boolean('Name', { true: figma.string('X'), false: undefined })
│   │   └── Maps to two different elements? → figma.boolean('Name', { true: <A/>, false: <B/> })
│   ├── Is it a variant/enum dropdown?
│   │   ├── Maps to string values? → figma.enum('Name', { Key: 'value' })
│   │   ├── Maps to different components? → figma.enum('Name', { Key: <Component/> })
│   │   └── One Figma component = many code components? → variant restrictions
│   └── Is it an instance swap? → figma.instance('Name')
├── No — Is it a layer in the hierarchy?
│   ├── Is it a text layer whose content changes? → figma.textContent('LayerName')
│   ├── Is it a child instance (not bound to a prop)? → figma.children('LayerName')
│   └── Is it a nested component whose props you need? → figma.nestedProps('LayerName', {...})
└── Is it styling/classes from multiple properties? → figma.className([...])

Additional Resources

Verwandte Fähigkeiten

Looking for an alternative to code-connect-expert or another community skill for your workflow? Explore these related open-source skills.

Alle anzeigen

openclaw-release-maintainer

Logo of openclaw
openclaw

Lokalisierte Zusammenfassung: 🦞 # OpenClaw Release Maintainer Use this skill for release and publish-time workflow. It covers ai, assistant, crustacean workflows. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

333.8k
0
Künstliche Intelligenz

widget-generator

Logo of f
f

Lokalisierte Zusammenfassung: Generate customizable widget plugins for the prompts.chat feed system # Widget Generator Skill This skill guides creation of widget plugins for prompts.chat . It covers ai, artificial-intelligence, awesome-list workflows. This AI agent skill supports Claude Code

149.6k
0
Künstliche Intelligenz

flags

Logo of vercel
vercel

Lokalisierte Zusammenfassung: The React Framework # Feature Flags Use this skill when adding or changing framework feature flags in Next.js internals. It covers blog, browser, compiler workflows. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

138.4k
0
Browser

pr-review

Logo of pytorch
pytorch

Lokalisierte Zusammenfassung: Usage Modes No Argument If the user invokes /pr-review with no arguments, do not perform a review . It covers autograd, deep-learning, gpu workflows. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

98.6k
0
Entwickler