pn-figma-design-to-code

pn-figma-design-to-code is a skill for Cursor from perniemann/pnCore. It costs 40 tokens per session (1,103 once invoked), scanned A, original, MIT.

A workflow for turning Figma designs into React, Astro, or Next.js code by extracting design values and matching designs to components.

In plain words
What is it for?
Use it to inspect Figma files, create shared design tokens, map frames to components, and compare the finished interface with the design.
Why use it?
It reduces visual drift between a design and its implementation by preserving layout, typography, colours, spacing, and responsive behaviour.

Skill for Cursor

Written for Cursor: shipped in a Cursor plugin.

Part of the pn-core plugin — 133 skills, 19 commands, 9 agents, 1 MCP server shipped together

Good fit Use it to inspect Figma files, create shared design tokens, map frames to components, and compare the finished interface with the design.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/perniemann/pncore/pn-figma-design-to-code
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add perniemann/pnCore --skill pn-figma-design-to-code
Clone the repo
git clone --depth 1 https://github.com/perniemann/pnCore

Made for: Cursor.

Or install pn-core, the plugin that ships this one along with the rest of its 133 skills, 19 commands, 9 agents, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pn-figma-design-to-code

README.md
[![agentmods](https://agentmods.dev/badge/skills/perniemann/pncore/pn-figma-design-to-code/github.svg)](https://agentmods.dev/skills/perniemann/pncore/pn-figma-design-to-code)
Your own site
<a href="https://agentmods.dev/skills/perniemann/pncore/pn-figma-design-to-code"><img src="https://agentmods.dev/badge/skills/perniemann/pncore/pn-figma-design-to-code/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pn-figma-design-to-code

Your own site · 80×15
<a href="https://agentmods.dev/skills/perniemann/pncore/pn-figma-design-to-code"><img src="https://agentmods.dev/badge/skills/perniemann/pncore/pn-figma-design-to-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,103 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00040 $0.01103
Opus 5 $0.00020 $0.00551
Sonnet 5 $0.00008 $0.00221
Haiku 4.5 $0.00004 $0.00110

Measured 8d ago against content hash e42c2bd6020d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

pn-figma-design-to-code scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/pn-core-mcp/content/skills/frontend/pn-figma-design-to-code/SKILL.md · 72 lines

How it starts

The opening of the file, as written. The whole thing — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Figma design-to-code skill

When to use

  • Implementing UI from Figma designs
  • Extracting design tokens (colors, spacing, typography) from Figma
  • Mapping Figma components to React, Astro, or Next components
  • Reviewing implementation against design specs
  • Setting up design-to-code workflows or tooling

Design-to-code workflow

  1. Inspect the design: Identify layout (auto-layout, constraints), spacing, typography, colors, and component structure. Use Figma's inspect panel or dev mode for exact values.
  2. Map to components: Match Figma frames/components to React, Astro, or Next components. One Figma component or frame typically maps to one component file.
  3. Extract tokens first: Before coding, extract colors, spacing, and typography into design tokens. Avoid hardcoding values from the design.
  4. Implement with tokens: Build components using tokens. Reference design for structure and hierarchy, not raw pixel values.
  5. Verify: Compare implementation to design (screenshots, overlay, or Figma embed). Check responsive behavior at breakpoints.

Token extraction from Figma

  • Colors: Extract fill colors from styles or layers. Map to semantic tokens (e.g. primary, secondary, text, background). Include opacity variants. Use hex or RGB; convert to CSS variables.
  • Typography: Extract font family, size, weight, line height, letter spacing. Map to type scale tokens (e.g. --text-heading-lg, --text-body). Note font fallbacks.
  • Spacing: Extract padding, gap, and margin values. Normalize to spacing scale (e.g. 4, 8, 12, 16, 24, 32). Avoid one-off values; round to nearest scale step when reasonable.
  • Radius, shadow: Extract border radius and shadows. Map to tokens (e.g. --radius-md, --shadow-card).
  • Output format: Prefer CSS variables or design tokens JSON. Use pn-design-system skill for token structure and naming.

Implementation patterns

  • Auto-layout → Flexbox/Grid: Figma auto-layout maps to display: flex or display: grid. Use gap for spacing; align-items, justify-content for alignment. Preserve direction (horizontal/vertical).
  • Constraints → Responsive: Figma constraints (left/right, top/bottom, scale) inform responsive behavior. Use width: 100%, max-width, or clamp() as appropriate.
  • Variants → Props: Figma component variants map to component props (e.g. variant="primary", size="lg"). Use consistent prop names.
  • Naming: Use Figma layer/component names as a guide for component and class names. Sanitize (PascalCase for components, kebab-case for CSS). Avoid spaces and special characters.
  • Assets: Export images/icons from Figma; use SVG when possible. Optimize and use responsive srcset for raster images.

Read the full file on GitHub · 72 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 72 lines · 40 tokens per session scan A e42c2bd6020d

Subscribe to this mod's changes

pn-figma-design-to-code is a skill published in the GitHub repository perniemann/pnCore (0 stars, last pushed 5d ago), licensed MIT. It adds 40 tokens to every session and 1,103 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

brand-landingpage

Brand-first landing page designer — runs a brand-identity interview (colors, typography, shape language), then generates and iterates on a polished landing page via Stitch with deployment-ready HTML. Use when the user asks to create, design, or build a landing page, homepage, or marketing page and has no established…

wshobson/agents · 112 tokens

wcag-audit-patterns

Conduct WCAG 2.2 accessibility audits with automated testing, manual verification, and remediation guidance. Use when auditing websites for accessibility, fixing WCAG violations, or implementing accessible design patterns.

wshobson/agents · 45 tokens

openkb-html-critic

Use to review a generated HTML deck or single-page artifact for visual quality and structural correctness. Especially good at catching CSS specificity bugs where slide-modifier classes (.divider, .center, .q, .flow etc.) accidentally override the base .slide{display:none} and cause one slide to stack on top of every…

VectifyAI/OpenKB · 132 tokens

decocms-ui

Build or style React UI with the decocms product design system (@decocms/ui). Use when creating interfaces, pages, or components in a project that should look like decocms products, when the user mentions "design system", "@decocms/ui", "decocms style", or asks to make UI consistent with Studio. Covers installation…

decocms/studio · 91 tokens

apply-mantel-styles

Provides guidelines for applying Mantel's brand styles to diagrams and frontend components. Use when asked to create visuals that need to align with Mantel's branding.

sammcj/agentic-coding · 37 tokens

web-artifacts-builder-v2

Suite of tools for creating elaborate, multi-component claude.ai HTML artefacts using modern frontend web technologies (React 19, Tailwind CSS v4, shadcn/ui). Use for complex artefacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artefacts.

sammcj/agentic-coding · 73 tokens