figma-design-to-code) provides coding agents with specialized workflows for translating Figma selections into production-ready UI code using TemPad Dev MCP as the authoritative source of design evidence.
What It Does
The skill teaches agents to:- Detect repo conventions (framework, styling, tokens, assets, components)
- Fetch baseline snapshots using
get_codewith proper parameters - Resolve warnings (depth-cap, auto-layout, budget limits) before implementing
- Handle assets according to your project’s asset pipeline policy
- Map tokens from Figma variables to your theme system
- Translate Tailwind-like IR into your repo’s native styling approach
- Apply semantics (accessible HTML, keyboard interaction, ARIA labels)
- Exit gracefully with evidence caveats and next steps when incomplete
The skill treats MCP outputs as design facts. Agents will not guess colors, typography, spacing, or other critical styles.
Requirements
- Node.js 18+ (the same requirement as the MCP server)
- MCP-compatible agent with skill support (e.g., agents built on skills framework)
- TemPad Dev MCP already installed and configured
Installation
Copy the Installation Command
In TemPad Dev, open Preferences → MCP server and click the copy icon next to Agent skill. This copies the installation command to your clipboard.
Run the Command
Open your terminal and run the copied command:The skills CLI will:
- Download the skill from the GitHub repository
- Install it to your agent’s skill directory
- Register it as
figma-design-to-code
How to Use
Once installed, the skill is automatically available to your coding agent. You can invoke it by asking the agent to implement UI from Figma:Workflow Overview
The skill follows this evidence-based workflow:1. Repo Convention Detection
The agent first analyzes your repository to understand:- Framework and runtime (React, Vue, SFC conventions)
- Styling approach (Tailwind, CSS Modules, styled-components, etc.)
- Token/theme system (CSS variables, token files, dark mode)
- Asset policy (public folder vs imports, icon pipeline)
- Existing components and primitives
2. Baseline Snapshot
The agent callsget_code with:
resolveTokens: false(to enable token mapping)preferredLangmatching your repo (jsx or vue)- Optional
nodeIdif you specified one
3. Warning Resolution
depth-cap Warnings
depth-cap Warnings
If the response includes a
depth-cap warning, the agent will:- Extract the list of capped node IDs from
warnings[].data.cappedNodes - Call
get_codeagain for each node ID - Stitch the results together before implementing
- Stop if
cappedNodeOverflow=true(too many nodes to handle)
Budget Exceeded Errors
Budget Exceeded Errors
If the payload is too large (~4MB limit):
- The agent will report current consumption, limit, and overage
- Ask you to select a smaller subtree or prioritize specific sections
- Retry with a narrower
nodeIdscope
Auto-Layout Uncertainty
Auto-Layout Uncertainty
If warnings indicate inferred or uncertain layout:
- The agent calls
get_structureto clarify hierarchy and overlap - Uses geometry data to resolve contradictions
- Stops if contradictions cannot be resolved
4. Asset Handling
The agent follows your repo’s asset policy:- Downloads bytes via
asset.urlfrom the response - Saves to the correct path (e.g.,
public/images/orsrc/assets/) - References assets using your repo’s import conventions
- Warns if assets cannot be stored under project policy
5. Token Mapping
Token evidence fromget_code includes:
- Canonical CSS variable names (e.g.,
--color-primary) - Single-mode values or multi-mode maps (
Collection:Modekeys) - References to other variables (preserved)
- Look for equivalent tokens in your existing theme system
- Map based on value equivalence + semantic alignment
- Add new tokens only if your repo has an established token workflow
- Keep explicit values when mapping is ambiguous
6. Repo-Native Translation
The agent translates TemPad Dev’s Tailwind-like IR into your conventions:- Utility-First Repos
- Non-Utility Repos
For Tailwind/UnoCSS projects:
- Preserves utility classes
- Adjusts formatting to match your repo’s class ordering
- Respects your Tailwind version and config
The skill will not introduce new frameworks or styling systems. It works within your existing architecture.
7. Semantics and Accessibility
For container elements that need interactivity, the agent applies:- Native HTML elements (
button,a,input/label) - Keyboard interaction and focus management
- Accessible names (
aria-label,alttext)
8. Exit and Wrap-Up
The agent stops implementation when:- MCP is unavailable or unauthorized
- Evidence is contradictory and cannot be resolved
- Required assets cannot be retrieved or stored
- Evidence caveats: Warnings, omissions, inferred conventions
- Asset notes: Stored vs TemPad URLs, policy constraints
- Token notes: Mapped vs explicit values, ambiguities
- Dependencies: Whether any were added (and if user confirmation was obtained)
Configuration
The skill has no configuration file. It adapts to your repository by:- Reading existing code patterns
- Analyzing framework and tooling config files
- Inferring conventions from file structure
Evidence Rules
The skill follows strict evidence rules:get_codeoutput (authoritative)get_structure(for hierarchy/geometry clarification)
The agent will never invent:
- Colors, typography (size/weight/line-height/letter-spacing)
- Spacing, radius, borders, shadows, gradients
- Opacity, overlays, blur effects
The agent preserves:
- Pseudo-elements and pseudo-classes
- Uncommon style properties
- Filters, masks, blend modes, backdrop effects
- Non-default compositing details
Retry Policy
The skill retries only once for transient failures:- Network timeouts or disconnects
- Extension reconnection or activation issues
depth-capwarnings (requires scope changes)- Budget exceeded (requires smaller
nodeId) - Invalid selection or node not visible
Skill Metadata
figma-design-to-codeImplement integration-ready UI code from a Figma selection or nodeId using TemPad Dev MCP as the only source of design evidence.
https://github.com/ecomfe/tempad-dev/tree/main/skillTroubleshooting
Skill not found
Skill not found
- Verify you ran the installation command successfully
- Check
npx skills listoutput - Ensure your agent supports the skills framework
Agent ignores design facts
Agent ignores design facts
- Confirm MCP is enabled and active in TemPad Dev
- Verify the agent is actually invoking MCP tools (check logs)
- Ensure you’re selecting a visible node in Figma
Code doesn't match repo conventions
Code doesn't match repo conventions
- Review your repo for consistent patterns
- Check framework and styling config files
- Provide explicit guidance in your prompt
Assets not downloading
Assets not downloading
- Verify
asset.urlis accessible from your environment - Check your project’s asset directory permissions
- Ensure the HTTP asset server is running (part of MCP)
Best Practices
Select Precise Scopes
Select individual components or small sections rather than entire pages to avoid depth-cap and budget limits.
Maintain Repo Consistency
Keep consistent naming, import paths, and styling patterns. The skill relies on convention detection.
Provide Context in Prompts
Tell the agent about special requirements (e.g., “this is a modal, needs focus trap”).
Review Token Mapping
Check that mapped tokens match your theme’s semantic intent, not just values.