figma-component

figma-component is a cursor rule for Cursor from vanessamarely/ai-playbook-reposito. It costs 66 tokens per session (760 once invoked), scanned A, original, MIT.

A set of rules for turning Figma designs or screenshots into reusable React and TypeScript components within an existing project.

In plain words
What is it for?
Use it to implement or update UI from a Figma URL, Figma file and node identifiers, or a provided design screenshot.
Why use it?
It helps keep generated interface code aligned with the project's component library, styling rules, naming conventions, and testing expectations.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it to implement or update UI from a Figma URL, Figma file and node identifiers, or a provided design screenshot.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/vanessamarely/ai-playbook-reposito/figma-component
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.

Clone the repo
git clone --depth 1 https://github.com/vanessamarely/ai-playbook-reposito

Made for: Cursor.

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 figma-component

README.md
[![agentmods](https://agentmods.dev/badge/rules/vanessamarely/ai-playbook-reposito/figma-component/github.svg)](https://agentmods.dev/rules/vanessamarely/ai-playbook-reposito/figma-component)
Your own site
<a href="https://agentmods.dev/rules/vanessamarely/ai-playbook-reposito/figma-component"><img src="https://agentmods.dev/badge/rules/vanessamarely/ai-playbook-reposito/figma-component/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 figma-component

Your own site · 80×15
<a href="https://agentmods.dev/rules/vanessamarely/ai-playbook-reposito/figma-component"><img src="https://agentmods.dev/badge/rules/vanessamarely/ai-playbook-reposito/figma-component.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 66 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 760 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.00066 $0.00760
Opus 5 $0.00033 $0.00380
Sonnet 5 $0.00013 $0.00152
Haiku 4.5 $0.00007 $0.00076

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

Security

Grade A, and why

figma-component 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.

ai-playbook/.cursor/rules/figma-component.mdc · 41 lines

How it starts

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

Figma Component Conversion

Provide reusable, project-agnostic rules for converting Figma designs into code. Do not assume any fixed client name, repository name, or component-library name — those come from the request.

For a fully automated conversion with Chrome-based visual/a11y verification, run /figma-component-builder.

Required Input Contract

The request must supply:

  • scope: target top-level project folder.
  • destination_folder: exact folder where generated files should be created/updated.
  • component_library: preferred reusable component library, or none.
  • client_context: concise project conventions (tokens, styling model, naming, export rules, test expectations).
  • figma_url or {fileKey, nodeId} — or, if Figma is inaccessible, an attached screenshot_image.

Optional: dev_url (for browser-based validation), create_mode (preview or apply), preferences (request-level overrides).

If required input is missing, stop and ask for it before generating code. If Figma access fails and no screenshot is provided, ask for a screenshot before generating code.

Core Rules

  1. Reuse existing components first — search scope for existing components/wrappers before creating new primitives; prioritize composition/adapters around component_library when available; if component_library is none, follow local component patterns in scope.
  2. Scope isolation — edit only files under scope; never modify sibling projects or root-level shared exports without explicit confirmation.
  3. Minimal patch strategy — prefer focused diffs (usually 1-3 files); only add .test.tsx/.stories.tsx when the corresponding tooling (Jest/Vitest, Storybook) is present in scope/package.json.
  4. File layout for a new component Xyz (adjust to client_context): <destination_folder>/Xyz.tsx, optionally Xyz.styles.ts, Xyz.test.tsx (if test runner configured), Xyz.stories.tsx (if Storybook configured).
  5. TypeScript/React standards — functional components, strict typing (avoid any unless unavoidable), naming consistent with client_context.
  6. Accessibility baseline — meet WCAG 2.2 AA: semantic markup, keyboard support, appropriate ARIA (see the react-components and a11y-automation rules for the detailed patterns and checklist).
  7. Figma fallback workflow — try Figma design context first; if unavailable/incomplete, fall back to the provided screenshot(s) to infer structure, spacing, typography, states, and interactions; ask for more screenshots if states or responsive behavior are missing; always state in the output whether the source was Figma or a screenshot fallback.

Read the full file on GitHub · 41 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 · 41 lines · 66 tokens per session scan A 8b24673297cd

Subscribe to this mod's changes

figma-component is a cursor rule published in the GitHub repository vanessamarely/ai-playbook-reposito (2 stars, last pushed 1mo ago), licensed MIT. It adds 66 tokens to every session and 760 once invoked, about $0.0003 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-08-31.