react-typescript-nextjs-nodejs-cursorrules-prompt-

react-typescript-nextjs-nodejs-cursorrules-prompt- is a cursor rule for Cursor from PatrickJS/awesome-cursorrules. It costs 1,008 tokens per session, scanned A, a copy of nextjs-react-typescript-cursorrules-prompt-file, CC0-1.0.

A set of coding rules for applications using React, TypeScript, Next.js, and Node.js, with additional guidance for web3 libraries and interface tools. Next.js is a React framework for building web applications.

In plain words
What is it for?
Use it when developing TypeScript applications with Next.js, React, Node.js, Vite, or web3 tools such as Viem and Wagmi.
Why use it?
It establishes shared conventions for code style, files, component exports, naming, and handling errors across frontend and server code.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc). Also seen: mentions Cursor.

Good fit Use it when developing TypeScript applications with Next.js, React, Node.js, Vite, or web3 tools such as Viem and Wagmi.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/patrickjs/awesome-cursorrules/react-typescript-nextjs-nodejs-cursorrules-prompt
About the project

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.

PatrickJS/awesome-cursorrules · 40,734 stars · on GitHub

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/PatrickJS/awesome-cursorrules

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 react-typescript-nextjs-nodejs-cursorrules-prompt-

README.md
[![agentmods](https://agentmods.dev/badge/rules/patrickjs/awesome-cursorrules/react-typescript-nextjs-nodejs-cursorrules-prompt.svg)](https://agentmods.dev/rules/patrickjs/awesome-cursorrules/react-typescript-nextjs-nodejs-cursorrules-prompt)
Your own site
<a href="https://agentmods.dev/rules/patrickjs/awesome-cursorrules/react-typescript-nextjs-nodejs-cursorrules-prompt"><img src="https://agentmods.dev/badge/rules/patrickjs/awesome-cursorrules/react-typescript-nextjs-nodejs-cursorrules-prompt.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,008 This file is loaded in full into every session.
When invoked 1,008 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 91% copy Near-identical to another mod 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.01008 $0.01008
Opus 5 $0.00504 $0.00504
Sonnet 5 $0.00202 $0.00202
Haiku 4.5 $0.00101 $0.00101

Measured 3d ago against content hash 91697cd0bea4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

react-typescript-nextjs-nodejs-cursorrules-prompt- 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.

Origin

This is a copy

91% identical to nextjs-react-typescript-cursorrules-prompt-file — 55 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

rules/react-typescript-nextjs-nodejs-cursorrules-prompt-.mdc · 99 lines

How it starts

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

You are an expert in Solidity, TypeScript, Node.js, Next.js 14 App Router, React, Vite, Viem v2, Wagmi v2, Shadcn UI, Radix UI, and Tailwind Aria.

Key Principles:

  • Write concise, technical responses with accurate TypeScript examples.
  • Use functional, declarative programming. Avoid classes.
  • Prefer iteration and modularization over duplication.
  • Use descriptive variable names with auxiliary verbs (e.g., isLoading).
  • Use lowercase with dashes for directories (e.g., components/auth-wizard).
  • Favor named exports for components.
  • Use the Receive an Object, Return an Object (RORO) pattern.

JavaScript/TypeScript:

  • Use "function" keyword for pure functions. Omit semicolons.
  • Use TypeScript for all code. Prefer interfaces over types. Avoid enums, use maps.
  • File structure: Exported component, subcomponents, helpers, static content, types.
  • Avoid unnecessary curly braces in conditional statements.
  • For single-line statements in conditionals, omit curly braces.
  • Use concise, one-line syntax for simple conditional statements (e.g., if (condition) doSomething()).
  • Prioritize error handling and edge cases:
    • Handle errors and edge cases at the beginning of functions.
    • Use early returns for error conditions to avoid deeply nested if statements.
    • Place the happy path last in the function for improved readability.
    • Avoid unnecessary else statements; use if-return pattern instead.
    • Use guard clauses to handle preconditions and invalid states early.
    • Implement proper error logging and user-friendly error messages.
    • Consider using custom error types or error factories for consistent error handling.

Dependencies:

  • Next.js 14 App Router
  • Wagmi v2
  • Viem v2

React/Next.js:

  • Use functional components and TypeScript interfaces.
  • Use declarative JSX.
  • Use function, not const, for components.
  • Use Shadcn UI, Radix, and Tailwind Aria for components and styling.
  • Implement responsive design with Tailwind CSS.
  • Use mobile-first approach for responsive design.
  • Place static content and interfaces at file end.
  • Use content variables for static content outside render functions.
  • Minimize 'use client', 'useEffect', and 'setState'. Favor RSC.
  • Use Zod for form validation.
  • Wrap client components in Suspense with fallback.
  • Use dynamic loading for non-critical components.
  • Optimize images: WebP format, size data, lazy loading.
  • Model expected errors as return values: Avoid using try/catch for expected errors in Server Actions. Use useActionState to manage these errors and return them to the client.
  • Use error boundaries for unexpected errors: Implement error boundaries using error.tsx and global-error.tsx files to handle unexpected errors and provide a fallback UI.
  • Use useActionState with react-hook-form for form validation.
  • Code in services/ dir always throw user-friendly errors that tanStackQuery can catch and show to the user.
  • Use next-safe-action for all server actions:
    • Implement type-safe server actions with proper validation.
    • Utilize the action function from next-safe-action for creating actions.
    • Define input schemas using Zod for robust type checking and validation.
    • Handle errors gracefully and return appropriate responses.
    • Use import type { ActionResponse } from '@/types/actions'
    • Ensure all server actions return the ActionResponse type
    • Implement consistent error handling and success responses using ActionResponse
    • Example:
      'use server'
      import { createSafeActionClient } from 'next-safe-action'
      import { z } from 'zod'
      import type { ActionResponse } from '@/app/actions/actions'
      const schema = z.object({
        value: z.string()
      })
      export const someAction = createSafeActionClient()
        .schema(schema)
        .action(async (input): Promise => {
          try {
            // Action logic here
            return { success: true, data: /* result */ }
          } catch (error) {
            return { success: false, error: error instanceof AppError ? error : appErrors.UNEXPECTED_ERROR, }
          }
        })
      

Read the full file on GitHub · 99 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. 3d ago First seen · 99 lines · 1,008 tokens per session scan A 91697cd0bea4

Subscribe to this mod's changes

react-typescript-nextjs-nodejs-cursorrules-prompt- is a cursor rule published in the GitHub repository PatrickJS/awesome-cursorrules (40,734 stars, last pushed 3mo ago), licensed CC0-1.0. It adds 1,008 tokens to every session, about $0.0050 per session on Opus 5. A static security scan graded it A with 0 findings. It is 91% identical to nextjs-react-typescript-cursorrules-prompt-file, differing in 55 lines, and is treated as a copy.