PatrickJS/awesome-cursorrules is a collection of Markdown rule files that give Cursor AI editor project-specific instructions about code, frameworks, workflows, and standards. Developers use it to find reusable guidance for shaping Cursor’s behavior in different kinds of software projects.
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.
npx agentmods add rules/patrickjs/awesome-cursorrules/nextjs-vercel-typescript-cursorrules-prompt-filegit clone --depth 1 https://github.com/PatrickJS/awesome-cursorrulesWrote 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.
[](https://agentmods.dev/rules/patrickjs/awesome-cursorrules/nextjs-vercel-typescript-cursorrules-prompt-file)<a href="https://agentmods.dev/rules/patrickjs/awesome-cursorrules/nextjs-vercel-typescript-cursorrules-prompt-file"><img src="https://agentmods.dev/badge/rules/patrickjs/awesome-cursorrules/nextjs-vercel-typescript-cursorrules-prompt-file.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01239 | $0.01239 |
| Opus 5 | $0.00620 | $0.00620 |
| Sonnet 5 | $0.00248 | $0.00248 |
| Haiku 4.5 | $0.00124 | $0.00124 |
Grade A, and why
nextjs-vercel-typescript-cursorrules-prompt-file 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 3d 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.
How it starts
The opening of the file, as written. The whole thing — 134 lines — stays where its author put it; the contents beside it link to each section on GitHub.
To extend the provided rules to include usage of the ai-sdk-rsc library and integrate it with Vercel middleware and a KV database, here's an updated set of instructions tailored for use with Cursor IDE. These instructions are designed to help you effectively implement generative user interfaces using React Server Components (RSC) with the AI SDK.
Extended Rules for AI SDK RSC Integration with Vercel Middleware and KV Database
Environment and Tools
- You are an expert in TypeScript, Node.js, Next.js App Router, React, Shadcn UI, Radix UI, Tailwind, and Vercel middleware.
- You are familiar with Vercel's KV database for managing stateful data.
Code Style and Structure
- Write concise, technical TypeScript code with accurate examples.
- Use functional and declarative programming patterns; avoid classes.
- Prefer iteration and modularization over code duplication.
- Use descriptive variable names with auxiliary verbs (e.g.,
isLoading,hasError). - Structure files: exported component, subcomponents, helpers, static content, types.
Naming Conventions
- Use lowercase with dashes for directories (e.g.,
components/auth-wizard). - Favor named exports for components.
TypeScript Usage
- Use TypeScript for all code; prefer interfaces over types.
- Avoid enums; use maps instead.
- Use functional components with TypeScript interfaces.
Syntax and Formatting
- Use the
functionkeyword for pure functions. - Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
- Use declarative JSX.
UI and Styling
- Use Shadcn UI, Radix UI, and Tailwind for components and styling.
- Implement responsive design with Tailwind CSS; use a mobile-first approach.
Performance Optimization
- Minimize
use client,useEffect, andsetState; favor React Server Components (RSC). - Wrap client components in
Suspensewith fallback. - Use dynamic loading for non-critical components.
- Optimize images: use WebP format, include size data, implement lazy loading.
Key Conventions
- Use
nuqsfor URL search parameter state management. - Optimize Web Vitals (LCP, CLS, FID).
- Limit
use client:- Favor server components and Next.js SSR.
- Use only for Web API access in small components.
- Avoid for data fetching or state management.
- Follow Next.js docs for Data Fetching, Rendering, and Routing.
AI SDK RSC Integration
-
Setup and Installation: Integrate
ai-sdk-rscinto your Next.js project.- Install the library using
npm install ai-sdk-rscoryarn add ai-sdk-rsc. - Configure middleware in
middleware.tsto manage requests and sessions using Vercel's KV database.
- Install the library using
-
Middleware Implementation: Use Vercel middleware to handle incoming requests.
- Create a middleware file in the
middlewaredirectory (e.g.,middleware/ai-middleware.ts). - Use middleware to parse user input and manage sessions with the KV database.
- Example:
import { NextRequest, NextResponse } from 'next/server'; import { kv } from '@vercel/kv'; export async function middleware(req: NextRequest) { const sessionId = req.cookies.get('session-id'); if (!sessionId) { const newSessionId = generateSessionId(); await kv.set(newSessionId, { state: {} }); // Initialize state in KV database const res = NextResponse.next(); res.cookies.set('session-id', newSessionId); return res; } // Fetch state from KV database const state = await kv.get(sessionId); req.nextUrl.searchParams.set('state', JSON.stringify(state)); return NextResponse.next(); } function generateSessionId() { return Math.random().toString(36).substring(2); }
- Create a middleware file in the
-
React Server Components (RSC) and AI SDK:
- Use
ai-sdk-rschooks to manage state and stream generative content. - Example usage of AI SDK hooks in a React Server Component:
import { useAIStream } from 'ai-sdk-rsc'; import { FC } from 'react'; interface ChatProps { initialMessage: string; } const Chat: FC = ({ initialMessage }) => { const { messages, sendMessage } = useAIStream({ initialMessage, onMessage: (message) => console.log('New message:', message), }); return ( {msg.content} ); export default Chat;
- Use
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.
- 3d ago First seen · 134 lines · 1,239 tokens per session scan A 0f8b2f65c9a4
nextjs-vercel-typescript-cursorrules-prompt-file is a cursor rule published in the GitHub repository PatrickJS/awesome-cursorrules (40,732 stars, last pushed 3mo ago), licensed CC0-1.0. It adds 1,239 tokens to every session, about $0.0062 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-09-03.
Other cursor rules, from other repositories
t3-stack
T3 Stack: tRPC + Prisma + NextAuth integration patterns.
mern-stack
MERN Stack best practices with MongoDB, Express, React, and Node.js.
t3-stack
T3 Stack best practices with Next.js, tRPC, Prisma, Tailwind CSS, and TypeScript.
data-fetching-rules-for-server-components
description: Rules for data fetching in server components in Next.js 14. globs: /app//.tsx.
htmx-and-django-best-practices---general
description: Applies best practices for HTMX and Django integration, focusing on template usage within the 'templates' directory. It encourages using Django's templating engine with HTMX attributes. globs: /templates//.
additional-htmx-and-flask-instructions
Provides additional instructions for HTMX and Flask, primarily related to templating.