app-router
Next.js App Router - Server components, layouts, routing patterns
When & Why to Use This Skill
This Claude skill provides comprehensive expertise in Next.js App Router architecture, enabling developers to build high-performance, scalable web applications. It focuses on mastering React Server Components (RSC), nested layouts, and advanced routing patterns to optimize both developer productivity and end-user experience through modern web standards.
Use Cases
- Architecting Complex Layouts: Designing root and nested layouts to manage shared UI state and consistent branding across multi-level navigation structures.
- Performance Optimization: Implementing a server-first approach using Server Components to minimize client-side JavaScript bundles and improve Core Web Vitals.
- Advanced UI Patterns: Utilizing Parallel Routes and Intercepting Routes to create sophisticated user interfaces like modals, side-by-side views, and conditional rendering without complex state management.
- Scalable Project Organization: Leveraging Route Groups to organize large-scale application folders logically without impacting the public URL structure.
- Data Fetching Strategy: Implementing efficient server-side data fetching within Server Components to reduce waterfalls and improve initial page load speeds.
| name | app-router |
|---|---|
| description | "Next.js App Router - Server components, layouts, routing patterns" |
| sasmp_version | "1.3.0" |
| bonded_agent | nextjs-expert |
| bond_type | PRIMARY_BOND |
App Router Skill
Overview
Master Next.js 14+ App Router with server components, layouts, and modern routing patterns.
Capabilities
- Layouts: Root layout, nested layouts, templates
- Server Components: Default server rendering
- Client Components: Interactive with 'use client'
- Route Groups: (folder) for organization
- Parallel Routes: @slot for simultaneous rendering
- Intercepting Routes: (.) notation patterns
Examples
// app/layout.tsx
export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html lang="en">
<body>{children}</body>
</html>
)
}
// app/dashboard/page.tsx
export default async function DashboardPage() {
const data = await fetchData() // Server-side
return <Dashboard data={data} />
}
Best Practices
- Use server components by default
- Add 'use client' only when needed
- Leverage layouts for shared UI
- Use loading.tsx for suspense