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.5 $0.00024 $0.01149
Sonnet 5.5 $0.00012 $0.00575
Haiku 4.5 $0.00006 $0.00287

Measured 2mo ago against content hash 948a0db5cadc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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. 2mo 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 1mo ago), licensed MIT. It adds 60 tokens to every session and 2,873 once invoked, about $0.0002 per session on Opus 5.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

state-management compared with skills from other repositories

state-management next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
state-managementLuuOW/meridian-mcpSkill01mo agoMITA60Claude Code, Codex
sanity-live-cache-componentssanity-io/next-sanitySkill955yesterdayMITA155Claude Code, Codex
evjsafx-team/evjsSkill277d agoMITA45Claude Code, Codex
notebooklm-managementPracticalSwan/agent-skillsSkill2514d agoMITA38Codex
breaking-changes-managementPracticalSwan/agent-skillsSkill2514d agoMITA43Codex
angular-state-management-v2diegosouzapw/awesome-omni-skillsSkill1814mo agoMITA76Claude Code, Codex
tanstack-startjoelhooks/joelclawSkill68todaynoneA58Claude Code