figma-component-sync
Figma Component Sync Skill
Specialized workflow for translating a Figma node URL into production-ready components and Storybook stories with high visual fidelity.
When to Use
- User shares a Figma URL and asks to implement the UI
- User asks for "Figma to Storybook" or "sync design to code"
- User needs exact visual parity before productization
Required Inputs
- Figma URL with
node-idparameter - Initiative name (or feature name) for artifacts
- Target domain in app (for example
chat,navigation,settings)
Codebase Targets
Use the current Elephant AI app layout:
- Components:
elephant-ai/apps/web/src/components/ - Storybook config:
elephant-ai/apps/web/.storybook/ - Initiative specs:
pm-workspace-docs/initiatives/[initiative-name]/
If apps/web is missing, check for legacy web/src paths and adapt.
Workflow
1) Validate and Scope
- Confirm URL includes
node-id. - Limit scope to one frame/component set at a time.
- Define output folder and component names before generating code.
2) Check Existing Components First
Avoid duplicate components. Search for same or similar names/purpose in:
elephant-ai/apps/web/src/components/- Exclude generated prototypes unless user asked for prototype-only output
If a matching production component exists, update it instead of creating a duplicate.
3) Extract Design Data via MCP
Use Figma MCP in this order:
get_metadatafor node inventory and child structureget_design_contextfor layout/style/component hierarchyget_variable_defsfor tokens and variable collectionsget_screenshotfor pixel-parity validation artifact
Use exact extraction mode only when requested:
forceCode: true(or equivalent exact-mode option)- Preserve raw generated output in
figma-generated/if needed for comparison
4) Build a Canonical Spec
Create pm-workspace-docs/initiatives/[initiative-name]/figma-spec.json with:
- Source URL and node ID
- Variant/property mapping
- Component states and story args
- Token mapping decisions (existing app tokens first)
- Open parity gaps requiring manual follow-up
5) Generate Components
Create or update files in the chosen component folder:
[component-name].tsx[component-name].stories.tsxtypes.ts(optional, when prop surface is large)index.tsexport barrel
Implementation rules:
- Prefer existing
@/components/ui/*primitives - Reuse existing chat/navigation/layout patterns from nearby components
- Keep API/data-fetching/business logic out of first scaffold pass
- Match spacing/typography/radius/shadows from app tokens before custom classes
6) Generate Storybook Coverage
Stories must include:
- One story per variant/state extracted from Figma
- Required interactive states (loading, success, error, empty, low-confidence where applicable)
- A visual comparison reference (screenshot-based) for manual parity check
7) Run Fidelity Check
Before handoff, verify:
- Layout hierarchy matches Figma structure
- Typography, spacing, and colors map to app tokens
- Interaction and hover/focus/disabled states are present
- Mobile and desktop breakpoints match intended behavior
Output Contract
Deliver:
- Component file paths
- Storybook story paths
figma-spec.jsonpath- Short delta list: what is exact, what is approximate, what needs designer decision
Re-Sync Rules
When design changes:
- Re-run extraction on the same node URL.
- Update spec first, then update component + stories.
- Preserve custom logic/accessibility fixes added after the first sync.
- Flag breaking prop changes explicitly.
More from tylersahagun/pm-workspace
digest-website
Generate a shareable website from digests with newspaper-style design and past issues archive. Use when running /publish-digest or when user wants a public digest page.
10slack-block-kit
Format Slack messages using Block Kit for rich, interactive layouts. Apply when sending any Slack message that should look polished.
9agents-generator
Generate product-focused AGENTS.md documentation for AI agents. Use when creating documentation that explains the WHY behind code.
6skylar-start-here
Get the AskElephant app and Storybook running locally for a designer. Use when the designer says "start the app", "run locally", "see my changes", "open storybook", "first time setup", "how do I see the app", or "set up my environment".
6portfolio-status
Analyze status of ALL initiatives with artifact gap matrix, health scoring, and prioritized action queue. Use when running /status-all command or answering "where are we across everything?" questions.
6activity-reporter
Generate time-bounded activity reports (end-of-day, end-of-week, digest) that aggregate work across GitHub, Linear, and PM workspace. Use when running /eod, /eow, /digest, or /eod --sam commands.
6