- Home
- Skills
- Frontend & Web Apps
- React Next Rules
React Next Rules
Enforce Server/Client boundaries, fix hydration errors, and secure Server Actions in Next.js App Router projects.
$5
Works with the AI Agents you already use
React Next Rules
Example session with this skill installed
My /admin page is slow and shows a hydration error on the 'last login' timestamp. It uses a client component that imports my Prisma client directly.
- Read your context and instructions
- Compiled the react next rules
Scope
app/admin/page.tsx (Client -> Server)
Findings
- app/admin/page.tsx - Leaks database SDK to browser bundle.
- app/admin/page.tsx - Dynamic timestamp causes hydration mismatch.
Patch
[Full Server Component code with Suspense and stabilized props...]
Connects securely to your tools. The creator never sees your data.
About this skill
The problem
Cursor often fails to distinguish between the server and browser in the Next.js App Router. It creates client components that accidentally bundle database modules, leaks secrets via prop spreading, and generates hydration mismatches by calculating dates or random IDs during render.
What it does
- Identifies server-only modules leaking into client bundles and patches them with
server-onlyguards. - Fixes hydration failures by isolating browser-only state and stabilizing server-rendered timestamps and locales.
- Audits Server Actions to ensure mandatory schema validation and tenant-based authorization.
- Optimizes caching and streaming by wrapping slow queries in Suspense boundaries and converting serial awaits to parallel execution.
- Reduces client bundle weight by auditing imports and suggesting dynamic loading for heavy widgets.
Frameworks & tools
React 19, Next.js 13+ (App Router), Cursor, Tailwind CSS, and Zod for action validation.
Why this beats prompting it yourself
Generic prompts don't understand the nuance of the RSC boundary or the specific ways use client impacts child components. This skill enforces a strict trigger matrix that catches architectural leaks, like credential exposure, that simple coding assistants frequently ignore.
Use cases
- Migrating a "use client" heavy page back to Server Components to fix bundle bloat.
- Debugging "Text content did not match" errors caused by time-based or locale-based rendering.
- Securing Server Actions against unauthorized data access and malformed inputs.
- Implementing a strict Content-Security-Policy with proper nonce wiring in middleware.
Known limitations
This skill cannot run your build, start a dev server, or execute tests. It provides code reviews and patches based on static analysis of open files only.
Does not execute code, run builds, or verify bundle sizes. Requires manual confirmation of environment variable visibility and database ownership logic.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 3 months ago