netlify-frameworks-vite

netlify-frameworks-vite is a cursor rule for Cursor from netlify/context-and-tools. It costs 17 tokens per session (820 once invoked), scanned A, original, MIT.

Setup guidance for running Vite and React web applications on Netlify, a hosting platform. It covers the Netlify Vite plugin and its connection to Netlify features.

In plain words
What is it for?
Use it when adding the Netlify Vite plugin to a React project and preparing Netlify Functions, Blobs, or database features.
Why use it?
It reduces configuration mistakes and warns against choosing unverified package versions when installing the deployment plugin.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it when adding the Netlify Vite plugin to a React project and preparing Netlify Functions, Blobs, or database features.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/netlify/context-and-tools/netlify-frameworks-vite
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/netlify/context-and-tools

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 netlify-frameworks-vite

README.md
[![agentmods](https://agentmods.dev/badge/rules/netlify/context-and-tools/netlify-frameworks-vite/github.svg)](https://agentmods.dev/rules/netlify/context-and-tools/netlify-frameworks-vite)
Your own site
<a href="https://agentmods.dev/rules/netlify/context-and-tools/netlify-frameworks-vite"><img src="https://agentmods.dev/badge/rules/netlify/context-and-tools/netlify-frameworks-vite/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 netlify-frameworks-vite

Your own site · 80×15
<a href="https://agentmods.dev/rules/netlify/context-and-tools/netlify-frameworks-vite"><img src="https://agentmods.dev/badge/rules/netlify/context-and-tools/netlify-frameworks-vite.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 820 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.00017 $0.00820
Opus 5.5 $0.00007 $0.00328
Sonnet 5.5 $0.00003 $0.00164
Haiku 4.5 $0.00002 $0.00082

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

Security

Grade A, and why

netlify-frameworks-vite 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.

cursor/rules/netlify-frameworks-vite.mdc · 113 lines

How it starts

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

Vite + React on Netlify

Setup

Check current versions before pinning. Knowledge cutoffs lag behind npm, and guessing a version tends to fail (npm install rejects it, or worse, installs something incompatible). Before pinning @netlify/vite-plugin, vite, @vitejs/plugin-react, or any other package in package.json, run npm view <pkg> version to get the current latest. Or omit explicit pins and let npm install pick them up. If that check itself fails (no network, registry unreachable), still don't fall back to a guessed exact pin — install without a version (or with @latest) and tell the user live verification wasn't possible so they should confirm the installed versions. Never present an unverified x.y.z as the current release.

Install the Netlify Vite plugin as a dev dependency (it's a build/dev-time tool, not a runtime dependency):

npm install -D @netlify/vite-plugin
// vite.config.ts
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import netlify from "@netlify/vite-plugin";

export default defineConfig({
  plugins: [react(), netlify()],
});

What the Plugin Does

  • Enables Netlify Functions, Blobs, DB, and environment variables in local dev
  • Handles build output for Netlify deployment
  • No need for netlify dev — run npm run dev directly

SPA Routing

For client-side routing (React Router, etc.), add the catch-all redirect:

# netlify.toml
[[redirects]]
from = "/*"
to = "/index.html"
status = 200

Netlify Functions

Write functions in netlify/functions/ as usual. The Vite plugin makes them available during local dev at their configured paths.

// netlify/functions/api.ts
import type { Config, Context } from "@netlify/functions";

export default async (req: Request, context: Context) => {
  return Response.json({ message: "Hello from API" });
};

export const config: Config = { path: "/api/hello" };

Forms (AJAX Pattern)

Since Vite + React renders forms client-side, include a hidden HTML form for Netlify to detect, and submit via AJAX:

Read the full file on GitHub · 113 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 · 113 lines · 17 tokens per session scan A 42758c105d3b

Subscribe to this mod's changes

netlify-frameworks-vite is a cursor rule published in the GitHub repository netlify/context-and-tools (51 stars, last pushed yesterday), licensed MIT. It adds 17 tokens to every session and 820 once invoked, about $0.0001 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-30.

Related

netlify-frameworks-vite compared with cursor rules from other repositories

netlify-frameworks-vite next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
netlify-frameworks-vitenetlify/context-and-toolsCursor rule51yesterdayMITA17Cursor
ssr-noexternal-netlifydmenchaca/webflow-to-reactCursor rule274mo agoMITA0Cursor
supabase-edgeshipkit-io/bonesCursor rule21yesterdaynoneA0Cursor
00-cloud-agent-mandatoryfirtoz/cf-multiworker-starter-kitCursor rule1120d agononeA4Cursor
deploymentlacymorrow/paperclip-hubCursor rule15yesterdayMITA0Cursor
tanstack-react-router_routingWebMCP-org/webmcp-shCursor rule181mo agoMITA17,188Cursor
react-chakra-ui-cursorrules-prompt-fileXD3an/awesome-ai-coding-all-in-oneCursor rule1516d agononeA248Cursor