AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Nextjs Mastery

skill-rohitg00-awesome-claude-code-toolkit-nextjs-mastery · by rohitg00

Next.js 14+ App Router patterns including RSC, ISR, middleware, parallel routes, and data fetching

No reviews yet
0 installs
10 views
0.0% view→install

Install

$ agentstack add skill-rohitg00-awesome-claude-code-toolkit-nextjs-mastery

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-rohitg00-awesome-claude-code-toolkit-nextjs-mastery)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Nextjs Mastery? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Next.js Mastery

App Router Structure

app/
  layout.tsx              # Root layout (wraps all pages)
  page.tsx                # Home route /
  loading.tsx             # Route-level Suspense fallback
  error.tsx               # Route-level error boundary
  not-found.tsx           # Custom 404
  (marketing)/
    about/page.tsx        # /about (grouped without URL segment)
  dashboard/
    layout.tsx            # Nested layout for /dashboard/*
    page.tsx              # /dashboard
    @analytics/page.tsx   # Parallel route slot
    @activity/page.tsx    # Parallel route slot
    settings/
      page.tsx            # /dashboard/settings
  api/
    webhooks/route.ts     # Route handler (POST /api/webhooks)

Route groups (name) organize code without affecting URLs. Parallel routes @slot render multiple pages simultaneously.

Server Components and Data Fetching

async function ProductPage({ params }: { params: Promise }) {
  const { id } = await params;
  const product = await db.product.findUnique({ where: { id } });

  if (!product) notFound();

  return (
    
      {product.name}
      {product.description}
      }>
        
      
    
  );
}

async function Reviews({ productId }: { productId: string }) {
  const reviews = await db.review.findMany({ where: { productId } });
  return (
    
      {reviews.map(r => {r.text} - {r.rating}/5)}
    
  );
}

Server Components are the default. They run on the server, can access databases directly, and send zero JavaScript to the client.

ISR and Caching

export const revalidate = 3600;

async function BlogPage() {
  const posts = await fetch("https://api.example.com/posts", {
    next: { revalidate: 3600, tags: ["posts"] },
  }).then(r => r.json());

  return ;
}
import { revalidateTag, revalidatePath } from "next/cache";

export async function createPost(formData: FormData) {
  "use server";
  await db.post.create({ data: { title: formData.get("title") as string } });
  revalidateTag("posts");
  revalidatePath("/blog");
}

Middleware

import { NextResponse } from "next/server";
import type { NextRequest } from "next/server";

export function middleware(request: NextRequest) {
  const token = request.cookies.get("session")?.value;

  if (request.nextUrl.pathname.startsWith("/dashboard") && !token) {
    return NextResponse.redirect(new URL("/login", request.url));
  }

  const response = NextResponse.next();
  response.headers.set("x-request-id", crypto.randomUUID());
  return response;
}

export const config = {
  matcher: ["/dashboard/:path*", "/api/:path*"],
};

Middleware runs at the edge before every matched request. Keep it lightweight.

Server Actions

"use server";

import { z } from "zod";
import { revalidatePath } from "next/cache";

const schema = z.object({
  email: z.string().email(),
  name: z.string().min(2).max(100),
});

export async function updateProfile(prevState: any, formData: FormData) {
  const parsed = schema.safeParse(Object.fromEntries(formData));
  if (!parsed.success) {
    return { errors: parsed.error.flatten().fieldErrors };
  }

  await db.user.update({
    where: { email: parsed.data.email },
    data: { name: parsed.data.name },
  });

  revalidatePath("/profile");
  return { success: true };
}

Anti-Patterns

  • Adding 'use client' to top-level layout or page components
  • Fetching data on the client when it can be done in a Server Component
  • Using useEffect for data fetching instead of Server Components or use()
  • Not wrapping slow async components with ``
  • Putting heavy logic in middleware (it runs on every matched request)
  • Ignoring loading.tsx and error.tsx conventions

Checklist

  • [ ] Server Components used by default; 'use client' only on interactive leaves
  • [ ] Data fetching happens in Server Components with proper caching
  • [ ] `` boundaries wrap independent async sections
  • [ ] loading.tsx and error.tsx exist for key routes
  • [ ] Middleware is lightweight and only handles auth/redirects/headers
  • [ ] Server Actions validate input with Zod before database writes
  • [ ] revalidateTag or revalidatePath called after mutations
  • [ ] Route groups and parallel routes used to organize complex layouts

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.