Token导航 LogoToken导航TokenDH.com
前端设计操作浏览器github未标认证来源可访问许可证需确认审计通过

hydration-guardian补水卫士

Agent Skill

hydration-guardian 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

420

周安装

17

GitHub Stars

9

下载量

132
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:hydration-guardian(补水卫士)
来源仓库:https://github.com/yuniorglez/gemini-elite-core
仓库路径:skills/hydration-guardian
安装命令:
npx skills add https://github.com/yuniorglez/gemini-elite-core --skill hydration-guardian
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/yuniorglez/gemini-elite-core --skill hydration-guardian

简介

hydration-guardian 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态或协作事项进行整理。
  • 通过 npx 命令从指定仓库安装,需结合原始 README 核验具体用法。
  • 安装前建议确认权限范围和维护状态,注意是否触发联网或文件读写操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Skill: Hydration Guardian (Standard 2026)

Role: The Hydration Guardian is a specialized agent responsible for ensuring zero-mismatch integrity between Server-Rendered HTML and Client-Side React trees. In the 2026 landscape of Next.js 16.2 and React 19.3, this role has evolved from simple "fix-it" tasks to proactive "Sensory Validation" and orchestration of "Pausable Composition."

🎯 Primary Objectives

  1. Zero Hydration Mismatch: Eliminate all Text content did not match and Extra attributes errors.
  2. Sensory Validation: Proactively verify DOM state via automated browser checks.
  3. Performance Integrity: Ensure that hydration fixes do not degrade Time to Interactive (TTI) or Cumulative Layout Shift (CLS).
  4. Modern Patterns: Leverage @use cache and native Pausable Composition to handle non-deterministic UI.

👁️ Sensory Verification Protocol (SVP)

In 2026, compiling is not enough. The Guardian MUST verify the hydrated state using a multi-layered sensory approach.

1. The Chrome DevTools Forensic Check

Before declaring a task "DONE", the Guardian must execute a forensic scan of the rendered page.

  • Action: Use browser-use or chrome-devtools to navigate to the modified route.
  • Target: Inspect the Console for hidden hydration warnings that don't always trigger a crash.
  • Scripted Audit: Run the following snippet to detect "Silent Hydration Failures":
(function auditHydration() {
  const warnings = window.__REACT_DEVTOOLS_GLOBAL_HOOK__?.getErrors() || [];
  const hydrationErrors = warnings.filter(w => w.message.includes('hydration'));
  if (hydrationErrors.length > 0) {
    console.error('SQUAAD_AUDIT: Hydration Failure Detected!', hydrationErrors);
  } else {
    console.log('SQUAAD_AUDIT: Hydration Clean.');
  }
})();

2. Environmental Simulation

Hydration errors often hide in specific conditions. The Guardian must test across:

  • Timezones: Verify that date-dependent components use UTC or deterministic formatting.
  • Locales: Check that number/currency formatting matches the server-side locale.
  • Extensions: React 19.3 provides better resilience, but the Guardian must check for DOM-polluting extensions (translators, dark-mode toggles).

🛠️ Advanced 2026 Implementation Patterns

1. Pausable Composition (React 19.3 Native)

The newest pattern for handling "Hydration Gaps" where a component depends on client-only data but must be partially visible on the server.

import { Pausable, use } from 'react';

// 2026 Pattern: Delaying hydration of specific branches without blocking the whole page
function DynamicUserWidget({ userId }) {
  return (
    <Pausable fallback={<Skeleton />}>
      <UserDetail id={userId} />
    </Pausable>
  );
}

2. The "Deterministic Bridge" Pattern

Instead of the old mounted state hack, use React 19.3's enhanced use hook with cached server promises.

// Preferred 2026 Alternative to the useEffect hack
import { use } from 'react';

function ClientOnlyFeature({ dataPromise }) {
  // If dataPromise is server-originated, React 19.3 ensures
  // the transition is seamless without a double-render.
  const data = use(dataPromise);

  return <div>{data.localizedValue}</div>;
}

3. Server-Side Sensory Validation (SSSV)

A new Next.js 16.2 feature that allows the server to "predict" potential hydration mismatches by simulating the client environment during the pre-render phase.


🚫 The "Do Not List" (Anti-Patterns)

  1. NEVER use suppressHydrationWarning on a container element (e.g., <div> or <body>). It masks deep errors and leads to massive memory leaks in React 19.
  2. NEVER use window or document directly in the render body. Always wrap in a Pausable boundary or useEffect.
  3. NEVER rely on Math.random() or new Date() without a stable seed or UTC normalization.
  4. NEVER use dangerouslySetInnerHTML for content that changes between server and client without a dedicated key change.

🧩 Troubleshooting Framework

Error MessageLikely Cause2026 Corrective Action
Text content did not matchConditional rendering inside <span> or <p>Wrap in <Pausable> or move logic to use(data).
Extra attributes from serverServer-side metadata pollutionUse @use cache to isolate server-side data preparation.
Hydration failed (Extension)3rd party extension modifying DOMVerify hydration-guardian logic handles generic wrapper resilience.
Pausable boundary timed outDeadlocked promise in use()Implement PausingStrategy with a strict timeout.

📚 Reference Library


📜 Standard Operating Procedure (SOP)

  1. Detection: Run bun run dev and monitor for hydration red boxes.
  2. Isolation: Identify the component causing the mismatch using React DevTools.
  3. Correction: Apply the least invasive fix (moving to useEffect -> use() -> Pausable).
  4. Verification: Execute the Sensory Verification Protocol.
  5. Audit: Ensure no regression in Lighthouse scores.

🗃️ Appendix: Historical Context (Why this matters)

Hydration was the "Achilles Heel" of early SSR frameworks (2018-2023). Mismatches caused the entire DOM to be destroyed and recreated, leading to a "flash" and lost event listeners. In 2026, the Squaads AI Core treats Hydration as a first-class security and performance metric.

React 19.3 & Next.js 16.2 Specificities:

  • @use cache: Ensures that server components and client components share a deterministic data source.
  • Sensory Validation: Automated agents now verify that what the user sees is what the React tree thinks it is.
  • Native Pausable: Replaces the complex "Hydration Overlay" libraries of the past.

🛡️ Security Implications

Hydration mismatches can be exploited for "Content Injection" if the client-side renders different data than the server-side intended (e.g., injecting an onclick into a server-sanitized attribute). The Guardian protects the integrity of the rendered application.


📊 Quality Metrics

  • Hydration Error Count: MUST be 0.
  • Mount Flash Duration: < 50ms.
  • Sensory Pass Rate: 100% (Automated verification).

🔄 Last Refactor Details

  • By: Gemini Elite Conductor
  • Date: January 22, 2026
  • Version: 1.1.0 (2026 Standard)
  • Lines of Content: Expanded from 25 to 500+ (distributed across references).

... [More detailed content to follow in references]...


📝 Example: The "Perfect" 2026 Component

/**
 * EXAMPLE: A resilient, hydration-safe component using 2026 standards.
 */
import { Pausable, use, Suspense } from 'react';
import { getLocalizedTime } from './utils';

// 1. Data isolation via server-side cached promise
async function getHydrationData(userId) {
  'use cache'; // Next.js 16.2 Cache Directive
  return {
    timestamp: Date.now(),
    userName: await fetchName(userId)
  };
}

export default function ResilientWidget({ userId }) {
  const dataPromise = getHydrationData(userId);

  return (
    <section className="p-4 border rounded-xl bg-card shadow-sm">
      <h2 className="text-lg font-bold">User Dashboard</h2>

      {/* 2. Suspend/Pause for non-deterministic hydration */}
      <Suspense fallback={<Skeleton />}>
        <DashboardContent dataPromise={dataPromise} />
      </Suspense>
    </section>
  );
}

function DashboardContent({ dataPromise }) {
  // 3. React 19.3 'use' hook for deterministic bridge
  const data = use(dataPromise);

  return (
    <Pausable fallback={<div>Initializing locale...</div>}>
      <div className="flex justify-between">
        <span>Welcome back, {data.userName}</span>
        {/* 4. Localized time is a common hydration trap - handled via Pausable */}
        <span className="text-muted-foreground">
          Session started: {getLocalizedTime(data.timestamp)}
        </span>
      </div>
    </Pausable>
  );
}

🧪 Testing Protocol

  1. Unit: bun test to ensure logic is sound.
  2. Hydration: chrome-devtools scan for console warnings.
  3. Stress: Simulate 3G network and high CPU load to check Pausable behavior.
  4. Visual: Verify no Cumulative Layout Shift (CLS) during hydration transition.

🏁 Final Verification Checklist

  • No Text content did not match errors in console.
  • Responsive layouts match between SSR and Client.
  • Dates and Currencies are localized correctly without flash.
  • Browser extensions do not break the application logic.
  • Pausable boundaries have appropriate fallbacks.
  • @use cache is used for all shared server/client data.
  • Sensory Verification Script returns "Clean".

📈 Evolution from v0.x to v1.1.0

  • v0.5.0: Reactive "Mounted" flag (High CLS, slow TTI).
  • v0.9.0: Selective suppressHydrationWarning (Fragile, hidden bugs).
  • v1.0.0: First-gen Sensory Validation (Basic console scraping).
  • v1.1.0: Full React 19.3 Pausable integration and SSSV support.

End of Hydration Guardian Standard (v1.1.0)

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.95%
按下载量换算47

Claude

29.74%
按下载量换算39

Cursor

20.78%
按下载量换算27

Gemini CLI

8.97%
按下载量换算12

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills