state-management

state-management is a skill for Claude Code, Codex from LuuOW/meridian-mcp. It costs 60 tokens per session (2,873 once invoked), scanned A, original, MIT.

A guide to managing data and UI state in frontend applications. Server state is data owned by an API, while client state belongs only to the browser.

In plain words
What is it for?
It is for choosing TanStack Query, Zustand, Redux Toolkit, or the URL for different kinds of state, including caching, refreshes, optimistic updates, filters, and persistence.
Why use it?
It helps avoid duplicate caches and stale data caused by storing the same server information in several places.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It is for choosing TanStack Query, Zustand, Redux Toolkit, or the URL for different kinds of state, including caching, refreshes, optimistic updates, filters, and persistence.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/luuow/meridian-mcp/state-management
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add LuuOW/meridian-mcp --skill state-management
Clone the repo
git clone --depth 1 https://github.com/LuuOW/meridian-mcp

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for state-management

README.md
[![agentmods](https://agentmods.dev/badge/skills/luuow/meridian-mcp/state-management/github.svg)](https://agentmods.dev/skills/luuow/meridian-mcp/state-management)
Your own site
<a href="https://agentmods.dev/skills/luuow/meridian-mcp/state-management"><img src="https://agentmods.dev/badge/skills/luuow/meridian-mcp/state-management/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for state-management

Your own site · 80×15
<a href="https://agentmods.dev/skills/luuow/meridian-mcp/state-management"><img src="https://agentmods.dev/badge/skills/luuow/meridian-mcp/state-management.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,873 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00060 $0.02873
Opus 5 $0.00030 $0.01437
Sonnet 5 $0.00012 $0.00575
Haiku 4.5 $0.00006 $0.00287

Measured 9d ago against content hash 948a0db5cadc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

state-management scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/state-management/SKILL.md · 333 lines

How it starts

The opening of the file, as written. The whole thing — 333 lines — stays where its author put it; the contents beside it link to each section on GitHub.

state-management

Core principle: server state and client state are different problems. Conflating them is the root cause of most frontend data bugs.

  • Server state: data that lives on the server. You don't own it — you cache it. TanStack Query or SWR.
  • Client state: data that only exists in the browser. You do own it. Zustand or Jotai.
  • URL state: filters, pagination, selected IDs. The URL is the store — nuqs or useSearchParams.

If you put server data into a Zustand store, you are building a second cache on top of TanStack Query. You will invent your own invalidation logic and lose.

1) TanStack Query — server state authority

// lib/query-client.ts — one instance, shared everywhere
import { QueryClient } from "@tanstack/react-query";

export const queryClient = new QueryClient({
  defaultOptions: {
    queries: {
      staleTime: 1000 * 60,       // data fresh for 1 min — don't refetch on every focus
      retry: 2,
      refetchOnWindowFocus: false, // usually too aggressive for dashboards
    },
  },
});
// hooks/use-articles.ts
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
import { api } from "@/lib/client";   // generated from OpenAPI spec (schema-authority)

// ── Query keys: treat them as addresses, not strings ─────────────────────────
export const articleKeys = {
  all:    ()               => ["articles"]              as const,
  list:   (filters: object)=> ["articles", "list", filters] as const,
  detail: (slug: string)   => ["articles", "detail", slug]  as const,
};

// ── Read ──────────────────────────────────────────────────────────────────────
export function useArticles(filters: ArticleFilters) {
  return useQuery({
    queryKey: articleKeys.list(filters),
    queryFn:  () => api.getArticles(filters),
  });
}

export function useArticle(slug: string) {
  return useQuery({
    queryKey: articleKeys.detail(slug),
    queryFn:  () => api.getArticle(slug),
    enabled:  !!slug,
  });
}

Read the full file on GitHub · 333 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 333 lines · 60 tokens per session scan A 948a0db5cadc

Subscribe to this mod's changes

state-management is a skill published in the GitHub repository LuuOW/meridian-mcp (0 stars, last pushed yesterday), licensed MIT. It adds 60 tokens to every session and 2,873 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

sanity-live-cache-components

Integrates Sanity Live with Next.js Cache Components in next-sanity v13+ apps. Sets up sanityFetch, a shared cachedSanity 'use cache' boundary, , Visual Editing, Presentation Tool, draft mode handling, and the three-layer (Page/Dynamic/Cached) component pattern with explicit perspective/stega prop-drilling. Sequences…

sanity-io/next-sanity · 155 tokens

angular-state-management-v2

Angular State Management workflow skill. Use this skill when the user needs Master modern Angular state management with Signals, NgRx, and RxJS. Use when setting up global state, managing component stores, choosing between state solutions, or migrating from legacy patterns and the operator should preserve the upstream…

diegosouzapw/awesome-omni-skills · 76 tokens

zustand-docs

Zustand — small, fast, scalable state management for React. Store creation, hooks, middleware, TypeScript.

pledgeandgrow/pledge-skills · 29 tokens

tanstack-start

Build full-stack React apps with TanStack Start — server functions, type-safe routing, loaders, middleware, SSR/streaming, and deployment patterns. Use when working on TanStack Start apps, server functions, TanStack Router, or any gremlin-cms development.

joelhooks/joelclaw · 58 tokens

tanstack-start

Full-stack React framework powered by TanStack Router with SSR, streaming, server functions, and deployment to any hosting provider.

tanstack-skills/tanstack-skills · 28 tokens

angular-state-management

Angular State Management workflow skill. Use this skill when the user needs Master modern Angular state management with Signals, NgRx, and RxJS. Use when setting up global state, managing component stores, choosing between state solutions, or migrating from legacy patterns and the operator should preserve the upstream…

diegosouzapw/awesome-omni-skills · 74 tokens