void-route-group-decision

Decides when to create Next.js App Router route groups and how to name and structure them.

Updated May 29, 2026
One-click install
npx skills add https://github.com/voidcorp-core/void-harness --skill void-route-group-decision-voidcorp-core
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: void-route-group-decision
Source: https://github.com/voidcorp-core/void-harness/tree/main/packages/cli/core-assets/packs/pack-nextjs/skills/void-route-group-decision
Command: npx skills add https://github.com/voidcorp-core/void-harness --skill void-route-group-decision-voidcorp-core

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Next.js App Router route groups (folders named (name)) affect layout and convention scope but not URLs, so teams often create them prematurely, name them inconsistently, or mix public and authenticated routes in ways that break layout-level auth enforcement. This Skill provides a decision framework for when a route group is justified, what to name it, and how to structure layouts across groups. ## Core Features & Use Cases - Three-condition gate: A new group requires a distinct shared layout, a distinct trust posture or rendering model, and at least two routes. - Trust-boundary convention: Groups routes by trust boundary and rendering model — (api|actions) for Server Actions and route handlers, (marketing) for public static pages, (app) for authenticated routes behind a layout auth gate. - Layout guidance: Rules for the root app/layout.tsx (html/body tags, global providers only) and options for sharing headers across sibling groups. - Use Case: When adding a new admin section to a Next.js app, use this Skill to decide whether it warrants an (admin) group with its own auth-checking layout or belongs inside the existing (app) group. ## Quick Start Ask the agent to decide where new routes in the app directory should live and whether a new route group is justified.

Frequently Asked Questions about void-route-group-decision

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

FAQPage Schema
When should I create a route group in Next.js App Router?

Create a route group only when all three conditions hold: the routes share a distinct layout, they have a distinct trust posture or rendering model (cached vs dynamic, auth vs public), and at least two routes fit the group. A single route does not justify a new group.

How do I organize public and authenticated routes in the Next.js app directory?

Group by trust boundary: put public statically rendered pages in a `(marketing)` group and authenticated routes in an `(app)` group whose layout checks the session and redirects to login. Never mix public and authed routes in one group because the layout cannot enforce a uniform auth posture.

Do route groups affect the URL in Next.js?

No, folders named with parentheses like `(marketing)` are invisible in the URL. They only affect layout scope and conventions, so `app/(marketing)/pricing/page.tsx` still serves `/pricing`.

What is the difference between route groups and parallel routes in Next.js?

Route groups are folders named `(name)` that scope layouts without affecting URLs. Parallel and intercepting routes use `@modal`, `(.)`, `(..)`, and `(...)` syntax for rendering multiple pages in one layout, which is a separate concept.

How do I share a layout across multiple route groups?

Groups are siblings and each owns its layout, so you cannot share directly. Either put the shared element in the root `app/layout.tsx` if every group needs it, or extract it as a component and import it into each group's layout.