Cursor · PluginsFrameworks#1
Next.js
App Router, Server Components, Server Actions and caching.
by Prompt Studio
nextjsreacttypescript
Contents
Where it goes: .cursor/rules/nextjs.mdc
---
description: Convenciones y buenas prácticas de Next.js
globs: app/**/*.tsx,app/**/*.ts
alwaysApply: false
---
- Usa el App Router (`app/`). Los componentes son Server Components salvo que necesiten estado, efectos o eventos; en ese caso añade `'use client'` lo más abajo posible del árbol.
- Obtén datos en el servidor con `fetch` o el ORM directamente; no crees rutas de API solo para leer datos propios.
- Usa Server Actions para mutaciones y revalida con `revalidatePath` o `revalidateTag`.
- Exporta `metadata` o `generateMetadata` en cada página.
- Usa `next/image` y `next/font`; nunca etiquetas `<img>` sin dimensiones.
- Maneja estados con `loading.tsx`, `error.tsx` y `not-found.tsx`.
- Valida entradas de formularios y acciones con Zod.
More in Plugins
Python
Typing, package layout and tests with pytest.
React + TypeScript
Function components, hooks and strict typing.
Expo / React Native
Expo Router, styling and mobile performance.
Go
HTTP APIs, error handling and context.
Tailwind + shadcn/ui
Utility classes, design tokens and accessible components.
Ruby on Rails
Rails conventions, Hotwire and tests.