agentleFS
agentset-aiagentset-ai/agentset/.cursor/rules/nextjs.mdc

agentset / rules

Cursor rule2.1k starsChanged 10 months agoMITView on GitHub

Next.js with TypeScript and Tailwind UI best practices

Trending

Quiet since September.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 2 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 1 mentionSep 2026: 2 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the agentset-ai/agentset repository that our weekly crawl found: only 8 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about agentset-ai/agentset

The biggest 5 of 8 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 8

Talked about on GitHub and Hacker News (8 times).

On GitHub · 6

1 more on GitHub

The file

Show its rules and text

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

16 rules. About 0 are common, 11 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use the App Router directory structure

    line 11
  2. Very specific:

    Place components in app directory for route-specific components

    line 12
  3. Very specific:

    Place shared components in components directory

    line 13
  4. Very specific:

    Place utilities and helpers in lib directory

    line 14
  5. Very specific:

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

    line 15
  6. Distinctive:

    Use Server Components by default

    line 19
  7. Distinctive:

    Use dynamic loading for non-critical components

    line 22
  8. Distinctive:

    Place static content and interfaces at file end

    line 24
  9. Distinctive:

    Use Server Components for data fetching when possible

    line 36
  10. Distinctive:

    Use appropriate caching strategies

    line 38
  11. Distinctive:

    Use the App Router conventions

    line 43
  12. Distinctive:

    Use dynamic routes appropriately

    line 45
  13. Distinctive:

    Use Zod for form validation

    line 51
  14. Very specific:

    Use react-hook-form for form handling defined in form.tsx

    line 52
  15. Distinctive:

    Use React Context sparingly

    line 60
  16. Distinctive:

    Prefer server state when possible

    line 61

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 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.mdc
---
description: Next.js with TypeScript and Tailwind UI best practices
globs: apps/web/**/*.tsx,apps/web/**/*.ts
alwaysApply: false
---

# Next.js Best Practices

## Project Structure

- Use the App Router directory structure
- Place components in `app` directory for route-specific components
- Place shared components in `components` directory
- Place utilities and helpers in `lib` directory
- Use lowercase with dashes for directories (e.g., `components/auth-wizard`)

## Components

- Use Server Components by default
- Mark client components explicitly with 'use client'
- Wrap client components in Suspense with fallback
- Use dynamic loading for non-critical components
- Implement proper error boundaries
- Place static content and interfaces at file end

## Performance

- Optimize images: Use WebP format, size data, lazy loading
- Minimize use of 'useEffect' and 'setState'
- Favor Server Components (RSC) where possible
- Use dynamic loading for non-critical components
- Implement proper caching strategies

## Data Fetching

- Use Server Components for data fetching when possible
- Implement proper error handling for data fetching
- Use appropriate caching strategies
- Handle loading and error states appropriately

## Routing

- Use the App Router conventions
- Implement proper loading and error states for routes
- Use dynamic routes appropriately
- Handle parallel routes when needed
- Whenever you need to use `useRouter`, import it like this `import { useRouter } from "@bprogress/next/app";` to show global proggress bar

## Forms and Validation

- Use Zod for form validation
- Use react-hook-form for form handling defined in [form.tsx](mdc:apps/web/src/components/ui/form.tsx)
- Implement proper server-side validation
- Handle form errors appropriately
- Show loading states during form submission

## State Management

- Minimize client-side state
- Use React Context sparingly
- Prefer server state when possible
- Implement proper loading states

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.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.