next

Organize Next.js projects with App Router directory structure and configuration.

Updated May 15, 2026
One-click install
npx skills add https://github.com/nachopalmeri/agents-system --skill next-nachopalmeri
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next
Source: https://github.com/nachopalmeri/agents-system/tree/main/.agents/skills/next
Command: npx skills add https://github.com/nachopalmeri/agents-system --skill next-nachopalmeri

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide provides a clear framework for organizing Next.js projects around the App Router, detailing recommended structure, conventions, and safe configuration practices to streamline development and maintenance.

Core Features & Use Cases

  • Enforces App Router structure: app/, app/api/, components/, lib/, public/ with next.config.js as the central config.
  • Guides server components default usage and client-side interactivity with use client when needed, plus environment variable hygiene (NEXT_PUBLIC_ for client).
  • Useful when scaffolding new Next.js projects or auditing existing ones to ensure consistency and maintainability.

Quick Start

Create or open a Next.js project and apply the App Router structure, then start the dev server to begin development.

Frequently Asked Questions about next

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

FAQPage Schema
How do I structure a Next.js project using the App Router?

Structure a Next.js App Router project by enforcing directories like app/, app/api/, components/, lib/, and public/, with next.config.js as the central configuration file. This layout streamlines development and maintenance by ensuring clear boundaries between server and client code.

When should I use 'use client' in Next.js server components?

Use 'use client' in Next.js only for interactive parts that require client-side state or DOM access. Server components are the default, ensuring optimal performance and secure environment separation before configuration changes are validated for deployment.

How do I manage environment variables in Next.js safely?

Manage Next.js environment variables safely by exposing only NEXT_PUBLIC_ prefixed variables to the client. This separation ensures sensitive server-side data remains protected while maintaining a clean project layout and safe configuration.

What is the best way to audit an existing Next.js project for consistency?

The best way to audit a Next.js project for consistency is to validate its App Router structure, check that server components are used by default, and ensure environment variable hygiene with NEXT_PUBLIC_ prefixes for client-safe exposure.

Can I use this App Router structure for scaffolding new Next.js projects?

Yes, you can use this App Router structure for scaffolding new Next.js projects. It enforces a clean project layout, proper environment separation, and safe configuration changes validated before deployment to ensure long-term maintainability.