Skip to main content
rule

typescript-nodejs-nextjs-app-cursorrules-prompt-fi — Cursor rule

Configures Cursor for Next.js App Router, TypeScript, Tailwind, and Shadcn UI. It enforces React Server Components and keeps client-side state minimal.

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/typescript-nodejs-nextjs-app-cursorrules-prompt-fi.mdc
Open on GitHub

What typescript-nodejs-nextjs-app-cursorrules-prompt-fi does

This rule configures Cursor for TypeScript projects using the Next.js App Router, Tailwind CSS, and Shadcn UI. It directs the AI toward functional, declarative patterns while disallowing classes and enums in favor of interfaces and maps. Every file adheres to a predictable layout starting with the exported component, followed by subcomponents, helpers, and types.

Client state is deliberately kept to a minimum. The instructions favor React Server Components, enforce Suspense boundaries around client components, and recommend WebP images with explicit dimensions. The rule prescribes nuqs for managing URL search parameters, so projects without this dependency will need it installed via npm.

What it helps with

  • standardize file and component structure in Next.js App Router
  • minimize client directives and unnecessary component state
  • apply mobile-first styles with Tailwind CSS and Radix UI
  • manage URL search parameters with the nuqs package

Example prompts for the agent

  • Build a notes list page with search and pagination using nuqs.
  • Move the client form logic into a separate component wrapped in Suspense.
  • Create a responsive note card using Shadcn UI and Tailwind CSS.

How to install typescript-nodejs-nextjs-app-cursorrules-prompt-fi

Manually: put the files in place

.cursor/rules/typescript-nodejs-nextjs-app-cursorrules-prompt-fi.mdc

Frontmatter: description, globs, alwaysApply

Step by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules

Questions about typescript-nodejs-nextjs-app-cursorrules-prompt-fi

How do I install typescript-nodejs-nextjs-app-cursorrules-prompt-fi in Cursor?

Save the rule file to .cursor/rules/typescript-nodejs-nextjs-app-cursorrules-prompt-fi.mdc in your project repository. Cursor applies the rules across files matching the **/* pattern.

What does typescript-nodejs-nextjs-app-cursorrules-prompt-fi do?

It guides Cursor to write TypeScript code for the Next.js App Router stack using functional patterns, named exports, and React Server Components. It also sets standards for mobile-first layouts with Tailwind CSS and Radix UI.

Which dependencies does this rule expect in the project?

The configuration expects Tailwind CSS, Radix UI, and Shadcn UI for styling, along with the nuqs library for handling URL search parameters.

Source text

typescript-nodejs-nextjs-app-cursorrules-prompt-fi.mdc · CC0-1.0
---
description: "Cursor rules for TypeScript development with Node.js and Next.js app integration."
globs: **/*
alwaysApply: false
---
You are an expert in TypeScript, Node.js, Next.js App Router, React, Shadcn UI, Radix UI and Tailwind.

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 "function" keyword 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, and Tailwind for components and styling.
Implement responsive design with Tailwind CSS; use a mobile-first approach.

Performance Optimization

Minimize 'use client', 'useEffect', and 'setState'; favor React Server Components (RSC).
Wrap client components in Suspense with fallback.
Use dynamic loading for non-critical components.
Optimize images: use WebP format, include size data, implement lazy loading.

Key Conventions

Use 'nuqs' for URL search parameter state management.
Optimize Web Vitals (LCP, CLS, FID).
Limit 'use client': Follow Next.js docs for Data Fetching, Rendering, and Routing.

Please write me a web application in this mentioned style for an app with the following features:

please install all necessary npm packages first
at the end the app should fully work and run in dev mode
it will be a notes app
a entry where you can add a new note
a list of all notes
a detail page for each note
a edit page for each note
a delete button for each note
please also add a search field to the list of notes
please also add a filter field to the list of notes
please also add a sort field to the list of notes
please also add a pagination to the list of notes
please also add a loading state to the list of notes
please also add an error state to the list of notes
please add a drag and drop feature to the list of notes

© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set234

The whole set →
typescript-react-nextjs-cloudflare-cursorrules-pro A Cursor rule that points the agent at TypeScript, Next.js App Router, React and Cloudflare tooling. Useful when your project already runs on that stack. ★ 41,024repo stars typescript-react-cursorrules-prompt-file Cursor rule establishing standards for TypeScript and React codebases. It enforces functional components, strict typing, and a standard folder layout. ★ 41,024repo stars typescript-nodejs-react-vite-cursorrules-prompt-fi This rule sets TypeScript conventions for Node.js, React, and Vite projects, with guidance for TanStack Query, TanStack Router, and Tailwind. Use it to keep agent edits aligned with your codebase’s existing style. ★ 41,024repo stars typescript-nodejs-nextjs-react-ui-css-cursorrules- A Cursor rule that pins down how the agent writes TypeScript, Next.js App Router, React and Tailwind code. Useful when generated components drift from your conventions. ★ 41,024repo stars typescript-nodejs-nextjs-ai-cursorrules-prompt-fil This rule steers Cursor toward concrete code or direct explanations for TypeScript, Node.js, and Next.js projects with AI integration. ★ 41,024repo stars typescript-nextjs-supabase-cursorrules-prompt-file A Cursor rule that keeps TypeScript work on Next.js App Router and Supabase consistent: server components first, Shadcn UI, Tailwind. ★ 41,024repo stars typescript-nextjs-react-cursorrules-prompt-file Configures Cursor for TypeScript, Next.js 14 App Router, React, and Tailwind. Useful when building frontend interfaces with Vercel AI SDK streaming. ★ 41,024repo stars typescript-nextjs-cursorrules-prompt-file This rule sets coding conventions for TypeScript and Next.js App Router, with guidance for React and Daisy UI with Tailwind. Use it to steer Cursor toward those patterns in a project. ★ 41,024repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor