/flagrare:figma-matcherfrom Flagrare
Enforces pixel-perfect Figma-to-code accuracy by extracting properties, measuring with DevTools, comparing checklists, and fixing discrepancies in one pass.
Ships in Flagrare. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A rigid, checklist-driven process for verifying that implementation matches Figma designs exactly. No visual impressions. No "close enough." Every property gets extracted, compared numerically, and verified.
Without this process, you will:
This skill eliminates all of that by forcing exhaustive upfront extraction.
You are FORBIDDEN from calling Edit or Write on any .scss, .css, .sass, .less, or .styled.* file until you have:
If you catch yourself about to edit a styling file without having shown the comparison table, STOP. Go back to Step 1.
You MUST complete every step in order. Do not skip steps. Do not combine steps. Do not start writing CSS until Step 5.
Before extracting anything, locate the exact node ids and enumerate what the design actually contains.
Finding node ids when you only have a file key or section name:
get_metadata with no nodeId lists top-level pages; with a page id it should enumerate the tree — but page-level enumeration sometimes returns an empty width="0" canvas. Node-level calls still work, so the gap is discovery only.node-id from the URL. Collect all of them before extracting.Coverage rule — account for every child, then decide:
Run get_metadata on the section/frame and list EVERY child frame and instance: desktop frame, mobile frames (closed AND open/overlay states), popout menus, dropdowns, sheets, and every instance inside container rows. For each one, explicitly classify it as (a) in scope, (b) already implemented elsewhere (verify — go look), or (c) out of scope per the user. Never dismiss an instance as "page chrome" without checking the page actually renders it in this context — a tabs-row instance can contain a control (e.g. a store-status dropdown) that the current page is missing entirely. A missed instance is a missed feature, not a styling nit.
Interaction states are frames too: a mockup with a cursor on a row is showing you the hover state; a second mobile frame with an overlay is showing you the opened sheet. Both become checklist rows.
Machine-readable extraction first; hand-reading generated output is the biggest error source. In order:
get_variable_defs on the main node — returns the design-token map as JSON ({"Gray/Gray30": "#E7E7E7", "Spacing/spacing-small": "8", "Regular/Medium": "Font(...16, weight: 500, lineHeight: 24...)"}). This is ground truth for every tokenized color, spacing, radius, font, and shadow. Save it; Step 2 joins against it.get_metadata on the frame — exact geometry for free: row heights, column widths, x/y offsets, element sizes. Gaps and paddings fall out of the coordinate math (y=83, height=56, next y=155 → 16px gap).get_design_context on SMALL nodes only — one atomic piece at a time (a header cell, a row cell, a button, a menu). Large frames silently degrade to sparse metadata with a note telling you to recurse into sublayers; budget for one call per atomic component.get_screenshot on every frame (desktop, mobile, open states) — download the PNGs; they are the Step 6 visual baseline.GET https://api.figma.com/v1/files/:key/nodes?ids=:nodeId with an X-Figma-Token PAT returns the raw node JSON: fills/strokes as r/g/b/a floats 0-1 (multiply by 255), cornerRadius, auto-layout paddings, itemSpacing, text style, effects. Use when a PAT is available; note the sandbox may need api.figma.com allowed. The Variables REST endpoint (/variables/local) is Enterprise-only — get_variable_defs is the plan-independent substitute.For each visual element, extract into a structured checklist:
Colors (resolve ALL to hex + rgba):
Typography:
Spacing:
Layout:
Borders:
Effects:
Button/Interactive elements:
Write these into a numbered checklist. Each item is a row you will verify later.
For every color, spacing, or size token in your codebase that might be relevant:
grep the variables file (e.g., _settings.colors.scss) to find the actual hex value$color-ui50: $color-gray50 -> find $color-gray50: #BDBDBD)$variable-name -> $alias -> #hexvalue -> rgba(r, g, b, a)If a variable doesn't match exactly, note it. You will need a custom override, not a "closest match."
Example:
Figma border: rgba(103, 103, 103, 0.5) = #676767 at 50% opacity
$color-ui50 = $color-gray50 = #BDBDBD --> NOT a match (189 != 103)
$color-ui70 = $color-gray70 = #676767 --> EXACT MATCH
evaluate_script to get computed styles:const el = document.querySelector('.your-selector');
const styles = window.getComputedStyle(el);
JSON.stringify({
backgroundColor: styles.backgroundColor,
borderColor: styles.borderColor,
borderWidth: styles.borderWidth,
borderRadius: styles.borderRadius,
padding: styles.padding,
paddingTop: styles.paddingTop,
paddingRight: styles.paddingRight,
paddingBottom: styles.paddingBottom,
paddingLeft: styles.paddingLeft,
margin: styles.margin,
color: styles.color,
fontSize: styles.fontSize,
fontWeight: styles.fontWeight,
fontFamily: styles.fontFamily,
lineHeight: styles.lineHeight,
letterSpacing: styles.letterSpacing,
gap: styles.gap,
width: styles.width,
height: styles.height,
minWidth: styles.minWidth,
maxWidth: styles.maxWidth,
display: styles.display,
flexDirection: styles.flexDirection,
alignItems: styles.alignItems,
justifyContent: styles.justifyContent,
boxShadow: styles.boxShadow,
opacity: styles.opacity,
whiteSpace: styles.whiteSpace,
textOverflow: styles.textOverflow,
overflow: styles.overflow,
});
Do this for EVERY element in the checklist. Not just the ones you think might be wrong. Check children, containers, buttons, icons, text spans, everything.
Also measure the states, and know the measurement traps:
evaluate_script (a short await after the click), then measure the popout: width, radius, shadow, item font, item height, item padding. Popouts are checklist rows, not bonuses.dispatchEvent(mouseover) does NOT apply :hover CSS. Verify hover styles by reading the SCSS, not by measuring a synthetic hover — a transparent reading proves nothing.resize_page to the design's mobile frame size (usually 390×844), reload, and re-measure the mobile checklist rows. Restore the viewport when done.menu.top ≈ toggle.top), not drop below. Measure getBoundingClientRect of both and compare.Create a markdown table with columns:
| # | Element | Property | Figma Value | Current Value | Match? | Fix |
|---|---|---|---|---|---|---|
| 1 | Banner container | background-color | rgba(103,103,103,0.08) | rgba(189,189,189,0.08) | MISMATCH | Use $color-ui70 instead of $color-ui50 |
| 2 | Banner container | border-color | rgba(103,103,103,0.5) | rgba(189,189,189,0.8) | MISMATCH | transparentize($color-ui70, 0.5) |
| 3 | CTA button | background-color | rgba(103,103,103,0.15) | rgba(0,85,255,0.15) | MISMATCH | transparentize($color-ui70, 0.85) |
Fill in EVERY row from your checklist. Mark each as MATCH or MISMATCH. When both sides came out of Steps 1 and 3 as JSON, prefer joining them with a small script (Figma floats ×255 for colors; tolerance ≤2/255 per channel, ≤1px for geometry) so no row can be mis-copied or skipped — you write only the Fix column.
For mismatches, specify:
Deliberate divergences get their own labeled rows, not silent "fixes": features added after the frame was drawn (an extra menu item the team ratified), placeholders the user explicitly approved (a native confirm pending a designed dialog), or house-component standards not worth forking (pager copy). Name each one and why it stays.
Shared components need a decision before the Fix column is final: if a mismatched style lives on a component other features use, ask the user — scoped override (this feature only) or fix the shared component ("correct everywhere")? Do not silently widen the blast radius, and do not silently fork either.
OUTPUT THIS TABLE TO THE USER. Do not proceed until you have done so.
Also show side-by-side screenshots: Figma (from Step 1) and current implementation (from Step 3).
Only after the table is complete and shown to the user:
Known implementation traps (each one has burned a real pass):
<svg> itself (react-inlinesvg does). .my-icon svg { ... } then matches nothing — size the class directly and keep only path/circle/line fill/stroke overrides nested. Also check whether the icon is fill-based or stroke-based before writing fill: currentColor..feature table th loses to .house-table table thead tr th. Mirror the full chain and prefix your block class. For third-party inline styles (e.g. a dropdown's positioning min-width), !important is the sanctioned tool — copy the existing precedent comment style.height + inline-flex centering is how you hit an exact design height.table-layout: fixed is what makes % column widths and cell ellipsis real. Give the flexible columns explicit widths only where the design fixes them; leave the rest auto so the browser splits them equally, exactly like equal-width design columns./goal is a UI command — you cannot invoke it yourself. If the session would benefit from the goal loop, ask the user to run /goal with the condition below; otherwise run the same loop manually and do not stop until it's satisfied:
/goal For every row in the Figma comparison checklist: re-run evaluate_script via Chrome DevTools on the live page, rebuild the full comparison table, and confirm every row shows MATCH (tolerance: <=2 subpixel rounding in rgba channels). Then take a fresh screenshot and compare side-by-side with the Figma screenshot from Step 1 confirming zero visible differences in color, spacing, sizing, typography, borders, shadows, or layout. Not met until the rebuilt table has 0 MISMATCH rows AND the screenshot comparison shows 0 visual discrepancies.
If the user sets it, the goal loop keeps you working across turns until the condition is met and prevents premature completion. If not, the loop below is still mandatory — run it yourself.
evaluate_script queries from Step 3 for EVERY row in the checklist (not just previous mismatches)mismatches_css = rows where Current != Figma; mismatches_visual = visible discrepancies in screenshotmismatches_css == 0 AND mismatches_visual == 0:
"Should match now" does not satisfy the goal. "Looks correct" does not satisfy the goal. Only measured values and screenshots satisfy the goal.
border-radius: 100px vs the design's 50px on a 40px-tall pill (both clamp to height/2). Note the equivalence in the row.white-space: nowrap — and remember the design usually wants ellipsis truncation, not wrapping, in table cells.Always output:
What SKILL.md sets; muted values are Claude Code's defaults
43 skills in this plugin
/atdd-planProduce an ATDD-first implementation plan in Claude Code's native plan mode, with named design patterns called out where they earn their keep. The skill enters plan mode automatically (via the EnterPlanMode tool), runs /flagrare:codebase-explore to ground the plan in the actual codebase, then produces a plan-mode plan that MUST include both: (1) 3-5 acceptance tests in plain English defining 'done' before any implementation, written behavior-first against the public API only; and (2) any non-trivial structural decisions named as design patterns with a one-line rationale. Plan mode's native approve/edit/reject button UI is the close, ExitPlanMode is how the skill ends. Use whenever the user wants to plan a feature, fix, or refactor, 'how should we implement X', 'plan this', 'let's design X', 'where do we start on Y'. Tests follow Kent Dodds Testing Trophy: behavior over implementation, integration-heavy, public-API-only, refactor-proof. The skill stops at the plan; it does not write implementation code./brag-docGenerate a comprehensive, impact-framed brag-doc entry for a chosen time window (day, week, biweek, month, or custom). Pulls authored PRs, reviews given, commits, deploys, and linked tickets across GitHub, local git, and configured MCPs, then synthesises a themed narrative, leading with outcomes, quantifying impact, owning the work in first-person past tense, separating IC contributions from amplification, and naming the judgment exercised. Output is designed to drop straight into a developer journal, a personal bragging sheet, or a performance-review packet. Accepts a mode argument, `/flagrare:brag-doc resumancer` renders the output as ready-to-paste Resumancer CLI commands (`resumancer impact "..." --branch ...`) instead of markdown. Use whenever the user says "brag doc", "brag sheet", "what did I do this week", "weekly recap", "monthly recap", "performance review prep", "what should I tell my manager", "summarise my impact", "career log entry", "give me my wins", "biweekly recap", or any variant about looking back over a longer window than a single day's standup. Also trigger near review season ("self-review", "perf packet", "evaluation prep"), and on phrases like "log my wins to resumancer" or "make resumancer entries for this week" (which should pass the `resumancer` mode). For windows longer than about a month, a tenure retrospective, a departure record, or "everything I did at this company", hand off to `/flagrare:impact-timeline` instead; this skill's window tops out at a month.npx claudepluginhub flagrare/agent-skills --plugin flagrareOther plugins' skills for the same job