| name | code-connect-components |
|---|---|
| description | Wire React (or other UI) components to data, events, and each other; map Figma design components to code (Figma Code Connect). Use when connecting components to APIs/state, implementing parent-child or sibling communication, aligning UI with a design system, or mapping Figma components to code (Figma URL with node-id, scan codebase, present matches). |
Use this skill to connect or wire UI components: to data, events, or each other; or to map Figma design components to code (Figma Code Connect workflow).
When the task is mapping Figma components to code (e.g. user provides a Figma URL or uses figma-desktop MCP):
- Get Code Connect suggestions — Unmapped components: names, properties, thumbnails. Requires Figma URL with node-id or connection to figma-desktop MCP.
- Scan codebase — Search for matching components in
src/components/,components/, orui/: matching names, variant props, structure. - Present matches — Show findings for user validation.
Figma URL: Must include node-id: https://figma.com/design/:fileKey/:fileName?node-id=1-2. Convert to tool format: URLs use hyphens (node-id=1-2), tool may expect colons (nodeId=1:2).
Install reference skill: npx skills add https://github.com/figma/mcp-server-guide --skill code-connect-components
When the task is connecting existing code components to data, events, or each other:
- Identify touchpoints — Which component owns the data or event? Which consumes it?
- Choose pattern — Props down, callbacks up; context for cross-tree; URL/query for shareable state.
- Implement — Add props/events; connect to hooks or Supabase; preserve existing types and RTL/i18n where applicable.
- Verify — No broken imports; component still used where it was (e.g. App shell, layout).
- Dr. Bot / Beauty Assistant — Chat/concierge entry points (e.g. "Consult") should dispatch
open-beauty-assistantor open the concierge UI. Persona:supabase/functions/beauty-assistant/index.ts(buildSystemPrompt). - Supabase — Use
createClientfrom@supabase/supabase-js; auth for protected flows. Concierge/telemetry:log-concierge-events,log-telemetryedge functions. - Bilingual / RTL — Prefer existing i18n/theme hooks; keep Arabic/EN and RTL in mind when adding copy or layout.
- Design system — Reuse primitives from
src/components; match clinical-luxury tone and brand tokens.
- "Connect this component to…" / "Wire X to Y"
- "Make this button open the chat" / "Link to Dr. Bot"
- "Use the same data here as on page X"
- "Map this Figma component to our code" / Figma URL with node-id / Code Connect
- Defining new design-system primitives from scratch (use existing; extend only when necessary).
- Backend-only changes (edge function logic lives in
supabase/functions; connect via existing APIs).