forge-frontend-nextjs

Enforce Next.js 16 app-router server-first patterns in React code.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/f4rkh4d/forge-skill --skill forge-frontend-nextjs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: forge-frontend-nextjs
Source: https://github.com/f4rkh4d/forge-skill/tree/main/skills/design/forge-frontend-nextjs
Command: npx skills add https://github.com/f4rkh4d/forge-skill --skill forge-frontend-nextjs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents AI-generated Next.js code from falling back to client components, client-side fetching, legacy routing patterns, and incorrect caching/streaming behavior—so your app router projects stay server-first, type-correct, and performant.

Core Features & Use Cases

  • Server-first React Server Components: Enforces that layouts/pages default to server, with client boundaries pushed as deep as possible.
  • Correct app-router data fetching & caching: Moves initial data loading out of useEffect into async server components and requires Next fetch cache controls for stability.
  • Streaming, Suspense, and segment conventions: Requires Suspense for slow UI and uses loading.tsx, error.tsx, and not-found handling per segment.
  • Server actions for mutations: Replaces trivial mutation API routes with server actions and promotes safe return shapes for failures.
  • Next 16+ routing correctness: Ensures async params/searchParams are awaited to avoid type errors and runtime issues.

Quick Start

Use forge-frontend-nextjs when you need an AI to write a Next.js 16 app-router page that uses React Server Components, Suspense, loading/error segments, correct async params handling, and server actions instead of client-side useEffect fetching.

Frequently Asked Questions about forge-frontend-nextjs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I stop AI from writing client-side fetching in Next.js app-router projects?

To stop AI from writing client-side fetching in Next.js, enforce server-first React Server Components by banning useEffect for initial data loads and moving data fetching into async server components with explicit Next fetch cache controls.

What is the correct way to use async params and searchParams in Next.js 16?

The correct way to use async params and searchParams in Next.js 16 is to await them directly inside server components, preventing type errors and runtime issues while ensuring your app-router routes remain server-rendered.

How do I handle streaming and slow UI loading states with React Server Components?

Handle streaming and slow UI loading states with React Server Components by wrapping slow UI in Suspense boundaries and using the loading.tsx, error.tsx, and not-found segment conventions to manage rendering states per route.

When should I use server actions instead of API routes for mutations in Next.js?

Use server actions instead of trivial mutation API routes in Next.js to handle form submissions and data mutations directly on the server, promoting safe return shapes for failures and minimizing the client component surface.

Why does my Next.js app router code default to 'use client' when generated by AI?

Next.js app router code defaults to 'use client' when generated by AI due to a lack of server-first discipline, which can be fixed by eliminating top-level 'use client' directives and pushing client boundaries as deep as possible.

Can I use Tailwind 4 with server actions and React Server Components?

Yes, you can use Tailwind 4 with server actions and React Server Components by keeping styling on the server and ensuring mutations are handled via server actions without expanding the client component surface.