What problem does it solve?
Next.js App Router projects often drift into inconsistent folder structure, bloated route files, misplaced data-access code, and risky refactors where it’s unclear what belongs where.
Core Features & Use Cases
- Enforces App Router structure: Keeps route segments thin using the Next.js conventions for app/layout.tsx, app/page.tsx, app/loading.tsx, app/error.tsx, and route.ts.
- Separates concerns safely: Directs routing to app/, shared UI to components/, and server/data access to lib/ with a clear division for Server Actions in actions/.
- Adds guardrails against common failure modes: Prevents client/server boundary mistakes (use client), discourages direct DB/API calls in pages or route handlers, and standardizes error handling and security practices.
Use case: You inherit a Next.js codebase where pages contain data fetching, components mix business logic, and Server Actions aren’t organized—this skill guides a safe, phased reorganization into app/, components/, lib/, and actions/ so the refactor is maintainable and less error-prone.
Quick Start
Ask your coding agent to reorganize the project into the enforced app/components/lib/actions layout and rewrite any mislocated DB calls, Server Actions, and client/server boundaries to match the skill rules.