bedkillerspacex-boop/codex-skill-library/angular-ssr-hydration

Claude Code and agent skill by bedkillerspacex-boop/codex-skill-library

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Angular SSR and client hydration for owned apps: server rendering setup, hydration mismatches, TransferState, non-DOM browser APIs, and auth/cookie considerations on server. Use when enabling Universal/SSR, fixing flicker/mismatch errors, or securing SSR data paths — not for generic SPA-only security (see angular-security-basics).

Install

npx vskill@latest install bedkillerspacex-boop/codex-skill-library/angular-ssr-hydration

SKILL.md

The same SKILL.md was published earlier as bedkillerspacex-boop/codex-skill-library/angular-ssr-hydration.

Angular SSR & Hydration

Scope And Authorization

  • In scope: Angular apps you operate where SSR/hydration is used or planned.
  • Out of scope: Scraping third-party SSR pages; leaking server-only secrets to the client bundle.
  • SSR runs code on the server — treat it as backend surface for secrets and SSRF.
  • Pair with angular-security-basics and code-quality-standards.

When To Use

  • Enabling Angular Universal / SSR builders.
  • Fixing hydration mismatch warnings/errors.
  • Using TransferState to avoid double-fetch.
  • Debugging window/document access breaking SSR.

Do Not Use As Primary

NeedSkill instead
Client XSS/CSRF/auth interceptorsangular-security-basics
Signals stateangular-signals-basics
Node SSR host hardening broadlyserver/security skills
Implementation quality baselinecode-quality-standards

Domain Focus

ConceptDetail
SSRRender HTML on server for first paint/SEO
HydrationClient attaches to existing DOM
MismatchServer HTML ≠ client first render → bugs/re-render
TransferStateSerialize server-fetched data for client reuse
Platform checksisPlatformBrowser / isPlatformServer
AuthCookies available on server carefully; no secret keys in client

Workflow

1. Confirm goals and success criteria
  1. Record Angular version, hosting (Node, Firebase, custom), SEO needs.
  2. Success: SSR HTML correct; hydration without mismatch; TTFB acceptable; no secrets in payload.
  3. Identify pages needing SSR vs client-only.
2. Enable SSR toolchain
bash
# Per current Angular CLI schematics for your version
ng add @angular/ssr
ng build
ng run app:serve-ssr # or equivalent
  1. Pin versions; follow official migration for hydration APIs.
  2. Configure production reverse proxy to Node server if used.
3. Eliminate non-portable DOM use
typescript
import { inject, PLATFORM_ID } from '@angular/core';
import { isPlatformBrowser } from '@angular/common';
const platformId = inject(PLATFORM_ID);
if (isPlatformBrowser(platformId)) {
window.localStorage.getItem('x');
}
ProblemFix
window at constructGuard or afterNextRender
Random IDs differStable IDs from data
Time-dependent textSame clock source / skip in SSR
Locale differAlign server/client locale
4. Data fetching and TransferState
typescript
// Sketch: server fetches, stores in TransferState; client reuses
const KEY = makeStateKey<Item[]>('items');
if (transferState.hasKey(KEY)) {
return of(transferState.get(KEY, []));
}
return this.http.get<Item[]>('/api/items').pipe(
tap(data => transferState.set(KEY, data))
);
  1. Do not put secrets or PII-heavy blobs into TransferState unnecessarily.
  2. Ensure API base URL works on server (absolute URL / internal network carefully — SSRF risk).
5. Auth and cookies on SSR
  1. Forward cookies only to trusted own APIs.
  2. Never embed refresh tokens in HTML.
  3. Personalized pages: consider Cache-Control: private to avoid CDN leaking user HTML.
6. Hydration debugging
bash
# Browser console: hydration errors / ngDevMode messages
# Compare view-source (SSR) vs client DOM
curl -sS https://staging.example/ | head
SymptomChecks
Content jumpMismatch text/structure
Double HTTPTransferState missing
Flash unstyledCSS order / critical CSS
Auth wrong userCache personalization bug
7. Verify and hand off
bash
ng test
ng build
# Lighthouse SEO/perf as secondary
  1. Document which routes are SSR.
  2. Monitor server error rates and memory (SSR leaks).
  3. Security review of server-side HTTP client.

Good / Bad

TopicGoodBad
DOM APIsPlatform guardsAssume browser globals on server
CachePrivate for personalized SSRCDN cache user dashboards publicly
State transferPublic data onlyAPI keys in TransferState
HydrationStable renderRandom UIDs each side

Output Checklist

  • [ ] SSR enabled with pinned versions
  • [ ] Browser-only APIs guarded
  • [ ] TransferState used where beneficial
  • [ ] Auth/cookie/caching model safe
  • [ ] Hydration mismatches resolved on critical routes
  • [ ] Server API calls SSRF-safe
  • [ ] Build/test green
  • [ ] code-quality-standards + security skill applied

Rules

  • Owned apps only.
  • SSR is a server: protect secrets and outbound requests.
  • Prefer stable, deterministic renders for hydration.
  • Do not cache personalized HTML on shared CDNs.
  • Keep client security practices from angular-security-basics.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/bedkillerspacex-boop/codex-skill-library/angular-ssr-hydration/badge)](https://verified-skill.com/skills/bedkillerspacex-boop/codex-skill-library/angular-ssr-hydration)

Something wrong with this skill or its page? Tell us.