agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when building Next.js applications with the App Router. Covers server and client component boundaries, data fetching and caching, server actions, streaming, and rendering strategy.
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill nextjs --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/nextjsContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when building Next.js applications with the App Router. Covers server and client component boundaries, data fetching and caching, server actions, streaming, and rendering strategy.
name: nextjs description: Use when building Next.js applications with the App Router. Covers server and client component boundaries, data fetching and caching, server actions, streaming, and rendering strategy. metadata: category: frontend version: 1.0.0 tags: [nextjs, react, ssr, rsc, caching]
Build Next.js applications where the server/client boundary is drawn deliberately, caching is understood rather than fought, and the rendering strategy matches what the page actually needs.
1. **Default to server components** — They ship no JavaScript. Add `"use client"` only where you need state, effects, or browser APIs — and add it to the leaf, not the page. 2. **Fetch where you render** — Fetch data in the component that needs it. Requests are deduplicated within a render pass; prop-drilling data down from the page is unnecessary. 3. **Set the cache explicitly** — Every `fetch` gets a deliberate `cache` or `next.revalidate`. Relying on the framework default is how you ship stale prices. 4. **Stream the slow parts** — Wrap slow sections in `<Suspense>` with a meaningful fallback so the shell renders immediately. 5. **Mutate with server actions** — Validate the input (it is a public endpoint, whatever it looks like), perform the write, then `revalidateTag` or `revalidatePath` for exactly what changed.
**Server component with explicit caching, streaming a slow section:**
// app/orders/[id]/page.tsx — a server component by default
export default async function OrderPage({ params }: { params: Promise<{ id: string }> }) {
const { id } = await params;
const order = await fetch(`${API}/orders/${id}`, {
next: { tags: [`order:${id}`], revalidate: 60 },
}).then((r) => r.json());
return (
<main>
<OrderHeader order={order} />
{/* Shell renders immediately; this streams in when ready. */}
<Suspense fallback={<TimelineSkeleton />}>
<OrderTimeline orderId={id} />
</Suspense>
{/* Only this leaf ships JavaScript. */}
<RefundButton orderId={id} />
</main>
);
}**Server action: authorize, validate, mutate, revalidate:**
"use server";
export async function refundOrder(orderId: string, formData: FormData) {
const session = await auth();
if (!session) throw new Error("Unauthorized"); // a server action is a public endpoint
const parsed = RefundSchema.safeParse({
amountCents: formData.get("amountCents"),
});
if (!parsed.success) {
return { error: parsed.error.flatten().fieldErrors };
}
await orders.refund(orderId, parsed.data.amountCents, session.user.id);
revalidateTag(`order:${orderId}`); // precise invalidation
return { ok: true };
}A curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Repo: nimadorostkar/Claude-Skills-collection
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory, structuring notes for retrieval, and…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should not be trusted to remember,…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling, versioning, testing, and…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive disclosure, and the difference between a…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base model, and measuring whether the…