figma-plugin-by-vibe-coding: Cursor rule for Cursor

.cursorrules

cursorrules is a cursor rule for Cursor from yasuhiro-y/figma-plugin-by-vibe-coding. It costs 4,469 tokens per session, scanned A, original, MIT.

A set of coding rules for building Figma plugins with TypeScript, Vite, React, shadcn/ui, and Biome. It describes how the plugin’s main code and browser-based interface communicate and how files should be organized.

In plain words
What is it for?
Use it when creating or maintaining Figma plugins, especially when organizing the project, separating Figma API code from the React interface, or defining shared types and messages.
Why use it?
It gives an agent a consistent structure for handling Figma’s two separate plugin processes and their message-based communication. This helps avoid mixing code that runs in different environments.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

This is yasuhiro-y/figma-plugin-by-vibe-coding's own configuration. It tells Cursor how to work on figma-plugin-by-vibe-coding itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything figma-plugin-by-vibe-coding configures →

Reuse

Borrowing it

Nothing to install: this file belongs to yasuhiro-y/figma-plugin-by-vibe-coding. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/yasuhiro-y/figma-plugin-by-vibe-coding/main/.cursorrules
Clone the repo
git clone --depth 1 https://github.com/yasuhiro-y/figma-plugin-by-vibe-coding

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 cursorrules

README.md
[![agentmods](https://agentmods.dev/badge/rules/yasuhiro-y/figma-plugin-by-vibe-coding/cursorrules/github.svg)](https://agentmods.dev/rules/yasuhiro-y/figma-plugin-by-vibe-coding/cursorrules)
Your own site
<a href="https://agentmods.dev/rules/yasuhiro-y/figma-plugin-by-vibe-coding/cursorrules"><img src="https://agentmods.dev/badge/rules/yasuhiro-y/figma-plugin-by-vibe-coding/cursorrules/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 cursorrules

Your own site · 80×15
<a href="https://agentmods.dev/rules/yasuhiro-y/figma-plugin-by-vibe-coding/cursorrules"><img src="https://agentmods.dev/badge/rules/yasuhiro-y/figma-plugin-by-vibe-coding/cursorrules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4,469 This file is loaded in full into every session.
When invoked 4,469 The same file — it is already loaded in full.
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.04469 $0.04469
Opus 5.5 $0.01788 $0.01788
Sonnet 5.5 $0.00894 $0.00894
Haiku 4.5 $0.00447 $0.00447

Measured 2mo ago against content hash acc4ec73bd5f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cursorrules 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 2mo 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.

.cursorrules · 681 lines

How it starts

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

Figma Plugin Vibe Coding Rules

You are an expert Figma Plugin Developer with deep knowledge of TypeScript, Vite, React, shadcn/ui, and Biome. You specialize in creating high-quality, maintainable plugins that integrate seamlessly with Figma's design ecosystem.

Architecture Guidelines

Figma Plugin Dual-Process Model

Figma plugins run in two separate processes:

  1. Main Thread (Plugin Code) - Sandboxed JavaScript environment with access to Figma API
  2. UI Thread (iframe) - Standard browser environment for React components

CRITICAL: These processes are completely isolated and can only communicate via postMessage.

Directory Structure

Follow this strict feature-based organization:

src/
├── plugin/           # Main thread code - Figma API interactions only
│   └── main.ts
├── ui/               # UI thread code - React components and styles
│   ├── components/   # Reusable UI components
│   ├── hooks/        # Custom React hooks
│   └── main.tsx      # UI entry point
└── common/           # Shared code - types, constants, messaging contracts
    ├── types.ts      # Type definitions
    ├── messages.ts   # Communication contracts
    └── constants.ts  # Shared constants

Rules:

  • NEVER import Figma API types (@figma/plugin-typings) in src/ui/
  • NEVER import React or DOM APIs in src/plugin/
  • ALL communication contracts MUST be defined in src/common/
  • Use feature-based organization within components

TypeScript Best Practices

Explicit Typing

  • ALL function parameters MUST have explicit type annotations
  • ALL function return types MUST be explicitly declared
  • ALL variables receiving values from external sources MUST be typed
  • Use unknown instead of any, then narrow the type
// ✅ Good
function processNode(node: SceneNode): NodeData {
  return { id: node.id, name: node.name };
}

// ❌ Bad
function processNode(node) {
  return { id: node.id, name: node.name };
}

Error Handling

Use Result pattern for operations that can fail:

Read the full file on GitHub · 681 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. 2mo ago First seen · 681 lines · 4,469 tokens per session scan A acc4ec73bd5f

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository yasuhiro-y/figma-plugin-by-vibe-coding (4 stars, last pushed 8mo ago), licensed MIT. It adds 4,469 tokens to every session, about $0.0179 per session on Opus 5.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.

Related

cursorrules compared with cursor rules from other repositories

cursorrules next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cursorrulesyasuhiro-y/figma-plugin-by-vibe-codingCursor rule48mo agoMITA4,469Cursor
generalKhan/wonder-blocksCursor rule163yesterdayMITA5,323Cursor
react-chakra-ui-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k5mo agoCC0-1.0A248Cursor
react-styled-components-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k5mo agoCC0-1.0A243Cursor
react-chakra-ui---folder-structureholtwood/awesome-cursorrules-zhCursor rule24118d agoMITA0Cursor
ant-designsanjeed5/awesome-cursor-rules-mdcCursor rule3.6k5mo agoCC0-1.0A2,222Cursor
815-reactflow-diagramsd-padmanabhan/agent-engineering-handbookCursor rule20yesterdayMITA38Cursor