Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
oakoss avatar

Hydration Guardian

  • 94 installs
  • 14 repo stars
  • Updated March 2, 2026
  • oakoss/agent-skills

Helps with ai & agent building tasks during AI-assisted development.

About

hydration-guardian is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.

  • hydration-guardian
  • AI & Agent Building
  • AI-coding skill

Hydration Guardian by the numbers

  • 94 all-time installs (skills.sh)
  • +4 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #4,644 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/oakoss/agent-skills --skill hydration-guardian

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs94
repo stars14
Last updatedMarch 2, 2026
Repositoryoakoss/agent-skills

What it does

Helps with ai & agent building tasks during AI-assisted development.

Files

SKILL.mdMarkdownGitHub ↗

Hydration Guardian

Overview

Ensures zero-mismatch integrity between server-rendered HTML and client-side React trees. Covers hydration error diagnosis, selective hydration via Suspense boundaries, deterministic data bridges with the React 19 use() hook, 'use cache' for eliminating data drift, two-pass rendering for client-only content, React 19's single-diff hydration error reporting for pinpointing exact mismatches, and automated validation of rendered DOM state.

When to use: Debugging hydration mismatch errors, fixing text content mismatches, handling browser extension DOM pollution, implementing deterministic data bridges, optimizing SSR/client hydration performance, setting up error monitoring with onRecoverableError.

When NOT to use: Client-only React applications without SSR, static sites without hydration, API-only backends.

Quick Reference

PatternApproachKey Points
Selective hydration<Suspense fallback={...}> boundaryHydrates independently; prioritizes user interaction
Deterministic bridgeuse(serverPromise) instead of useEffectDirect server-to-client data transition (React 19)
Cache directive'use cache' in data fetchersShare exact server result with client during hydration
Two-pass renderinguseState + useEffect for client-onlyFirst render matches server; second adds client content
Client-only skipnext/dynamic with ssr: falseExclude component from server render entirely
Error monitoringonRecoverableError on hydrateRootDetect and report silent hydration recovery
Error reportingReact 19 single-diff error formatPinpoints exact mismatch location with unified diff output
Error callbacksonUncaughtError, onCaughtErrorGranular error handling on createRoot/hydrateRoot
Date/time safetyUTC normalization or server-synced contextPrevent locale-dependent hydration mismatches
Extension resilienceTest with common browser extensions activeDetect DOM pollution from translators, dark-mode tools

Hydration Error Diagnosis

Error MessageLikely CauseCorrective Action
Text content did not matchNon-deterministic render (dates, random values)Use two-pass rendering or suppressHydrationWarning
Expected server HTML to containClient renders content server did notMove client-only code to useEffect or dynamic import
Hydration failedInvalid HTML nesting (<p> inside <p>)Fix HTML structure; browsers auto-correct causing drift
Extra attributes from serverServer-only attributes not on clientEnsure attribute parity or use suppressHydrationWarning
There was an error while hydratingExtension-modified DOM or major mismatchCheck for browser extensions; verify HTML validity

Common Mistakes

MistakeCorrect Pattern
Using suppressHydrationWarning on container elementsFix the root cause; suppress only on leaf elements with unavoidable differences
Accessing window or document in the render bodyWrap client-only code in useEffect or use next/dynamic with ssr: false
Using Math.random() or new Date() without stable seedsUse UTC normalization, server-cached values, or two-pass rendering
Ignoring silent hydration recovery in productionConfigure onRecoverableError on hydrateRoot to log and monitor
Using dangerouslySetInnerHTML with server/client mismatchEnsure identical content or use a dedicated key change to force remount
Checking typeof window !== 'undefined' in renderUse two-pass rendering; the check runs on server too (it returns false)
Nesting <p> inside <p> or <div> inside <p>Fix invalid HTML nesting; browsers correct it causing server/client drift

Delegation

  • Scan rendered pages for hidden hydration warnings: Use Explore agent with Chrome DevTools to run the hydration audit script
  • Fix hydration mismatches across multiple routes: Use Task agent to isolate, correct, and verify each affected component
  • Design hydration-safe architecture for new features: Use Plan agent to select between Suspense boundaries, two-pass rendering, and cache patterns

References

  • Common Mismatches -- causes, diagnosis, and fixes for hydration mismatch errors including dates, locales, HTML nesting, and browser extensions
  • Selective Hydration -- Suspense-based selective hydration, streaming SSR, two-pass rendering, and client-only components
  • Use Cache Patterns -- data drift prevention, Next.js use cache directive, React 19 use() hook, deterministic data bridges
  • Validation Techniques -- automated DOM verification, mutation monitoring, onRecoverableError, and production hydration monitoring

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.