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.
.cursor/rules/typescript-nodejs-nextjs-app-cursorrules-prompt-fi.mdcWhat 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
nuqspackage
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.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.claude/rules/typescript-nodejs-nextjs-app-cursorrules-prompt-fi.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/typescript-nodejs-nextjs-app-cursorrules-prompt-fi.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/typescript-nodejs-nextjs-app-cursorrules-prompt-fi.mdManually: put the files in place
.clinerules/typescript-nodejs-nextjs-app-cursorrules-prompt-fi.mdStep 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