From harness-claude
Implements React Server Components to run on server, eliminate client JavaScript, and enable direct database access. Use for Next.js App Router data fetching without APIs.
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeThis skill uses the workspace's default tool permissions.
> Run components on the server to eliminate client JavaScript and enable direct data access
Guides React Server Components in Next.js: server vs client distinction, 'use client' directive, component boundaries, composition patterns, and data fetching.
Guides Next.js Server Components for server-side data fetching, backend access, and client boundaries to reduce JS bundles and secure credentials.
Builds Next.js 16+ apps with React Server Components using App Router, Cache Components, streaming SSR, Server Actions, and React 19 server-first patterns.
Share bugs, ideas, or general feedback.
Run components on the server to eliminate client JavaScript and enable direct data access
'use client' unless needed.async/await directly: const data = await db.query(...)'use client' directive at the top of a file when the component needs:
useState, useEffect, or any hookswindow, document)onClick, onChange)children props).// Server Component (no 'use client')
async function ProductPage({ id }: { id: string }) {
const product = await db.products.findById(id); // direct DB access
return (
<div>
<h1>{product.name}</h1>
<AddToCartButton productId={id} /> {/* Client Component */}
</div>
);
}
// Client Component
'use client';
function AddToCartButton({ productId }: { productId: string }) {
return <button onClick={() => addToCart(productId)}>Add to Cart</button>;
}
RSC introduces a server/client component split at the file level. The framework serializes server-rendered output as a JSON-like payload (RSC payload) and sends it to the client for React to reconcile.
What RSC eliminates:
Common mistakes:
'use client' to every file "to be safe" — this negates RSC benefitsuseEffect for data fetching in client components when a server component would workFramework support (2024): Next.js App Router is the primary production implementation. Remix, Waku, and other frameworks have RSC support in various stages.
https://patterns.dev/react/react-server-components