jolyui / rules
Cursor rule265 starsChanged 12 months agoMITView on GitHub
You are an expert in TypeScript, Node.js, Next.js App Router, React, Shadcn UI, Radix UI and Tailwind. Make sure not to start the dev server or run type of lint checking on agent mode.
We split this react-guidelines.mdc into the rules it gives an agent
20 rules. About 0 are common, 19 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈19
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Write concise, technical TypeScript code with accurate examples.
- Distinctive: line 13
Use functional and declarative programming patterns.
- Distinctive: line 14
Prefer iteration and modularization over code duplication.
- Distinctive: line 15
Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
- Distinctive: line 17
Use console.log({ value }) instead of console.log(value)
- Distinctive: line 18
Use onCallback instead of handleCallback
- Distinctive: line 19
Use flex and gap instead of space-x-n and space-y-n
- Distinctive: line 20
Use cn to compose class names
- Distinctive: line 25
Use lowercase with dashes for directories (e.g., components/auth-wizard).
- Distinctive: line 30
Use TypeScript for all code.
- Distinctive: line 31
Avoid enums; use maps instead.
- Distinctive: line 32
Use functional components with TypeScript interfaces.
- Distinctive: line 36
Use the "function" keyword for pure functions.
- Distinctive: line 37
Avoid unnecessary curly braces in conditionals.
- Distinctive: line 42
Use Shadcn UI, Radix, and Tailwind for components and styling.
- Distinctive: line 49
Use dynamic loading for non-critical components.
- Distinctive: line 57
Use only for Web API access in small components.
- Distinctive: line 58
Avoid for data fetching or state management.
- Very specific: line 59
Follow Next.js docs for Data Fetching, Rendering, and Routing.
- Distinctive: line 61
Make sure not to start the dev server or run type of lint checking on agent mode.
≈ “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.
Files
---
description:
globs:
alwaysApply: true
---
# Expert Guidelines
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.
- Use console.log({ value }) instead of console.log(value)
- Use onCallback instead of handleCallback
- Use flex and gap instead of space-x-n and space-y-n
- Use cn to compose class names
- Just pass ref directly to the component because of react 19
## 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
- 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.
- Follow Next.js docs for Data Fetching, Rendering, and Routing.
Make sure not to start the dev server or run type of lint checking on agent mode.
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 3,978 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository2 other files it gives its agents.
- .cursor/rules/component-setup.mdcCursor rule
- .cursor/rules/react-patterns.mdcCursor rule
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
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.

