ilude/claude-code-config/nextjs-workflow
Claude Code and agent skill by ilude/claude-code-config
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Next.js framework workflow guidelines. Activate when working with Next.js projects, next.config, app router, or Next.js-specific patterns.
Install
npx vskill@latest install ilude/claude-code-config/nextjs-workflowSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
Next.js Workflow
Tool Grid
| Task | Tool | Command | |
|---|---|---|---|
| Run dev | Next.js | npm run dev | |
| Build | Next.js | npm run build | |
| Turbopack | Next.js | next dev --turbo | |
| Test | Vitest | vitest | |
| E2E | Playwright | playwright test | |
| Lint | ESLint + next | next lint |
App Router
App Router MUST be used for all new Next.js projects. Pages Router SHOULD only be used for legacy compatibility.
Directory Structure
Route Groups
Route groups (groupName) SHOULD be used to:
- Organize routes without affecting URL structure
- Apply different layouts to route subsets
- Split application into logical sections
Server Components
Server Components are the DEFAULT. Client Components MUST be explicitly marked.
When to Use Server Components (Default)
- Data fetching
- Accessing backend resources directly
- Keeping sensitive data on server (tokens, API keys)
- Large dependencies that SHOULD stay server-side
When to Use Client Components
Client Components MUST be marked with 'use client' directive at the top of the file.
Use Client Components for:
- Interactivity (onClick, onChange, etc.)
- React hooks (useState, useEffect, useContext)
- Browser-only APIs (localStorage, window)
- Custom hooks with state or effects
Component Composition Pattern
Server Components MAY import Client Components. Client Components MUST NOT import Server Components directly but MAY accept them as props.
File-Based Routing
Special Files
| File | Purpose | Required | |
|---|---|---|---|
layout.tsx | Shared UI for segment and children | Root only | |
page.tsx | Unique UI for route | Yes for route | |
loading.tsx | Loading UI with Suspense | OPTIONAL | |
error.tsx | Error boundary | OPTIONAL | |
not-found.tsx | 404 UI | OPTIONAL | |
route.ts | API endpoint | OPTIONAL | |
template.tsx | Re-rendered layout | OPTIONAL | |
default.tsx | Parallel route fallback | OPTIONAL |
Dynamic Routes
Parallel Routes
Parallel routes SHOULD be used for complex layouts with independent navigation.
Intercepting Routes
Partial Prerendering (PPR)
PPR SHOULD be enabled for pages with static shells and dynamic content.
Configuration
Usage
Server Actions
Server Actions MUST be used for form handling and data mutations.
Inline Server Actions
Separate Action Files
Actions MAY be defined in separate files for reuse.
Client Component Usage
Data Fetching
Request Deduplication
Next.js automatically deduplicates fetch requests. The same URL SHOULD be fetched in multiple components without concern.
Caching Options
On-Demand Revalidation
Image Optimization
next/image MUST be used for all images.
Basic Usage
Responsive Images
Remote Images
Remote domains MUST be configured in next.config.ts:
Font Optimization
next/font SHOULD be used for optimal font loading.
Google Fonts
Local Fonts
Metadata API
Static Metadata
Dynamic Metadata
Template Pattern
Middleware
Middleware MUST be placed at middleware.ts in the project root.
Basic Middleware
Headers and Rewrites
Environment Variables
Naming Convention
| Prefix | Availability | Example | |
|---|---|---|---|
| None | Server only | DATABASE_URL | |
NEXT_PUBLIC_ | Client + Server | NEXT_PUBLIC_API_URL |
Usage
Validation
Environment variables SHOULD be validated at build time:
TypeScript Configuration
Required tsconfig.json Settings
Common Patterns
Loading States
Error Boundaries
Not Found
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/nextjs-workflow/SKILL.md
Popularity
- Repository stars
- 7
- 7-day trend score
- 10
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 17 Mar 2026, 8 months ago.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ilude/claude-code-config/nextjs-workflow)