/harness-claude:next-server-componentsfrom harness-claude
Guides implementing Next.js Server Components: async data fetching, 'use client' boundary placement, server-only imports, and serializable props for bundle-size reduction.
Claude never picks this skill on its own
Its frontmatter has no description. Without a description, Claude Code leaves it out of the list Claude chooses from. Typing /harness-claude:next-server-components still runs it.
What the skill costs in Claude's context, stage by stage
No description Claude Code can read, so Claude's list leaves it out: only you can start it.
SKILL.md joins the conversation and stays.
Keep data fetching and heavy logic on the server; push interactivity to the client only where needed
'use client' boundary in a component treeapp/ is a Server Component by default — no directive needed. Add 'use client' only when the component uses hooks, browser APIs, or event handlers.async — await data directly inside the component body instead of using useEffect.fs, secret env vars) into Client Components. Use the server-only package to enforce this at build time.'use client' as close to the leaf as possible — this minimizes the client bundle.children prop (composition), but cannot import a Server Component module directly.React.cache() to deduplicate fetch calls across a request when multiple Server Components fetch the same data.import 'server-only' to prevent accidental client-side imports.// app/dashboard/page.tsx — Server Component (async, no directive)
import { db } from '@/lib/db'; // server-only module — safe here
import { MetricCard } from './metric-card'; // Client Component receives data as props
export default async function DashboardPage() {
const metrics = await db.query.metrics.findMany();
return (
<div>
{metrics.map(m => <MetricCard key={m.id} metric={m} />)}
</div>
);
}
// app/dashboard/metric-card.tsx — Client Component
'use client';
import { useState } from 'react';
export function MetricCard({ metric }: { metric: Metric }) {
const [expanded, setExpanded] = useState(false);
return <div onClick={() => setExpanded(e => !e)}>{metric.label}</div>;
}
React Server Components (RSC) render on the server and send HTML + a serialized component tree to the client. They never ship their module code to the browser, so they can safely import server-only dependencies.
The boundary model: 'use client' marks a module as the root of a client subtree. All modules imported by that module are also bundled for the client — the directive propagates downward through the import graph. This is why pushing the boundary toward leaves reduces bundle size.
Serialization constraints: Props crossing the server→client boundary must be serializable (strings, numbers, plain objects, arrays). Functions, class instances, and Promises cannot be passed directly as props to Client Components (Promises can be passed to Suspense-aware Client Components via use()).
Common mistakes:
'use client' to a file that imports a database client — the database client ends up in the bundleuseEffect when a Server Component parent could fetch it directlyPerformance note: Server Components reduce Time to First Byte (TTFB) for data-heavy pages because HTML arrives pre-rendered. Interactivity is hydrated progressively.
https://nextjs.org/docs/app/building-your-application/rendering/server-components
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeRead when SKILL.md points to them.
793 skills in this plugin
/a11y-aria-patternsARIA Patterns> Apply ARIA roles, states, and properties correctly to enhance assistive technology support for custom widgets/a11y-color-contrastColor Contrast and Color Independence> Ensure sufficient color contrast ratios and never use color as the sole means of conveying information/a11y-form-patternsAccessible Form Patterns> Build accessible forms with proper labeling, grouped controls, inline validation, and clear error communicationOther plugins' skills for the same job