agentleFS
legions-developerlegions-developer/invoicely/.cursor/rules/nextjs-cursor-rule.mdc

invoicely / rules

Cursor rule923 starsChanged 5 months agoMITView on GitHub

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. - Follow seprate export const component name like don't "export const Button…

We split this nextjs-cursor-rule.mdc into the rules it gives an agent

20 rules. About 0 are common, 18 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈18

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write concise, technical TypeScript code with accurate examples.

    line 9
  2. Distinctive:

    Use functional and declarative programming patterns.

    line 10
  3. Distinctive:

    Prefer iteration and modularization over code duplication.

    line 11
  4. Distinctive:

    Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).

    line 12
  5. Distinctive:

    Follow seprate export const component name like don't "export const Button = () => {}" make it do like "const Button = () => {} export { …

    line 14
  6. Distinctive:

    Don't use default exports.

    line 15
  7. Very specific:

    use name.client.tsx for file having "use client" or its a client component so add (.client.tsx) in end of file name.

    line 18
  8. Distinctive:

    Use lowercase with dashes for directories (e.g., components/auth-wizard).

    line 19
  9. Distinctive:

    Use TypeScript for all code.

    line 24
  10. Distinctive:

    Avoid enums; use maps instead.

    line 25
  11. Distinctive:

    Use functional components with TypeScript interfaces.

    line 26
  12. Distinctive:

    Use the "function" keyword for pure functions.

    line 29
  13. Distinctive:

    Avoid unnecessary curly braces in conditionals.

    line 30
  14. Distinctive:

    Use Shadcn UI, Radix, and Tailwind for components and styling.

    line 34
  15. Distinctive:

    Use dynamic loading for non-critical components.

    line 40
  16. Distinctive:

    Use 'nuqs' for URL search parameter state management.

    line 44
  17. Distinctive:

    Use only for Web API access in small components.

    line 48
  18. Distinctive:

    Avoid for data fetching or state management.

    line 49
  19. Distinctive:

    use <type>(required scope any related to commit file): single title for commit without description

    line 52
  20. Very specific:

    Follow Next.js docs for Data Fetching, Rendering, and Routing.

    line 55

≈ “Common” is an estimate: at least 1 in 5 of the 6,350 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
nextjs-cursor-rule.mdc
---
description: 
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.
  - Follow seprate export const component name like don't "export const Button = () => {}" make it do like "const Button = () => {}  export { Button }" 
  - Don't use default exports.
  
  Naming Conventions
  - use name.client.tsx for file having "use client" or its a client component so add (.client.tsx) in end of file name.
  - Use lowercase with dashes for directories (e.g., components/auth-wizard).
  - Favor named exports for components.
  - For all Zod Type must include "Zod" in front of every type of interace example "InvoiceSchema" should be "ZodInvoiceSchema".
  
  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':
    - Favor server components and Next.js SSR.
    - Use only for Web API access in small components.
    - Avoid for data fetching or state management.

  Github Commit Syntax
  - use <type>(required scope any related to commit file): single title for commit without description
 
  
  Follow Next.js docs for Data Fetching, Rendering, and Routing.
  

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.