skills/nextjs_specialist/SKILL.md
--- name: nextjs_specialist router_kit: DevOpsKit description: Next.js 15 App Router, Server Components, SSR/SSG optimizasyonu ve modern Next.js best practices. metadata: skillport: category: development tags: [accessibility, api integration, backend, browser apis, client-side, components, css3, debugging, deployment, frameworks, frontend, fullstack, html5, javascript, libraries, nextjs specialist, node.js, npm, performance optimization, responsive design, seo, state management, testin
npx skillsauth add vuralserhat86/antigravity-agentic-skills skills/nextjs_specialistInstall 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.
Next.js 15 App Router ve Server Components rehberi.
app/
├── layout.tsx # Root layout
├── page.tsx # Home page (/)
├── loading.tsx # Loading UI
├── error.tsx # Error boundary
├── not-found.tsx # 404 page
├── globals.css
│
├── (marketing)/ # Route group (URL'de görünmez)
│ ├── about/
│ │ └── page.tsx # /about
│ └── contact/
│ └── page.tsx # /contact
│
├── dashboard/
│ ├── layout.tsx # Nested layout
│ ├── page.tsx # /dashboard
│ └── settings/
│ └── page.tsx # /dashboard/settings
│
├── blog/
│ ├── page.tsx # /blog
│ └── [slug]/
│ └── page.tsx # /blog/:slug (dynamic)
│
└── api/
└── users/
└── route.ts # API route
| Dosya | Amaç |
|-------|------|
| layout.tsx | Shared layout, state korunur |
| page.tsx | Unique route content |
| loading.tsx | Suspense fallback |
| error.tsx | Error boundary |
| not-found.tsx | 404 handler |
| route.ts | API endpoint |
// app/users/page.tsx
// ✅ Server Component - 'use client' yok
async function UsersPage() {
const users = await db.users.findMany(); // Direkt DB erişimi
return (
<ul>
{users.map(user => (
<li key={user.id}>{user.name}</li>
))}
</ul>
);
}
export default UsersPage;
'use client'; // ⚠️ Dosyanın en üstünde
import { useState } from 'react';
export function Counter() {
const [count, setCount] = useState(0);
return (
<button onClick={() => setCount(c => c + 1)}>
Count: {count}
</button>
);
}
// Server Component
import { Counter } from './Counter'; // Client Component
async function Dashboard() {
const data = await fetchData(); // Server'da çalışır
return (
<div>
<h1>{data.title}</h1>
<Counter /> {/* Client Component */}
</div>
);
}
| Server Component | Client Component | |------------------|------------------| | Data fetching | Interactivity (onClick, onChange) | | Backend erişimi | Browser API (localStorage) | | Sensitive logic | Hooks (useState, useEffect) | | Büyük dependencies | Event listeners |
// Otomatik cache
async function Page() {
const res = await fetch('https://api.example.com/data');
const data = await res.json();
return <div>{data.title}</div>;
}
// Cache control
const res = await fetch(url, {
cache: 'force-cache', // Default - cache
// cache: 'no-store', // Her request'te fresh
// next: { revalidate: 60 }, // ISR - 60 saniye
});
// app/actions.ts
'use server';
export async function createUser(formData: FormData) {
const name = formData.get('name');
await db.users.create({ data: { name } });
revalidatePath('/users');
}
// app/users/page.tsx
import { createUser } from './actions';
export default function Page() {
return (
<form action={createUser}>
<input name="name" />
<button type="submit">Create</button>
</form>
);
}
// Default - build time'da generate
export default function Page() {
return <h1>Static Page</h1>;
}
// Dynamic segments için
export async function generateStaticParams() {
const posts = await getPosts();
return posts.map(post => ({ slug: post.slug }));
}
// Her request'te render
export const dynamic = 'force-dynamic';
export default async function Page() {
const data = await fetchRealTimeData();
return <div>{data.value}</div>;
}
export const revalidate = 60; // 60 saniye
export default async function Page() {
const data = await fetchData();
return <div>{data.value}</div>;
}
import Image from 'next/image';
<Image
src="/hero.jpg"
alt="Hero"
width={1200}
height={600}
priority // LCP için
placeholder="blur"
blurDataURL="data:image/..."
/>
// app/layout.tsx
import { Inter } from 'next/font/google';
const inter = Inter({
subsets: ['latin'],
display: 'swap',
});
export default function Layout({ children }) {
return (
<html className={inter.className}>
<body>{children}</body>
</html>
);
}
// Static
export const metadata = {
title: 'My App',
description: 'App description',
};
// Dynamic
export async function generateMetadata({ params }) {
const post = await getPost(params.slug);
return {
title: post.title,
openGraph: { images: [post.image] },
};
}
app/
├── @modal/
│ └── login/page.tsx
├── @sidebar/
│ └── page.tsx
└── layout.tsx
// layout.tsx
export default function Layout({ children, modal, sidebar }) {
return (
<>
{sidebar}
{children}
{modal}
</>
);
}
Next.js Specialist v1.1 - Enhanced
Kaynak: Next.js App Router Documentation & Vercel Security Guide
useState, onClick) gereken yaprak (leaf) nodları Client Component yap.Suspense sınırlarını belirle ve loading.tsx dosyalarını oluştur.Promise.all kullan).auth() çağır).next/image kullan ve sizes prop'unu doğru ayarla.next/font ile fontları optimize et (Layout shift'i önler).next/script ve strategy="lazyOnload" ile yükle.| Aşama | Doğrulama | |-------|-----------| | 1 | "Hydration Error" alıyor musun? (Server/Client HTML uyuşmazlığı) | | 2 | LCP (Largest Contentful Paint) < 2.5s mi? | | 3 | Hassas veriler (API Key) Client bundle'a sızıyor mu? |
tools
Production-tested setup for Zustand state management in React. Includes patterns for persistence, devtools, and TypeScript patterns. Prevents hydration mismatches and render loops.
development
Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas
development
--- name: websocket_engineer router_kit: FullStackKit description: WebSocket specialist for real-time communication systems. Invoke for Socket.IO, WebSocket servers, bidirectional messaging, presence systems. Keywords: WebSocket, Socket.IO, real-time, pub/sub, Redis. triggers: - WebSocket - Socket.IO - real-time communication - bidirectional messaging - pub/sub - server push - live updates - chat systems - presence tracking role: specialist scope: implementation output-format:
tools
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.