nextjs-app-structure-guard
OfficialKeep Next.js App Router code aligned with its rendering model.
Authorlgerard314
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Align Next.js App Router code with the framework's rendering model to prevent accidental client components in server code, reduce client bundle size, and avoid leaking server secrets.
Core Features & Use Cases
- Enforces that Server Components are default and 'use client' is placed only on the smallest leaves that require it.
- Prevents importing server-only modules (fs, database clients, secret managers) into client components.
- Keeps route handlers thin by delegating business logic to services and returning typed responses.
- Narrows middleware to lightweight tasks (auth checks, redirects, headers) without DB access or business logic.
- Validates server actions input with schema validation and re-verifies authorization at the top.
- Ensures explicit caching policies for data fetches and cache handlers to avoid stale data.
- Promotes pure
generateMetadata/generateStaticParamsfunctions to avoid side effects and secrets.
Quick Start
Review an App Router file and apply the guard rules to ensure server/client boundaries are respected and the code remains testable.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: nextjs-app-structure-guard Download link: https://github.com/lgerard314/global-plugin/archive/main.zip#nextjs-app-structure-guard Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.