Agent skill
nextjs-knowledge-skill
Skill providing structured Next.js knowledge: App Router patterns, RSC usage, rendering/data strategies, and modern Next.js best practices.
Install this agent skill to your Project
npx add-skill https://github.com/adilkalam/orca/tree/main/skills/nextjs-knowledge-skill
SKILL.md
Next.js Knowledge Skill – Architecture & Patterns
This skill equips agents with high-level Next.js knowledge without bloating individual agent prompts.
It is intended for:
nextjs-grand-architectnextjs-architect- Next.js specialists (TS/perf/a11y/SEO) when they need architectural context.
Core Next.js Concepts (v13+)
App Router
- File-system routing with
app/directory - Layouts for shared UI across routes
- Route groups
(folder)for organization without affecting URL - Parallel routes
@folderfor simultaneous rendering - Intercepting routes
(..)folderfor modals and overlays
React Server Components (RSC)
-
Server Components (default): Render on server, reduce client bundle
- Good for: Data fetching, accessing backend resources, static content
- Cannot: Use hooks, handle events, use browser APIs
-
Client Components (
"use client"): Run in browser- Good for: Interactivity, hooks, event handlers, browser APIs
- Pattern: Keep client boundaries as low in the tree as possible
Rendering Strategies
-
Static Site Generation (SSG)
- Pre-render at build time
- Use:
output: 'export'for full static export - Use:
generateStaticParams()for dynamic routes
-
Server-Side Rendering (SSR)
- Render on each request
- Use:
cache: 'no-store'in fetch
-
Incremental Static Regeneration (ISR)
- Re-generate pages after deployment
- Use:
revalidateoption in fetch or route segment config
-
Streaming
- Send UI progressively as it renders
- Use:
loading.tsxfor instant loading states - Use: Suspense boundaries for granular streaming
Data Fetching Patterns
-
Server Components: Fetch directly in component
tsxasync function getData() { const res = await fetch('https://...', { cache: 'force-cache' }) return res.json() } export default async function Page() { const data = await getData() return <div>{data.title}</div> } -
Parallel Fetching: Multiple fetches resolve concurrently
-
Sequential Fetching: Await one fetch before starting another
-
Automatic Deduplication: Same fetch called multiple times → single request
Static Exports
For fully static sites (output: 'export'):
- All routes pre-rendered at build time
- No server-side features (Server Actions, dynamic routes without
generateStaticParams) - Data fetching runs during
next build - Good for: Hosting on CDN, static site hosts, or edge networks
CSS & Styling
Next.js supports multiple approaches:
- CSS Modules: Scoped CSS with
.module.cssfiles - Global CSS: Import in
app/layout.tsx - CSS-in-JS: styled-components, emotion, etc.
- Utility-first: Tailwind CSS integration
- Sass: Built-in support for
.scssand.sass
Usage Pattern
-
When planning a Next.js task:
- Determine rendering strategy (static, SSR, ISR)
- Decide RSC vs client component boundaries
- Choose data fetching approach
- Consider caching strategy
-
When writing implementation plans:
- Reflect these decisions in architecture path
- Document component boundaries (server vs client)
- Note any dynamic routes needing
generateStaticParams
-
Best practices:
- Prefer Server Components for non-interactive content
- Use Client Components only where needed (interactivity, hooks)
- Leverage caching with appropriate fetch options
- Optimize images with
next/image - Use route groups for clean organization
This skill provides the architectural foundation for building performant, well-structured Next.js applications without requiring agents to memorize all patterns upfront.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
web-interface-guidelines
Web UI quality rules: interactions, forms, loading, animations, layout, content, performance, accessibility, design. Apply to all web UI work. Adapted from Vercel Design Guidelines.
react-performance
React/Next.js performance patterns with wrong/right code examples. Apply when building or reviewing React components. Adapted from Vercel React Best Practices by @shuding.
stripe-integration
Payment integration patterns for Stripe. Covers checkout sessions, subscriptions, webhooks, idempotency, and the sharp edges that cause real-money bugs. Backend-agnostic with examples for Next.js App Router and Django REST Framework.
testing-strategy
Testing strategies and best practices for unit, integration, and end-to-end tests. Use when setting up test infrastructure, writing test cases, or deciding what to test. Covers test pyramid, mocking strategies, and coverage guidelines.
frontend-aesthetics
Global frontend aesthetics skill that helps Claude avoid generic "AI slop" UI and make bold, intentional visual decisions while still honoring each project's design-dna, tokens, and architecture.
pg-style-editor
Edit writing to adopt Paul Graham's exceptionally clear style for research and long-form content - concrete language, varied sentence rhythm, accessible formality, specific evidence. Use when user wants to rewrite content in PG's style or asks to "make this clearer" or "simplify research writing."
Didn't find tool you were looking for?