

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
123456# Next.js Rules78## **Core Principles**9- **Default to Server Components** for better performance.10- **Minimize `'use client'` directives** to leverage SSR benefits.11- Follow **App Router patterns and conventions**.12- **Handle errors properly** using `error.tsx` and **error boundaries**.13- Use **Next.js 15 built-in components** (`Image`, `Link`, `Script`, `Head`, etc.).14- Optimize **Web Vitals** (`LCP`, `CLS`, `FID`).1516### **Key Conventions**17- Use **`nuqs`** for URL search parameter state management.18- **Limit `'use client'`**:19 - Favor **Server Components** and **Next.js SSR**.20 - Use only for **Web API access in small components**.21 - Avoid for **data fetching or state management**.2223---2425## **Component Architecture**26```tsx27// Prefer Server Components by default28export function ServerComponent() {29 return (30 <section className="space-y-4">31 <h1>Server Rendered</h1>32 <ClientComponent />33 </section>34 )35}3637// Use 'use client' only when necessary38'use client'39function ClientComponent() {40 const [state, setState] = useState(false)41 return <button onClick={() => setState(!state)}>Toggle</button>42}43```4445---4647## **Data Fetching**48- **Use Server Components** for data fetching.49- **Implement proper caching strategies**.50- **Handle loading and error states**.51- **Use revalidation patterns** to optimize freshness.5253---5455## **Server Actions**56```tsx57'use server'58import { type ActionResult, success, failure } from '@chaingraph/next'59import { createSafeActionClient } from 'next-safe-action'6061export const saveAction = createSafeActionClient()62 .schema(actionSchema)63 .action(async ({ parsedInput }): Promise<ActionResult<T>> => {64 try {65 // Happy path66 return success(result)67 } catch (error) {68 return failure({69 code: 'UNEXPECTED_ERROR',70 error,71 label: 'saveAction'72 })73 }74 })75```7677---7879## **Performance Patterns**80```tsx81// Use Image component with proper sizing82import { Image } from 'next/image'8384export function OptimizedImage() {85 return (86 <Image87 src="/hero.webp"88 alt="Hero"89 width={1200}90 height={630}91 priority={true}92 className="w-full"93 />94 )95}9697// Use Suspense for loading states98export function LazyComponent() {99 return (100 <Suspense fallback={<LoadingSkeleton />}>101 <ExpensiveComponent />102 </Suspense>103 )104}105```106107---108109## **Next.js Optimizations**110- **Use App Router** with `nuqs` for efficient navigation and state management.111- **Implement streaming** with `Suspense` for progressive loading.112- **Follow proper caching strategies**:113 - Use `fetch` cache options appropriately.114 - Implement **revalidation when needed**.115- **Minimize `'use client'`**, `'useEffect'`, and `'setState'` in favor of **React Server Components (RSC)**.116- **Wrap client components** in `Suspense` with a fallback.117- **Use dynamic loading** for non-critical components.118- **Optimize images**:119 - Use **WebP format**.120 - Include **size data**.121 - Implement **lazy loading**.122123---124125## **UI & Styling**126- **Use Shadcn UI, Radix, and Tailwind** for components and styling.127- **Implement responsive design** with **Tailwind CSS** using a **mobile-first approach**.128
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| L1Network/chaingraph.cursor/rules/tailwind.mdc · 5 | Cursor rules | styleuido-not | 42/100 | 14 days ago | |
| L1Network/chaingraph.cursor/rules/typescript.mdc · 5 | Cursor rules | stylearchtypesdo-not | 65/100 | 14 days ago | |
| L1Network/chaingraph.cursor/rules/web-vitals-perf.mdc · 5 | Cursor rules | performancedo-not | 32/100 | 14 days ago | |
| L1Network/chaingraph.cursor/rules/react-hooks.mdc · 5 | Cursor rules | styleperformancedo-not | 61/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 14 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 46 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 14 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 14 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 14 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 14 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 14 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 14 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 46 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/l1network-chaingraph-cursor-rules-nextjs)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.