install
source · Clone the upstream repo
git clone https://github.com/Intense-Visions/harness-engineering
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/Intense-Visions/harness-engineering "$T" && mkdir -p ~/.claude/skills && cp -r "$T/agents/skills/codex/react-server-rendering" ~/.claude/skills/intense-visions-harness-engineering-react-server-rendering-ea3867 && rm -rf "$T"
manifest:
agents/skills/codex/react-server-rendering/SKILL.mdsource content
React Server Rendering
Pre-render React components on the server for improved SEO and initial load performance
When to Use
- Public-facing pages where SEO and crawler indexability matter
- Applications where First Contentful Paint performance is critical
- You need personalized content rendered per-request (not suitable for static generation)
- Using Next.js Pages Router (
), Remix (getServerSideProps
), or custom Express +loaderrenderToString
Instructions
- In Next.js Pages Router, export
to fetch data server-side:getServerSidePropsexport async function getServerSideProps(context: GetServerSidePropsContext) { const data = await fetchData(context.params.id); return { props: { data } }; } - In Remix, export a
function:loaderexport async function loader({ params }: LoaderFunctionArgs) { return json(await fetchData(params.id)); } - The server renders the full HTML; the browser displays it immediately (no blank page flash).
- React hydrates the server-rendered HTML on the client, attaching event handlers.
- Use
headers appropriately — per-request SSR bypasses CDN caching.cache
Details
SSR sends fully-rendered HTML from the server. The browser displays content immediately while React hydrates in the background, making the UI interactive.
SSR vs SSG:
- SSG (Static Generation): HTML generated at build time. Fast, cacheable, but requires rebuild for updates.
- SSR: HTML generated per-request. Always fresh, but has server cost and latency.
- ISR (Next.js): Static with time-based revalidation — best of both for many cases.
Hydration mismatch: If server-rendered HTML differs from what client React would render, React throws a hydration error. Common causes:
Date.now(), Math.random(), browser-only APIs in render paths. Suppress with suppressHydrationWarning for known-safe mismatches.
React 18 streaming:
renderToPipeableStream streams HTML to the browser progressively, enabling Suspense boundaries to stream in chunks. Improves TTFB for slow data.
Source
https://patterns.dev/react/server-side-rendering
Process
- Read the instructions and examples in this document.
- Apply the patterns to your implementation, adapting to your specific context.
- Verify your implementation against the details and edge cases listed above.
Harness Integration
- Type: knowledge — this skill is a reference document, not a procedural workflow.
- No tools or state — consumed as context by other skills and agents.
Success Criteria
- The patterns described in this document are applied correctly in the implementation.
- Edge cases and anti-patterns listed in this document are avoided.