Skip to content
Back to skills

Frontend State Architecture

ASecurity

Architect frontend state: treat server data as a cache (TanStack Query/SWR/RSC), place client state at the narrowest workable scope (local -> context -> store), invalidate deliberately, use optimistic updates with rollback, and derive rather than duplicate.

  • 7 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 23, 2026
ai-agentsapifrontend

Works with

  • cli
  • api

Security analysis

A100/100

Scanned September 23, 2026

npx -y skills add mcorbett51090/RavenClaude --skill frontend-state-architecture --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Frontend State Architecture?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Frontend State Architecture
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mcorbett51090-frontend-state-architecture/badge)](https://www.skillsdirectory.com/skills/mcorbett51090-frontend-state-architecture)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: frontend-state-architecture
description: "Architect frontend state: treat server data as a cache (TanStack Query/SWR/RSC), place client state at the narrowest workable scope (local -> context -> store), invalidate deliberately, use optimistic updates with rollback, and derive rather than duplicate."
---

# Frontend State Architecture

## Server state != client state
API data is a **cache** -> TanStack Query / SWR / RSC (revalidation, loading/error free). **Never** put server data in a global store — that's the classic staleness bug.

## Client state scope
Local -> context (small shared tree) -> store (Zustand/Redux) **only** for genuinely global cross-cutting state. Don't globalize by default.

## Mutations
Define what each mutation invalidates; optimistic update + **rollback** on failure.

## Derive, don't duplicate
Compute derived values in render; stored derived state desyncs.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…