nextjs-patterns
Skill71 starsChanged 7 months agoMITView on GitHub
Comprehensive patterns and best practices for Next.js 14+ / 15+ App Router architecture, Server Components, and modern full-stack React development. Guidance: If you need deeper walkthroughs, refer to the resources/ folder within this skill.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- theyoungastronauts/polaristheir own version, first seen Nov 1, 2026
- theyoungastronauts/waypoint-mdtheir own version, first seen Jul 8, 2026
- Nadav011/apex-skillstheir own version, first seen Apr 22, 2026
- peopleforrester/claude-dotfilestheir own version, first seen Apr 5, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- theyoungastronauts/polaris★ 4same name
- peopleforrester/claude-dotfiles★ 3same name
- Nadav011/apex-skills★ 0same name
- theyoungastronauts/waypoint-md★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository117 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-healthSkill
- agent-styleSkill
- angular-best-practicesSkill
- annotateSkill
- api-designSkill
- architecture-decision-recordsSkill
- aws-serverlessSkill
- backend-architectSkill
- backend-patternsSkill
- brainstormSkill
- bug-reportSkill
- changelogSkill
- claude-apiSkill
- cloud-architectSkill
- cloud-run-puppeteerSkill
- code-review-checklistSkill
- code-reviewSkill
- code-simplificationSkill
- codex-sddSkill
- commitSkill
- context-engineeringSkill
- database-architectSkill
- db-reviewSkill
- deep-interviewSkill
- design-reviewSkill
- design-systemSkill
- devops-deploySkill
- diagnoseSkill
- django-patternsSkill
- docker-patternsSkill
- dotnet-backend-patternsSkill
- dreamSkill
- drizzle-orm-expertSkill
- estimateSkill
- event-sourcing-architectSkill
- fastapi-proSkill
- fork-joinSkill
- freezeSkill
- frontend-designSkill
- frontend-patternsSkill
- frontend-ui-dark-tsSkill
- gate-checkSkill
- gemini-api-integrationSkill
- gitlab-ci-patternsSkill
- guardSkill
- handoffSkill
- hotfixSkill
- hybrid-cloud-architectSkill
- kubernetes-architectSkill
- laravel-patternsSkill
- launch-checklistSkill
- learnerSkill
- llm-app-patternsSkill
- localizeSkill
- map-systemsSkill
- map-workflowSkill
- markdown-injection-scannerSkill
- microservices-patternsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 4 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
4
Distinctive
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
- Distinctive: line 21
Server (Default): Use for data fetching, layouts, and static content.
- Distinctive: line 22
Client ('use client'): Use for interactivity (useState, useEffect), event handlers, and browser-only APIs.
- Very specific: line 26
App Router: Use the app/ directory for file-based routing.
- Very specific: line 44
Streaming: Use Suspense and loading.tsx to stream UI to the client.
- Distinctive: line 67
Use React Hook Form and Zod for robust, type-safe data entry.
- Very specific: line 70
Write unit/integration tests with Vitest and E2E flows with @playwright-skill.
- Very specific: line 79
Images: Always use next/image. Set priority for LCP elements.
- Distinctive: line 80
Dynamic Imports: Use for heavy client-side libraries.
- Very specific: line 81
Metadata API: Use generateMetadata for dynamic SEO tags per route.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Next.js Development Patterns
Comprehensive patterns and best practices for Next.js 14+ / 15+ App Router architecture, Server Components, and modern full-stack React development.
1. Foundational Principles
Server vs Client Components
- Server (Default): Use for data fetching, layouts, and static content.
- Client ('use client'): Use for interactivity (useState, useEffect), event handlers, and browser-only APIs.
- Decision Rule: Stay on the server as long as possible. Split components so the interactive "leaf nodes" are client-side while the data-heavy "branch nodes" remain on the server.
Routing & Organization
- App Router: Use the
app/directory for file-based routing. - Route Groups:
(group-name)for organization without affecting URL structure. - Special Files:
page.tsx,layout.tsx,loading.tsx,error.tsx,not-found.tsx. - Advanced Routing: Parallel routes (
@slot) and Intercepting routes ((.)).
2. Data Fetching & Caching
Strategy Matrix
| Pattern | Use Case | Implementation |
| Static | Blog posts, marketing | Cached at build time |
| ISR | Products, news | revalidate: 60 |
| Dynamic | User dashboards, search | no-store or force-dynamic |
Patterns
- Server Fetching: Fetch data directly in Server Components using
async/await. - Streaming: Use
Suspenseandloading.tsxto stream UI to the client. - Server Actions: Perform mutations with
use serverfunctions. Validate with Zod.
3. 8-Phase Development Workflow
Phase 1: Project Setup
Scaffold with @app-builder, configure TypeScript, and set up ESLint/Prettier.
Phase 2: Component Architecture
Design hierarchy and implement base layout components using @frontend-developer and @react-patterns.
Phase 3: Styling & Design
Configure Tailwind CSS v4 and design tokens using @tailwind-patterns and @frontend-design.
Phase 4: Data Fetching
Implement Server Component data fetching and set up React Query/SWR if client-side fetching is needed.
Phase 5: Routing & Navigation
Set up file-based routing, dynamic routes, and handle redirects/guards.
Phase 6: Forms & Validation
Use React Hook Form and Zod for robust, type-safe data entry.
Phase 7: Testing
Write unit/integration tests with Vitest and E2E flows with @playwright-skill.
Phase 8: Optimization & Deploy
Analyze bundle size, optimize images with next/image, and deploy to Vercel/similar.
4. Performance & Metadata
- Images: Always use
next/image. Setpriorityfor LCP elements. - Dynamic Imports: Use for heavy client-side libraries.
- Metadata API: Use
generateMetadatafor dynamic SEO tags per route.
Resources & Anti-Patterns
- implementation-playbook.md: Detailed code examples for every pattern.
- Anti-Pattern: Using
'use client'at the top level of every file. - Anti-Pattern: Fetching data inside
useEffectfor information available on first load.
Guidance: If you need deeper walkthroughs, refer to the
resources/folder within this skill.
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.

