skills/nextjs-app-router/SKILL.md
Next.js App Router best practices, Server Components, Server Actions, routing patterns, and data fetching strategies. Use when building Next.js applications with the App Router.
npx skillsauth add sabahattinkalkan/antigravity-fullstack-hq nextjs-app-routerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
app/
├── (auth)/ # Route Group
│ ├── login/page.tsx
│ ├── register/page.tsx
│ └── layout.tsx
├── (dashboard)/
│ ├── layout.tsx
│ ├── page.tsx
│ └── [projectId]/
│ └── page.tsx
├── api/
│ └── webhooks/route.ts
├── layout.tsx
├── page.tsx
├── loading.tsx
├── error.tsx
└── not-found.tsx
// No directive needed - Server Component by default
import { prisma } from '@/lib/db'
export default async function UsersPage() {
const users = await prisma.user.findMany()
return <UserList users={users} />
}
'use client'
import { useState } from 'react'
export function Counter() {
const [count, setCount] = useState(0)
return <button onClick={() => setCount(c => c + 1)}>{count}</button>
}
// lib/actions/users.ts
'use server'
import { revalidatePath } from 'next/cache'
import { redirect } from 'next/navigation'
export async function createUser(formData: FormData) {
const email = formData.get('email') as string
await prisma.user.create({ data: { email } })
revalidatePath('/users')
redirect('/users')
}
import { createUser } from '@/lib/actions/users'
export function CreateUserForm() {
return (
<form action={createUser}>
<input name="email" type="email" required />
<button type="submit">Create</button>
</form>
)
}
export default async function Dashboard() {
const [user, posts] = await Promise.all([
getUser(),
getPosts()
])
return <DashboardView user={user} posts={posts} />
}
import { Suspense } from 'react'
export default function Page() {
return (
<div>
<h1>Dashboard</h1>
<Suspense fallback={<Loading />}>
<SlowComponent />
</Suspense>
</div>
)
}
// Revalidate every 60 seconds
fetch(url, { next: { revalidate: 60 } })
// No caching
fetch(url, { cache: 'no-store' })
// Static (default)
fetch(url)
// app/(dashboard)/layout.tsx
import { redirect } from 'next/navigation'
import { auth } from '@/lib/auth'
export default async function DashboardLayout({ children }) {
const session = await auth()
if (!session) redirect('/login')
return <div>{children}</div>
}
testing
Generating Excel files with xlsx/exceljs in Node.js. Use when generating .xlsx reports, data exports, dashboards, or spreadsheets from database data.
development
Playwright E2E patterns, Testing Library component tests, test selectors. Use when writing browser tests, component tests, or setting up an E2E testing pipeline for a Next.js or React app.
development
Web design best practices, accessibility, responsive layout, color contrast. Use when auditing a UI for a11y compliance, designing responsive layouts, or establishing design standards across a web app.
tools
TypeScript type system patterns, generics, utility types, and strict mode best practices. Use when writing or reviewing TypeScript code.