shadcn-agents-rsc-boundary-validator

Audit Next.js App Router codebases for React Server Components boundary violations in shadcn ui imports.

Updated May 19, 2026
One-click install
npx skills add https://github.com/Impertio-Studio/shadcn-ui-Claude-Skill-Package --skill shadcn-agents-rsc-boundary-validator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shadcn-agents-rsc-boundary-validator
Source: https://github.com/Impertio-Studio/shadcn-ui-Claude-Skill-Package/tree/main/skills/source/shadcn-agents/shadcn-agents-rsc-boundary-validator
Command: npx skills add https://github.com/Impertio-Studio/shadcn-ui-Claude-Skill-Package --skill shadcn-agents-rsc-boundary-validator

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents broken Next.js App Router builds and runtime crashes caused by incorrect React Server Components boundaries when using shadcn ui primitives.

Core Features & Use Cases

  • RSC boundary audit for shadcn ui: checks that the components.json rsc flag matches the project framework and that each shadcn primitive is in the correct server/client module shape.
  • Directive correctness verification: validates that "use client" is present where required, absent where forbidden, and well-formed (not conditional, backticked, or placed incorrectly).
  • Production-grade failure detection: identifies over-clientification, Provider-import mistakes (e.g., ThemeProvider imported directly into app/layout.tsx), and boundary-violating props like inline functions or non-serialisable instances crossing server → client.

Use case: You receive a PR that adds or modifies shadcn primitives and you must confirm the App Router boundary is correct before merging, especially when builds fail with useState is not a function or reading 'useContext' hydration crashes.

Quick Start

Use the skill to validate your repository at the point of review and generate a PASS/WARN/FAIL checklist for each of the six RSC rules.

Frequently Asked Questions about shadcn-agents-rsc-boundary-validator

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

FAQPage Schema
Why does my Next.js App Router build crash with hydration errors when using shadcn ui?

Hydration crashes like 'useState is not a function' occur when shadcn ui components violate React Server Components boundaries by missing or misplacing 'use client' directives. Auditing your codebase validates directive placement and verifies provider wrapper boundaries to resolve these runtime errors.

How do I audit a Next.js codebase for incorrect 'use client' directives in shadcn ui components?

Auditing a Next.js codebase for 'use client' directives requires scanning components.json, classifying shadcn imports per a client/RSC-safe matrix, and verifying directive formatting. This process identifies over-clientification and ensures correct server-to-client boundary separation before merging.

What is a React Server Components boundary violation in Next.js App Router?

A React Server Components boundary violation happens when server-to-client prop crossing introduces non-serialisable instances or inline functions. It also occurs when 'use client' is absent where required or placed incorrectly, causing runtime failures during App Router hydration.

Can I pass non-serialisable props from a server component to a shadcn ui client component?

Passing non-serialisable props or inline functions across the server-to-client boundary violates RSC rules and causes runtime crashes. Boundary validation flags these server-to-client prop crossings to ensure only serialisable data passes into shadcn ui client components.

Does the shadcn ui components.json rsc flag need to match my Next.js framework configuration?

The components.json rsc flag must match your Next.js project framework configuration to maintain correct RSC boundaries. Boundary validation checks this alignment and verifies each shadcn primitive is in the correct server/client module shape to prevent build failures.

How to fix ThemeProvider imported directly into app/layout.tsx causing an RSC boundary error?

Fixing direct ThemeProvider imports into app/layout.tsx requires checking provider wrapper boundaries to ensure proper 'use client' isolation. RSC boundary validation identifies these Provider-import mistakes and generates a PASS/WARN/FAIL checklist to guide corrections before merging.