Figma-to-Code Spec Handoff Skill
Turn a Figma frame into a build-ready spec: tokens, states, responsive rules, and acceptance criteria engineers can test.
See a real output ↓Tested in Claude & Cursor · Nov 2026
Figma-to-Code Spec Handoff Skill
Built for: Product and UI designers who hand off to engineers or coding agents, design engineers, and frontend leads who want Figma implemented exactly once, with tests, instead of rebuilt after review.
Operating Standard
- Spec before code. Every color, space, radius, type, shadow, and motion value is classified
Tokenized,Token gap, orIntentional one-off (justified). Raw values are never silently snapped to the nearest token. - No invented design decisions. States, breakpoints, and behaviors the design doesn't show become owned open questions (
OQ-#, owner, blocking yes/no). Dependent acceptance criteria are markedProvisional. - Measured, not estimated. Contrast ratios are computed from exact hex values for every mode and state. Every value carries
[DATA],[DERIVED],[OBS],[INF], or[MISSING → OQ-#].
Sample: Auto Layout → CSS (4 of 22 translation rules)
| Figma | CSS | Gotcha the skill checks |
|---|---|---|
| Child Fill on primary axis | flex: 1 1 0% + min-width: 0 | Without min-width: 0, long text overflows the flex item |
| Stroke inside | box-shadow: inset 0 0 0 Wpx | A CSS border adds to the box, so a 2 px featured card shifts its content 1 px against a 1 px sibling |
| Clip content | overflow: hidden | Clips focus rings and absolutely positioned badges |
| Text Auto width | white-space: nowrap + overflow rule, or wrap | Figma never wraps it, CSS does. Unspecified = S1 finding |
In the included sample run, the skill found that the design system's Light focus-ring token measured 2.49:1 against the card surface (WCAG 1.4.11 requires 3:1). It also caught a raw pill fill that does not switch in Dark mode and drops its text to 1.82:1. Both became blocking open questions with a one-line fix.
...The full kit unlocks the complete translation matrix, typography and optical-alignment rules, the token delta in CSS + Tailwind v4 @theme + DTCG JSON, the 8-state applicability rule with S0–S3 severity, the accessibility contract, responsive and truncation rules, Given/When/Then AC coverage rules, Drift mode, two templates, and a complete real handoff spec.
Sample Output: Ledgerline (Invoicing SaaS) Pricing Section Handoff Spec
This is a real, unedited skill run (QA test case 1, 2026-11-27).
SKILL.mdwas executed against the Figma input summarized below. Every number in the spec comes from the input or is computed from it and tagged[DERIVED], including all contrast ratios. The CSS and Tailwind v4 token delta compiles with Tailwind v4.
Input given to the skill (summary)
- Frames:
Pricing / Desktop @ 1440andPricing / Mobile @ 390from Figma Dev Mode + MCP (get_metadata,get_variable_defs). Includes thePlanCardmain component (Featured = false | true), theSegmentvariants (Selected×Default | Hover), and one prototype transition (Smart animate, ease out, 300 ms). - Layout: 3 plan cards (Starter $19 / Growth $49, featured / Scale $129; annual $15 / $39 / $103), a Monthly/Annual segmented toggle with a "Save 20%" pill, and a "Most popular" badge positioned absolutely at top −12. Featured card uses a 2 px inside stroke and a raw drop shadow. Mobile stacks cards in the order Growth, Starter, Scale and shows Annual selected; Desktop shows Monthly selected.
- Tokens: DTCG JSON exported from Figma Variables with Light/Dark semantic modes, a 4-px spacing scale, radii, border widths, 2 shadows, 7 text styles, and 2 durations + 1 easing. Prefix
--ll-. - Stack: React 19, Tailwind v4, Radix UI, Next.js App Router. Library:
Button(all states, system focus rule = 2 pxcolor.focus.ring+ 2 px offset),Badge. NoSegmentedControlin code. - Also provided: copy deck (prices, billing notes, features, CTA URLs;
de-DEplanned), 2 analytics events, Tailwind default breakpoints, static-pricing data contract.
Handoff Spec: Ledgerline Pricing Section (BillingToggle + PlanCard ×3)
Target stack: React 19 + TS · Tailwind v4 · Radix UI · Next.js App Router | Input fidelity: A (Variables bound, Dev Mode + MCP values, prototype) | Token source: tokens/ledgerline.tokens.json (DTCG, prefix --ll-) | Modes: Light, Dark (only Light designed) | Frames: Pricing / Desktop @ 1440 (412:1088), Pricing / Mobile @ 390 (412:1302) Verdict: Blocked (2 S0) · Findings: S0 2 · S1 5 · S2 5 · S3 2 · ACs: 24 (5 provisional) · Open questions: 8 (2 blocking)
Both S0s are token decisions with a one-line answer each (OQ-1, OQ-2). Once they are answered, the verdict becomes Build-ready with provisional items.
0. Inputs & Assumptions
0.1 Inputs received
| Input | Provided? | Notes |
|---|---|---|
| R1 Frame source | Yes | 2 frames + PlanCard main component + Segment/Button variants + prototype. Variables bound on most fills. 6 raw values found (Section 2) |
| R2 Target stack | Yes | React 19, Tailwind v4, Radix, src/components/ui/ |
| R3 Token source | Yes | DTCG JSON with Light/Dark semantic modes, space, radius, border width, shadow, text, motion |
| O2 Copy deck | Yes | 3 plans, monthly + annual prices, billing notes, features, CTA URLs. Locales en-US now, de-DE planned |
| O3 Analytics | Yes | pricing_billing_period_changed, pricing_cta_clicked |
| O4 Breakpoints | Yes | Tailwind v4 defaults, root 16 px |
| O5 Motion guidelines | Partial | Motion tokens in R3 + one prototype transition |
| O6 Library | Yes | Button, Badge; system focus rule; no SegmentedControl in code |
| O7 Browser matrix | No | text-box-trim not used, so not needed |
| O8 Data contract | Yes | Static prices, public page, no "current plan" state |
| O1 Component code | No | Section 7 not computable |
0.2 Assumption Register
| A | Assumption | Impact | How to confirm |
|---|---|---|---|
| A-1 | Button (md) wraps its label instead of white-space: nowrap [INF] | 2× copy stress on CTA (4.2) | Check src/components/ui/button.tsx for whitespace-nowrap |
| A-2 | Plan names are <h2> because the section <h1> is the page title [INF] | Heading outline | Confirm the page has no other <h1> above the section |
| A-3 | Prices are rendered at build time from the copy deck, so the toggle is synchronous (no loading / error) [DATA: O8] | State matrix loading / error = N/A | — |
| A-4 | Existing R3 tokens are already exposed in @theme under the same names (e.g. --radius-xl: 1rem, --color-bg-surface), so rounded-xl = 16 px [INF] | Every utility class in 1.3. Tailwind's default --radius-xl is 0.75rem (12 px) [DATA: [email protected] theme.css]: if the override is missing, rounded-xl silently drifts by 4 px | rg -n 'radius-xl' src/styles/ |
1. Component Inventory
1.1 Inventory
| C | Component | Reuse / Extend / New | Figma node | Parts | Semantic element |
|---|---|---|---|---|---|
| C-1 | PricingSection | New (page section) | 412:1088 | header, billing, plans | <section aria-labelledby="pricing-title"> |
| C-2 | BillingToggle | New (Figma-only SegmentedControl, not in code [DATA: O6]) | Segment variants | root, segment ×2 | Radix RadioGroup → role="radiogroup": 2 mutually exclusive, both-visible options (Step 1.4). Not a tablist: the options do not own separate panels |
| C-3 | SavePill | Reuse Badge tone success + token fix (F-02, F-08) | SavePill | label | <span> referenced by Annual radio's aria-describedby |
| C-4 | PlanCard | New | 388:204 | badge?, name, desc, price, billingNote, features, cta | <li> in <ul aria-label="Plans"> |
| C-5 | PlanCard › Badge | Reuse Badge tone warning | Badge (instance) | label | <span>, first child of <li> (DOM order = visual order) |
| C-6 | PlanCard › CTA | Reuse Button md (primary if featured, else secondary) | Button (instance) | label | <a href>: it navigates (Step 1.4), rendered with Button styles (asChild) |
1.2 Anatomy
C-2 BillingToggle
Part (data-part) | Required? | Content source | Notes |
|---|---|---|---|
root | Yes | — | aria-label="Billing period" |
segment[monthly] | Yes | static "Monthly" | RadioGroup.Item value="monthly" |
segment[annual] | Yes | static "Annual" | aria-describedby → SavePill id |
C-4 PlanCard
| Part | Required? | Content source | Notes |
|---|---|---|---|
badge | Featured only | static "Most popular" | absolute, see 1.3 |
name | Yes | copy deck plan.name | <h2> (A-2) |
description | Yes | copy deck | <p> |
amount | Yes | copy deck price[period] | formatted via Intl.NumberFormat('en-US', { style:'currency', currency:'USD', maximumFractionDigits:0 }) |
period | Yes | static "/month" | visual aria-hidden="true" + sr-only "per month" |
billingNote | Yes | copy deck note[period] | message template, not string concatenation (de-DE planned) |
features | Yes (n ≥ 1) | copy deck | <ul>; each item = icon + text |
cta | Yes | copy deck label + URL with billing={period} | accessible name includes plan: "Start free trial" + sr-only ", Growth plan" (two identical visible labels on the page) |
1.3 Layout Translation
| Frame | Figma Auto Layout | CSS (Tailwind v4) | Finding |
|---|---|---|---|
| Section | vertical, padding-y 64 (desktop) / 48 (mobile) [DATA] | py-(--ll-space-12) lg:py-(--ll-space-16) | — |
| Container | vertical, W Fill, max-W 1200, padding-x 32 / 16, gap 48 / 32 | mx-auto w-full max-w-pricing px-(--ll-space-4) lg:px-(--ll-space-8) flex flex-col items-center gap-(--ll-space-8) lg:gap-(--ll-space-12) | max-W 1200 has no token → provisional --ll-container-pricing (F-10 group) |
| Header | vertical, gap 12, center | flex flex-col items-center gap-(--ll-space-3) text-center | — |
| BillingRow | desktop horizontal gap 12 center; mobile vertical gap 8 | flex flex-col items-center gap-(--ll-space-2) lg:flex-row lg:gap-(--ll-space-3) (switch range per OQ-5) | — |
| BillingToggle | horizontal, padding 4, gap 4, H Hug; mobile W Fill | inline-flex p-(--ll-space-1) gap-(--ll-space-1) rounded-full bg-bg-subtle · mobile w-full | — |
| Segment | horizontal, padding 8/16, mobile W Fill | px-(--ll-space-4) py-(--ll-space-2) rounded-full · mobile flex-1 min-w-0 | Height = 20 + 2×8 = 36 px [DERIVED]. Mobile segment width = (358 − 2×4 − 4) / 2 = 173 px [DERIVED] |
| Cards | desktop horizontal gap 24, counter stretch; mobile vertical gap 16 | <ul>: grid grid-cols-1 gap-(--ll-space-4) lg:grid-cols-3 lg:gap-(--ll-space-6) with minmax(0,1fr) tracks (Tailwind grid-cols-3 = repeat(3,minmax(0,1fr))) | Desktop card width = (1136 − 2×24) / 3 = 362.67 px [DERIVED] (1136 = 1200 − 2×32). Grid gives equal heights; stretch preserved |
| PlanCard | vertical, padding 32 / 24 (mobile), gap 24, H Fill | relative flex h-full flex-col gap-(--ll-space-6) p-(--ll-space-6) lg:p-(--ll-space-8) rounded-xl bg-bg-surface | No overflow-hidden on the card: it would clip the absolute badge (top −12) and the CTA focus ring |
| PlanCard stroke | Featured=false: 1 inside · Featured=true: 2 inside | Two CSS utilities, no arbitrary values: @utility card-stroke { box-shadow: inset 0 0 0 var(--ll-border-width-default) var(--ll-color-border-default); } and @utility card-stroke-featured { box-shadow: inset 0 0 0 var(--ll-border-width-emphasis) var(--ll-color-border-brand), var(--ll-shadow-lg-emphasis); } | Inside strokes do not affect Figma layout. A CSS border of 2 vs 1 would shift featured content by 1 px [DERIVED: 2 − 1]. Inset box-shadow keeps the content boxes identical |
| Badge | absolute, top −12, centered | absolute left-1/2 top-0 -translate-x-1/2 -translate-y-1/2 | Badge height = 16 + 2×4 = 24 px [DERIVED], so top −12 = half its height → -translate-y-1/2 is exact |
| Top | vertical gap 8 | flex flex-col gap-(--ll-space-2) | — |
| PriceRow | horizontal gap 4, baseline | flex items-baseline gap-(--ll-space-1) | — |
| Features | vertical gap 12, H Fill | <ul class="flex flex-1 flex-col gap-(--ll-space-3)"> | flex-1 pushes the CTA to the card bottom, so CTAs align across cards |
| FeatureRow | horizontal gap 8, counter top | flex items-start gap-(--ll-space-2), text min-w-0 | Icon 20 = body-sm line height 20 → first-line optical alignment with items-start, margin-top 0 [DERIVED: (20 − 20) / 2] |
| CTA | W Fill, library Button md | <Button asChild size="md" className="w-full"> | Height from library (min-height 44); not re-specified |
1.4 Assets
| Asset | Export rule | a11y |
|---|---|---|
check icon 20×20 | Use the codebase icon set if check exists (O6 does not list icons → confirm). Otherwise SVG, viewBox="0 0 20 20", no width/height attributes, fill="currentColor" | aria-hidden="true" focusable="false" (feature text carries meaning) |
| No raster assets | — | — |
2. Token Map
2.1 Token Map
| # | Element.property | Figma value (Light) | Figma value (Dark) | Token | Status | Sev | Evidence |
|---|---|---|---|---|---|---|---|
| 1 | Section.bg | #F8FAFC | #020617 | color.bg.page | Tokenized | — | [DATA] |
| 2 | Section.padding-y | 64 / 48 | = | space.16 / space.12 | Tokenized | — | [DATA] |
| 3 | Container.max-width | 1200 | = | — | Token gap: provisional --ll-container-pricing: 75rem | S2 (F-10) | [DATA] |
| 4 | Container.padding-x | 32 / 16 | = | space.8 / space.4 | Tokenized | — | [DATA] |
| 5 | Container.gap | 48 / 32 | = | space.12 / space.8 | Tokenized | — | [DATA] |
| 6 | Header H.color | #0F172A | #F8FAFC | color.text.primary | Tokenized | — | [DATA] |
| 7 | Header P.color | #475569 | #94A3B8 | color.text.secondary | Tokenized | — | [DATA] |
| 8 | Toggle.bg | #F1F5F9 | #1E293B | color.bg.subtle | Tokenized | — | [DATA] |
| 9 | Toggle.padding / gap | 4 / 4 | = | space.1 | Tokenized | — | [DATA] |
| 10 | Toggle/Segment.radius | 9999 | = | radius.full | Tokenized | — | [DATA] |
| 11 | Segment(selected).bg | #FFFFFF | #0F172A | color.bg.surface | Tokenized | — | [DATA] |
| 12 | Segment(selected).shadow | sm | = | shadow.sm | Tokenized | — | [DATA] |
| 13 | Segment(hover, unselected).bg | #F8FAFC | #1E293B | color.bg.surface-hover | Tokenized | — | [DATA] |
| 14 | Segment.label weight | 500 on body-sm (400) | = | — | Token gap: provisional text style body-sm-medium | S2 (F-07) | [DATA] |
| 15 | SavePill.bg | #ECFDF5 (raw, unbound) | none: raw fill does not switch modes | — | Token gap: provisional color.bg.success-subtle. Dark value missing | S0 (F-02) + S2 | [DATA] |
| 16 | SavePill.padding | 2 / 8 | = | y: — (nearest space.1 = 4, Δ −2) · x: space.2 | Token gap (near-miss) | S2 (F-08) | [DATA] |
| 17 | SavePill.text color | #047857 | #34D399 | color.text.success | Tokenized | — | [DATA] |
| 18 | PlanCard.bg | #FFFFFF | #0F172A | color.bg.surface | Tokenized | — | [DATA] |
| 19 | PlanCard.radius | 16 | = | radius.xl | Tokenized | — | [DATA] |
| 20 | PlanCard.padding | 32 / 24 | = | space.8 / space.6 | Tokenized | — | [DATA] |
| 21 | PlanCard.gap | 24 | = | space.6 | Tokenized | — | [DATA] |
| 22 | PlanCard.stroke (default) | 1, #E2E8F0 | 1, #334155 | border.width.default + color.border.default | Tokenized | — | [DATA] |
| 23 | PlanCard.stroke (featured) | 2, #0F766E | 2, #14B8A6 | border.width.emphasis + color.border.brand | Tokenized | — | [DATA] |
| 24 | PlanCard.shadow (featured) | 0 12 32 −8 rgba(15,23,42,0.16) | = | nearest shadow.lg (alpha 0.12) | Token gap (near-miss) | S2 (F-09) | [DATA] |
| 25 | Badge.bg / text | #FEF3C7 / #92400E | #78350F / #FEF3C7 | color.badge.warning.bg / .text | Tokenized | — | [DATA] |
| 26 | Badge.padding / radius | 4 / 12 · 9999 | = | space.1 / space.3 · radius.full | Tokenized | — | [DATA] |
| 27 | Top / PriceBlock / PriceRow gap | 8 / 4 / 4 | = | space.2 / space.1 / space.1 | Tokenized | — | [DATA] |
| 28 | Features.gap / FeatureRow.gap | 12 / 8 | = | space.3 / space.2 | Tokenized | — | [DATA] |
| 29 | Feature icon.fill | teal/700 (primitive) = #0F766E | #0F766E (primitive does not switch) | should be color.icon.brand (Light #0F766E, Dark #2DD4BF) | Primitive bound where semantic exists | S3 (F-12) | [DATA] |
| 30 | Feature text.color | #0F172A | #F8FAFC | color.text.primary | Tokenized | — | [DATA] |
| 31 | Cards.gap | 24 / 16 | = | space.6 / space.4 | Tokenized | — | [DATA] |
| 32 | Focus ring (system rule, O6) | #14B8A6 | #5EEAD4 | color.focus.ring | Tokenized, but fails 3:1 in Light (3.3) | S0 (F-01) | [DATA] + [DERIVED] |
2.2 Typography
| Style | Size / LH / Weight / Tracking | rem / unitless / em [DERIVED] | Token | Status |
|---|---|---|---|---|
| H (desktop) | 36 / 44 / 600 / −2% | 2.25rem / 1.222 / −0.02em | text.display-md | Tokenized |
| H (mobile) | 28 / 36 / 600 / −1% | 1.75rem / 1.286 / −0.01em | text.heading-lg | Tokenized |
| Plan name | 20 / 28 / 600 / 0 | 1.25rem / 1.4 / 0 | text.heading-sm | Tokenized |
| Amount (desktop) | 48 / 56 / 700 / −2% | 3rem / 1.167 / −0.02em | text.price-xl | Tokenized |
| Amount (mobile) | 40 / 48 / 700 / −2% (raw) | 2.5rem / 1.2 / −0.02em | — | Token gap: provisional text.price-lg · S2 (F-10) |
| Subtitle | 16 / 24 / 400 | 1rem / 1.5 | text.body-md | Tokenized |
| Desc, period, note, features | 14 / 20 / 400 | 0.875rem / 1.429 | text.body-sm | Tokenized |
| Segment label | 14 / 20 / 500 | 0.875rem / 1.429 | — | Token gap: provisional text.body-sm-medium · S2 (F-07) |
| Badge, SavePill | 12 / 16 / 600 / +4% | 0.75rem / 1.333 / 0.04em | text.label-sm | Tokenized |
| Amount (all) | — | font-variant-numeric: tabular-nums | — | Spec rule (Step 2): digit count per plan is unchanged across the toggle ($19↔$15, $49↔$39, $129↔$103) [DERIVED], so tabular figures give zero width shift |
2.3 Motion
| Interaction | Figma value | Token | Reduced-motion behavior | Status |
|---|---|---|---|---|
| Segment selection (thumb) + price swap | Smart animate, Ease out, 300 ms [DATA] | nearest motion.duration.base (200 ms) + motion.easing.standard | Thumb moves instantly; prices swap with no fade (0 ms) | Token gap: duration off-scale (Δ +100 ms) and easing not in system · S2 (F-11) |
| Segment hover bg | not specified | motion.duration.fast (120 ms) + easing.standard [INF] (system default) | instant | Provisional (OQ-7) |
2.4 Token Delta (new / provisional / corrected only)
CSS (src/styles/tokens.css)
:root {
/* corrected: OQ-1 — was var(--ll-teal-500) (2.49:1 on surface) */
--ll-color-focus-ring: var(--ll-teal-700);
/* provisional: OQ-2 */
--ll-emerald-50: #ECFDF5;
--ll-color-bg-success-subtle: var(--ll-emerald-50);
/* provisional: OQ-7 */
--ll-container-pricing: 75rem;
--ll-shadow-lg-emphasis: 0 12px 32px -8px rgba(15, 23, 42, 0.16);
--ll-duration-moderate: 300ms; /* only if OQ-7 keeps 300 ms; otherwise use --ll-duration-base */
}
.dark {
--ll-color-focus-ring: var(--ll-teal-300); /* unchanged, 12.07:1 on surface */
/* --ll-color-bg-success-subtle: MISSING → OQ-2 (Design supplies a Dark value with ≥4.5:1 against #34D399). Not emitted until answered. */
}Tailwind v4 (src/styles/app.css)
@theme inline {
--color-bg-success-subtle: var(--ll-color-bg-success-subtle);
--color-focus-ring: var(--ll-color-focus-ring);
}
@theme {
--container-pricing: 75rem; /* provisional: OQ-7 */
--shadow-lg-emphasis: 0 12px 32px -8px rgba(15, 23, 42, 0.16); /* provisional: OQ-7 */
--text-price-lg: 2.5rem; /* provisional: OQ-7 */
--text-price-lg--line-height: 1.2;
--text-price-lg--letter-spacing: -0.02em;
--text-price-lg--font-weight: 700;
--text-body-sm-medium: 0.875rem; /* provisional: OQ-7 */
--text-body-sm-medium--line-height: 1.429;
--text-body-sm-medium--font-weight: 500;
}
/* Durations have no v4 theme namespace: use duration-(--ll-duration-base) */DTCG JSON (append to tokens/ledgerline.tokens.json)
{
"primitive": { "emerald": { "50": { "$type": "color", "$value": "#ECFDF5" } } },
"color": {
"bg": { "success-subtle": { "$type": "color", "$value": "{primitive.emerald.50}", "$extensions": { "mode": { "Dark": "MISSING → OQ-2" } } } },
"focus": { "ring": { "$type": "color", "$value": "{primitive.teal.700}", "$extensions": { "mode": { "Dark": "{primitive.teal.300}" } } } }
},
"container": { "pricing": { "$type": "dimension", "$value": "1200px" } },
"shadow": { "lg-emphasis": { "$type": "shadow", "$value": { "offsetX": "0px", "offsetY": "12px", "blur": "32px", "spread": "-8px", "color": "rgba(15,23,42,0.16)" } } },
"text": {
"price-lg": { "$type": "typography", "$value": { "fontFamily": "{font.family.sans}", "fontSize": "40px", "lineHeight": 1.2, "fontWeight": 700, "letterSpacing": "-0.02em" } },
"body-sm-medium": { "$type": "typography", "$value": { "fontFamily": "{font.family.sans}", "fontSize": "14px", "lineHeight": 1.429, "fontWeight": 500, "letterSpacing": "0em" } }
}
}3. State Matrix
3.1 C-2 BillingToggle › Segment
| State | Trigger | Visual delta (tokens) | Behavior | ARIA / a11y | Source |
|---|---|---|---|---|---|
| default (unselected) | — | bg none · label color.text.secondary · text.body-sm-medium | — | role="radio" aria-checked="false", tabindex="-1" | Figma Selected=false, State=Default |
| selected | click / Space / arrow key | bg color.bg.surface · shadow.sm · label color.text.primary | sets billingPeriod, updates 3 cards, fires pricing_billing_period_changed once | aria-checked="true", tabindex="0" | Figma Selected=true |
| hover (unselected) | pointer over | bg color.bg.surface-hover | cursor pointer | — | Figma State=Hover |
| hover (selected) | pointer over | not designed | — | — | [MISSING → OQ-6] · F-06. Proposed default: no change [INF] |
| focus-visible | keyboard focus | 2 px ring color.focus.ring, offset 2 px | — | ring visible in both modes (3.3, after OQ-1) | Derived from system rule O6 [DATA] |
| active (pressed) | pointer down | not designed | — | — | [MISSING → OQ-6] · F-06 S1 (no system rule for segments) |
| disabled | — | N/A: no business rule disables billing choice [DATA: O8] | — | — | Step 4 rule |
| loading | — | N/A: synchronous, static prices (A-3) | — | — | Step 4 rule |
| empty / error | — | N/A: static content, cannot fail | — | — | Step 4 rule |
3.1 (cont.) C-4 PlanCard (non-interactive container) and C-6 CTA
| State | Trigger | Visual delta (tokens) | Behavior | ARIA / a11y | Source |
|---|---|---|---|---|---|
| default | — | per 2.1 rows 18–31 | — | <li>, <h2> name | Figma Featured=false |
| featured | plan.featured = true | stroke border.width.emphasis + color.border.brand · shadow.lg-emphasis (provisional) · Badge shown · CTA primary | — | Badge text read before name (DOM first) | Figma Featured=true |
| period = annual | toggle | amount → annual price · billingNote → "Billed $X yearly" | CTA href billing=annual | polite live region announces "Prices shown billed annually" [INF] (radio state is already announced, prices are not) | Prototype + O2 |
| CTA hover / active / focus-visible / disabled | — | library Button variants | navigates | <a>; disabled N/A (no rule) | Library [DATA: O6] |
| loading / empty / error | — | N/A: navigation link; static content | — | — | Step 4 rule |
3.2 Accessibility Contract
- BillingToggle:
RadioGroupwitharia-label="Billing period",orientation="horizontal". Keyboard: Tab enters on the checked radio. ←/→ (and ↑/↓) move and select with wrap-around (radio semantics: selection follows focus). Space selects the focused radio. Tab leaves the group. Annual radioaria-describedby→ SavePill ("Save 20%"). - Target size: Segment height 36 px
[DERIVED]× width ≥ the label → ≥24×24 ✓ (2.5.8). Mobile segments 173 × 36[DERIVED]. - Plans list:
<ul aria-label="Plans">announces "list, 3 items". Name =<h2>. - Price: amount + sr-only "per month" (visual "/month" is
aria-hidden), so it reads "$49 per month", not "$49 slash month". - CTA:
<a>styled as Button. Accessible name "Start free trial, Starter plan" / "…, Growth plan" / "Contact sales, Scale plan" via sr-only suffix. Without it, two identical link names point to different URLs. - Live region: one visually hidden
<p aria-live="polite">in the section, text set on toggle change only (not on first render). - Focus: system ring 2 px + 2 px offset. The card must not use
overflow-hidden(1.3). Nothing sticky on this page[OBS], so 2.4.11 is not at risk. - Order: DOM order Starter → Growth → Scale at all widths (pending OQ-4). No CSS
order. - Decorative: check icons
aria-hidden. - Reflow: at 320 px, container width = 320 − 2×16 = 288 px
[DERIVED]. Single column, no fixed widths in the spec → no horizontal scroll expected. Verified by AC-17.
3.3 Contrast Table ([DERIVED], WCAG relative luminance)
| Pair | Mode | Foreground | Background | Ratio | Req | Result |
|---|---|---|---|---|---|---|
| H / plan name / amount on page or surface | Light | #0F172A | #F8FAFC / #FFFFFF | 17.06 / 17.85 | 4.5 | Pass |
| same | Dark | #F8FAFC | #020617 / #0F172A | 19.28 / 17.06 | 4.5 | Pass |
| Secondary text on surface | Light / Dark | #475569 / #94A3B8 | #FFFFFF / #0F172A | 7.58 / 6.96 | 4.5 | Pass |
| Secondary text on page | Light / Dark | #475569 / #94A3B8 | #F8FAFC / #020617 | 7.24 / 7.87 | 4.5 | Pass |
| Unselected segment label on track | Light / Dark | #475569 / #94A3B8 | #F1F5F9 / #1E293B | 6.92 / 5.71 | 4.5 | Pass |
| Selected segment label | Light / Dark | #0F172A / #F8FAFC | #FFFFFF / #0F172A | 17.85 / 17.06 | 4.5 | Pass |
| Primary CTA label | Light | #FFFFFF | #0F766E (hover #115E59) | 5.47 (7.58) | 4.5 | Pass |
| Primary CTA label | Dark | #020617 | #14B8A6 (hover #2DD4BF) | 8.10 (10.84) | 4.5 | Pass |
| Badge "Most popular" | Light / Dark | #92400E / #FEF3C7 | #FEF3C7 / #78350F | 6.37 / 8.15 | 4.5 | Pass |
| SavePill text | Light | #047857 | #ECFDF5 | 5.21 | 4.5 | Pass |
| SavePill text | Dark | #34D399 | #ECFDF5 (raw fill, does not switch) | 1.82 | 4.5 | Fail → F-02 S0 |
| Focus ring on surface / page / track | Light | #14B8A6 | #FFFFFF / #F8FAFC / #F1F5F9 | 2.49 / 2.38 / 2.27 | 3.0 (1.4.11) | Fail → F-01 S0 |
Focus ring, proposed teal.700 | Light | #0F766E | #FFFFFF / #F8FAFC / #F1F5F9 | 5.47 / 5.23 / 5.00 | 3.0 | Pass (fix for OQ-1) |
| Focus ring | Dark | #5EEAD4 | #0F172A / #020617 / #1E293B | 12.07 / 13.64 / 9.89 | 3.0 | Pass |
| Featured stroke on surface | Light | #0F766E | #FFFFFF | 5.47 | — (decorative; card is not a control) | Info |
| Secondary CTA border | Light | #CBD5E1 | #FFFFFF | 1.48 | — (1.4.11 does not apply: the text label identifies the control) | Info |
| Check icon, primitive in Dark | Dark | #0F766E | #0F172A | 3.26 | — (decorative) | Info: wrong token per F-12. Semantic gives #2DD4BF = 9.59 |
4. Responsive Rules
4.1 Breakpoints
| Range | Anchor frame | Layout | Spacing / type changes | Visibility / order | Source |
|---|---|---|---|---|---|
| < 640 | Mobile @ 390 | 1 column, cards stacked, BillingRow vertical, toggle full width with equal segments | section py space.12 · px space.4 · gap space.8 · cards gap space.4 · card padding space.6 · H heading-lg · amount price-lg (provisional) | Order: see OQ-4. Default period: see OQ-3 | [DATA] |
| 640–767 | none | [MISSING → OQ-5]. Proposed: same as < 640 [INF] | as < 640 | — | Provisional |
| 768–1023 | none | [MISSING → OQ-5]. 3 columns at 768 would give a card width of (704 − 48) / 3 = 218.67 px and an inner content width of 218.67 − 64 = 154.67 px [DERIVED], about half the desktop inner width of 362.67 − 64 = 298.67 px. Proposed: stay 1 column until lg [INF] | as < 640 | — | Provisional · F-05 S1 |
≥ 1024 (lg) | Desktop @ 1440 | 3 equal columns, stretch, CTA bottom-aligned; BillingRow horizontal | desktop values (2.1) | Starter, Growth, Scale | [DATA] for 1440. At 1024: card width (960 − 48) / 3 = 304 px, inner 240 px [DERIVED]. Fluid between 1024 and 1200 container max |
4.2 Content Resilience & Truncation
| Part | Stress case | Rule | Source |
|---|---|---|---|
| Plan name | 2× length ("Growth" → "Growth Growth") | Wrap. Never truncate (title rule: max 2 lines, then line-clamp-2) | Step 6.4 |
| Description | 2× length | Auto height [DATA] → wraps; equal card heights preserved by grid stretch | [DATA] |
| Amount | Largest value "$1,236" (annual billed) is in the note, not the amount. Amount max "$129" (4 chars) [DATA] | Never truncate. tabular-nums, whitespace-nowrap. Format via Intl.NumberFormat. For de-DE the currency position changes ("129 $"), so no hard-coded "$" | Step 6.4 · O2 |
| Billing note | "Billed $1,236 yearly" vs "Billed monthly" | Wraps. Message template billedYearly({amount}), not concatenation | O2 |
| Feature row | 2× length · "SAML SSO & SCIM provisioning" (longest, [DATA]) | Wraps under the text column, icon stays top-aligned on line 1 (1.3) | Step 2 |
| Features count | 4 / 6 / 7 items [DATA] | Show all. Unequal lists do not misalign CTAs (flex-1) | [DATA] |
| CTA label | 2× ("Start free trial" ×2) | Never truncate. Wrap inside Button (A-1) | Step 6.4 |
| Segment label | de-DE strings (unknown) | No truncation. Desktop segments hug. Mobile segments flex-1 min-w-0 with wrap | O2 |
5. Acceptance Criteria
5.1 AC table
| AC | Given | When | Then | Test type | Status |
|---|---|---|---|---|---|
| AC-01 | the pricing section renders | — | getByRole('radiogroup', { name: 'Billing period' }) contains 2 radios, "Monthly" and "Annual" | unit | Ready |
| AC-02 | the page loads with no billing query param | — | the radio for the default period has aria-checked="true" | unit | Provisional (OQ-3) |
| AC-03 | Monthly is selected | the user clicks "Annual" | amounts read $15 / $39 / $103 and billing notes read "Billed $180 yearly" / "Billed $468 yearly" / "Billed $1,236 yearly" | unit | Ready |
| AC-04 | Annual is selected | the user clicks "Monthly" | amounts read $19 / $49 / $129 and all notes read "Billed monthly" | unit | Ready |
| AC-05 | either period is selected | the user changes the period | each CTA href ends with billing=<period> (Starter, Growth) and Scale stays /contact-sales?plan=scale | unit | Ready |
| AC-06 | focus is on the checked radio | the user presses → (or ←) | focus and selection move to the other radio and prices update (selection follows focus) | e2e | Ready |
| AC-07 | focus is before the toggle | the user presses Tab | focus lands on the checked radio only (one tab stop for the group) | e2e | Ready |
| AC-08 | a segment has keyboard focus | — | a 2 px ring in --ll-color-focus-ring with 2 px offset is visible and not clipped | visual | Provisional (OQ-1: token value) |
| AC-09 | the period changes | — | pricing_billing_period_changed fires exactly once with billing_period = new value | unit (analytics mock) | Ready |
| AC-10 | the user activates a CTA | — | pricing_cta_clicked fires once with plan_id and the current billing_period | e2e | Ready |
| AC-11 | the period changes | — | the polite live region text becomes "Prices shown billed annually" / "…monthly"; it is empty on first render | unit | Ready |
| AC-12 | any state | — | each amount element has computed font-variant-numeric: tabular-nums, and its width does not change across a toggle | visual | Ready |
| AC-13 | viewport ≥ 1024 px | — | the 3 cards are in one row with equal heights, and the 3 CTAs share the same top (±0 px) | visual (1024, 1440) | Ready |
| AC-14 | viewport < 640 px | — | cards are stacked in a single column with 16 px gaps (space.4), card padding 24 px (space.6), and the toggle is full width with 2 equal segments | visual (390) | Ready |
| AC-15 | viewport 640–1023 px | — | layout follows the OQ-5 decision | visual (640, 768, 1023) | Provisional (OQ-5) |
| AC-16 | any viewport | the user tabs through the plans | focus order is Starter CTA → Growth CTA → Scale CTA | e2e (390, 1440) | Provisional (OQ-4) |
| AC-17 | viewport 320 px | — | document.documentElement.scrollWidth ≤ 320 and no text is clipped | e2e | Ready |
| AC-18 | the Growth card | — | the "Most popular" badge is fully visible (no ancestor clips it) and its vertical center sits on the card's top edge | visual | Ready |
| AC-19 | Featured vs non-featured card | — | the first content child (name block) has the same x-offset inside each card (no 1 px stroke shift) | visual / unit (getBoundingClientRect) | Ready |
| AC-20 | the Annual radio | — | its accessible description is "Save 20%" | unit | Ready |
| AC-21 | each plan card | — | the CTA accessible name includes the plan name ("Start free trial, Growth plan") | unit | Ready |
| AC-22 | each price | — | the accessible text reads "$49 per month" (not "/month") | unit | Ready |
| AC-23 | Light and Dark themes, each state story (toggle default, hover, focus; cards default, featured) | axe runs with wcag2a, wcag2aa, wcag21aa, wcag22aa | 0 violations | a11y | Provisional (OQ-1, OQ-2) |
| AC-24 | prefers-reduced-motion: reduce | the period changes | the selected-segment transition and price swap complete with 0 ms duration | e2e (emulated media) | Ready |
5.2 PR Verification Checklist
--ll-color-focus-ringLight value updated per OQ-1, and--ll-color-bg-success-subtlehas a Dark value per OQ-2 (both S0)rggreps 1.1–1.12 fromdesign-code-drift-checklist.mdreturn 0 hits inPricingSection.tsx,BillingToggle.tsx,PlanCard.tsx- Toggle built on Radix
RadioGroup(not buttons witharia-pressed); keyboard per 3.2 - Card stroke = inset box-shadow, card has no
overflow-hidden, badge uses-translate-y-1/2 - Amounts formatted with
Intl.NumberFormat+tabular-nums; billing note from a message template - Stories: toggle default / hover / focus · card default / featured · Light + Dark
- Visual diffs at 320, 390, 640, 768, 1023, 1024, 1440
- AC-01 … AC-24 test names carry the AC ID; provisional ACs listed in the PR with their OQ
6. Open Questions
| OQ | Question | Options (recommended) | Owner | Blocking? | Linked |
|---|---|---|---|---|---|
| OQ-1 | The Light focus ring teal.500 is 2.49:1 on surface, 2.38:1 on page, and 2.27:1 on the toggle track (below 3:1). Re-point color.focus.ring Light? | A) teal.700 (5.47 / 5.23 / 5.00) (rec.) · B) keep teal.500 and add a 2 px slate.900 outer ring | Design (system) | Yes | F-01 · AC-08, AC-23 · affects every component using the system focus rule |
| OQ-2 | The SavePill fill is a raw #ECFDF5 that does not switch in Dark (text 1.82:1). What is the Dark value of color.bg.success-subtle? | A) Design supplies a Dark primitive with ≥4.5:1 against #34D399 (rec.) · B) Dark mode drops the fill (text on page = 10.49:1) | Design | Yes | F-02 · AC-23 |
| OQ-3 | Default billing period: Desktop shows Monthly, Mobile shows Annual. Which is the default, and does ?billing= override it? | A) Monthly everywhere, ?billing=annual overrides · B) Annual everywhere | PM | No | F-03 · AC-02 |
| OQ-4 | Mobile shows Growth first; Desktop shows Starter first. Pick one DOM order for all widths (CSS order would break focus/reading order) | A) Starter, Growth, Scale everywhere (rec.). Note: stacked with a 16 px gap, the Growth badge (overhang 12) leaves 4 px [DERIVED] to the card above. Confirm or add spacing · B) Growth, Starter, Scale everywhere | Design + PM | No | F-04, F-14 · AC-16 |
| OQ-5 | No frame for 640–1023. Stack or columns? | A) 1 column until lg (rec.: 3 columns at 768 leaves 154.67 px of content width) · B) 2+1 grid at md · C) 3 columns from md | Design | No | F-05 · AC-15 |
| OQ-6 | Segment active (pressed) and selected-segment hover are not designed | A) Pressed = color.bg.surface-hover on unselected; selected has no hover (rec. [INF]) · B) Design adds variants | Design | No | F-06 |
| OQ-7 | Accept the provisional tokens: body-sm-medium, SavePill padding-y (2 → space.1 4?), shadow.lg-emphasis vs shadow.lg, price-lg, container.pricing, 300 ms ease-out vs duration.base + easing.standard, Segment hover transition (120 ms proposed) | A) Map to the existing tokens where a nearest one exists (padding → 4, shadow → shadow.lg, motion → 200 ms standard) and add body-sm-medium, price-lg, container.pricing (rec.) · B) Add all as new tokens | Design (system) | No | F-07–F-11 |
| OQ-8 | "Save 20%": actual savings are 21.05% / 20.41% / 20.16% (1 − annual/monthly) [DERIVED]. The claim is conservative. Keep it? | A) Keep "Save 20%" (rec.) · B) "Save up to 21%" | Content | No | F-13 |
Findings index
- S0 (2): F-01 focus ring contrast · F-02 SavePill Dark contrast (raw fill)
- S1 (5): F-03 default period conflict · F-04 order conflict · F-05 640–1023 missing · F-06 Segment active/selected-hover missing · F-14 mobile badge clearance under option 4A
- S2 (5): F-07
body-smMedium override · F-08 SavePill padding 2 · F-09 shadow near-miss · F-10price-lg+ container max-width raw · F-11 motion 300 ms ease-out - S3 (2): F-12 primitive
teal/700on icon (wrong in Dark) · F-13 "Save 20%" copy precision
7. Drift Report
Not computable: no component code provided (O1). Run templates/design-code-drift-checklist.md on the PR that implements this spec.
Figma-to-Code Spec Handoff Skill
Built for: Product and UI designers who hand off to engineers or coding agents, design engineers, and frontend leads who want Figma implemented exactly once, with tests, instead of rebuilt after review.
Operating Standard
- Spec before code. Every color, space, radius, type, shadow, and motion value is classified
Tokenized,Token gap, orIntentional one-off (justified). Raw values are never silently snapped to the nearest token. - No invented design decisions. States, breakpoints, and behaviors the design doesn't show become owned open questions (
OQ-#, owner, blocking yes/no). Dependent acceptance criteria are markedProvisional. - Measured, not estimated. Contrast ratios are computed from exact hex values for every mode and state. Every value carries
[DATA],[DERIVED],[OBS],[INF], or[MISSING → OQ-#].
Sample: Auto Layout → CSS (4 of 22 translation rules)
| Figma | CSS | Gotcha the skill checks |
|---|---|---|
| Child Fill on primary axis | flex: 1 1 0% + min-width: 0 | Without min-width: 0, long text overflows the flex item |
| Stroke inside | box-shadow: inset 0 0 0 Wpx | A CSS border adds to the box, so a 2 px featured card shifts its content 1 px against a 1 px sibling |
| Clip content | overflow: hidden | Clips focus rings and absolutely positioned badges |
| Text Auto width | white-space: nowrap + overflow rule, or wrap | Figma never wraps it, CSS does. Unspecified = S1 finding |
In the included sample run, the skill found that the design system's Light focus-ring token measured 2.49:1 against the card surface (WCAG 1.4.11 requires 3:1). It also caught a raw pill fill that does not switch in Dark mode and drops its text to 1.82:1. Both became blocking open questions with a one-line fix.
...The full kit unlocks the complete translation matrix, typography and optical-alignment rules, the token delta in CSS + Tailwind v4 @theme + DTCG JSON, the 8-state applicability rule with S0–S3 severity, the accessibility contract, responsive and truncation rules, Given/When/Then AC coverage rules, Drift mode, two templates, and a complete real handoff spec.
Who it's for
Built for: Product and UI designers who hand off to engineers or coding agents, design engineers, and frontend leads who want Figma implemented exactly once, with tests, instead of rebuilt after review.
- Spec before code. Every color, space, radius, type, shadow, and motion value is classified Tokenized, Token gap, or Intentional one-off (justified). Raw values are never silently snapped to the nearest token.
- No invented design decisions. States, breakpoints, and behaviors the design doesn't show become owned open questions (OQ-#, owner, blocking yes/no). Dependent acceptance criteria are marked Provisional.
- Measured, not estimated. Contrast ratios are computed from exact hex values for every mode and state. Every value carries [DATA], [DERIVED], [OBS], [INF], or [MISSING → OQ-#].
- Full handoff protocol: token mapping rules, 8-state matrix, responsive spec, acceptance criteria format, open-questions log, drift checklist, and a real handoff sample.
- SKILL.md — Handoff spec engine: token mapping, state matrix, responsive rules, Given/When/Then acceptance criteria, open-questions log
- examples/sample-output.md — Real handoff spec for a SaaS pricing card and plan toggle
- templates/component-handoff-spec.md — Per-component spec: anatomy, tokens, states, responsive behavior, acceptance criteria
- templates/design-code-drift-checklist.md — Checklist to compare an implemented component against its spec before merge
- Download & unzip dk-figma-to-code-spec-handoff-skill-v1.0.0.zip
- Upload SKILL.md to a Claude Project, attach Figma frame exports (or Dev Mode values) plus your token file, and generate a build-ready handoff spec.
- Run it on a real input using the prompt in examples/
- Download & unzip dk-figma-to-code-spec-handoff-skill-v1.0.0.zip
- Drop SKILL.md into .cursor/rules/ and reference @SKILL.md with Figma MCP context to produce specs and check implemented components for drift.
- Run it on a real input using the prompt in examples/
- Download & unzip dk-figma-to-code-spec-handoff-skill-v1.0.0.zip
- Upload SKILL.md with frame screenshots and token values in a Custom GPT or chat.
- Run it on a real input using the prompt in examples/
dk-figma-to-code-spec-handoff-skill-v1.0.0.zip · 7 files · 36206 bytes · sha256 76a492022d301d26f657a729bb7a565c4e1935222bca091198513e7e06213060
What AI tools does this work with?
Claude, Claude Code, Cursor, ChatGPT. Every file is plain Markdown, so there is nothing to install.
Can I use this for client projects?
The Individual Commercial License covers your own and your employer's work. Need multi-seat team licensing or custom kits? Reach us at [email protected].
Why is every kit free right now?
We are in Early Access to validate which kits teams use most before turning on paid checkout. All ${N_KITS} kits and ${N_BUNDLES} bundles are free until paid launch, and anything you download now is yours to keep. Enter your email to download any .zip immediately: no account or card required, and marketing opt-in is unchecked by default.
What license covers Early Access free downloads?
Every Early Access download includes our Individual Commercial License: unlimited internal, own-business, and employer work for one person, yours to keep after paid pricing launches. Reselling, redistributing, or publishing raw .md/.zip files is prohibited.