/bullpen:react-rscfrom bullpen
Guides React Server Component decisions: server vs. client boundary, hydration debugging, data fetching on server, Server Actions, and migrating to App Router.
Ships in bullpen. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This skill captures the production patterns that work in real codebases. It's prescriptive on purpose. Deviate only with a stated reason.
Server is the default. "use client" is the exception.
If you can't articulate why a component must run on the client (it uses state, effects, browser APIs, or event handlers), it's a Server Component. This single discipline is responsible for 80% of the perf gap between RSC-savvy and RSC-naive codebases.
Does it use useState, useEffect, useReducer, useContext (read), useRef, refs to DOM, event handlers, browser APIs (window, localStorage, etc.)?
├─ NO → Server Component (no directive)
└─ YES → Client Component ("use client" at the TOP)
└─ Push the boundary as far down the tree as possible.
Server children of Client components are still server-rendered.
"use client" to the leafWrong:
"use client"; // ❌ entire page is now client-only
export default function Page() {
return (
<div>
<Header /> {/* could be server */}
<ProductList /> {/* could be server */}
<CartButton /> {/* needs client */}
</div>
);
}
Right:
// page.tsx — Server (no directive)
export default function Page() {
return (
<div>
<Header />
<ProductList />
<CartButton /> {/* this one is "use client" inside its file */}
</div>
);
}
Wrong:
"use client";
function ProductList() {
const [data, setData] = useState();
useEffect(() => { fetch('/api/products').then(r => r.json()).then(setData); }, []);
// double-fetch, layout shift, no SSR data
}
Right:
// products/page.tsx — Server
export default async function Page() {
const products = await getProducts();
return <ProductList products={products} />;
}
Wrong: dedicated /api/contact POST + client fetch + custom optimistic logic.
Right:
// actions.ts
"use server";
export async function sendMessage(prev: State, formData: FormData) {
const parsed = Schema.parse(Object.fromEntries(formData));
await db.insert(parsed);
revalidatePath('/inbox');
return { ok: true };
}
// form.tsx — Client (only because of useFormState)
"use client";
import { useFormState } from 'react-dom';
import { sendMessage } from './actions';
export function Form() {
const [state, action] = useFormState(sendMessage, { ok: null });
return <form action={action}>...</form>;
}
// page.tsx — Server
export default function Page() {
return (
<>
<Header /> {/* ships immediately */}
<Suspense fallback={<Skeleton />}>
<SlowProducts /> {/* streams when ready */}
</Suspense>
</>
);
}
async function SlowProducts() {
const products = await getProductsSlow(); // 800ms
return <ProductList products={products} />;
}
| Anti-pattern | Why it's wrong | Fix |
|---|---|---|
"use client" at the top of page.tsx | Disables RSC for the whole route | Move client logic into a small leaf component |
useEffect for initial data | Hydration delay, layout shift, no SSR | Server Component with await |
Forms via onSubmit + fetch('/api/...') | Reinvents Server Actions, no progressive enhancement | Server Action + useFormState |
| Importing a Server-only library into a Client component | Build error or runtime failure | Wrap usage in a Server Component, pass results as props |
dynamic(() => import(...), { ssr: false }) everywhere | Defeats SSR + RSC entirely | Use Suspense + Server Component instead, only ssr: false for genuinely client-only libs (e.g., charts that read window) |
Sharing modules between Server and Client without import 'server-only' | Server secrets can leak into client bundle | Use import 'server-only' at the top of any module that must never reach the client |
When you see "Hydration failed because the initial UI does not match what was rendered on the server":
Date.now(), Math.random(), or new Date() in render. Move to useEffect, or compute on server and pass as prop.typeof window !== 'undefined' checks in render. That's a code smell — split into Client component or use useSyncExternalStore.suppressHydrationWarning only after eliminating 1 and 2.<p> containing a <div>). The browser auto-corrects on parse; React doesn't. Run the page through W3C validator."use client" higher than necessaryuseEffect for initial data fetching<Suspense>Math.random() / Date.now() in rendertypeof window checks in renderimport 'server-only' on any server-secret moduleunstable_cache, revalidateTag).What SKILL.md sets; muted values are Claude Code's defaults
4 skills in this plugin
/bullpen-learnUse this skill after a bullpen agent completes a task to extract 0-3 durable learnings (decisions, patterns, preferences, failures, or code snippets) and write them to the project's local memory store (`<project>/.bullpen/memory.json`) under that agent's namespace. The matching Intern agent runs this. Keep each learning self-contained and project-scoped./bullpen-memoryUse this skill before any bullpen agent runs to retrieve relevant past learnings from the project's local memory store. Trigger when an agent activates and needs context from prior sessions — preferences, decisions, patterns, failures, or code snippets stored in their namespace. Memory lives in `<project>/.bullpen/memory.json` — per-project, plain JSON, no daemons./idempotent-apisClaude Code installs this plugin but refuses to load it
hooks/hooks.json: hooks.json declares PreToolUse/PermissionRequest at its top level, outside the "hooks" object — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
hooks/hooks.json: hooks.json declares PreToolUse/PermissionRequest at its top level, outside the "hooks" object — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
Checked against Claude Code 2.1.332. The listing below is what the repository ships; Claude Code doesn't load it as published.
Other plugins' skills for the same job