state-management-patterns

state-management-patterns is a skill for Claude Code, Codex from KraitDev/skiLL.Md. It costs 19 tokens per session (1,664 once invoked), scanned A, original, MIT.

A guide for deciding where application data should live in a modern web app, such as in the interface, server data, the URL, or shared app state.

In plain words
What is it for?
Planning interactive features, reorganising state in React apps, connecting fetched data to interface state, and replacing an unnecessarily large shared store.
Why use it?
It helps avoid duplicated data, unnecessary screen updates, and bugs caused by keeping the same information in multiple places.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Codex.

Good fit Planning interactive features, reorganising state in React apps, connecting fetched data to interface state, and replacing an unnecessarily large shared store.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kraitdev/skill.md/state-management-patterns
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 KraitDev/skiLL.Md --skill state-management-patterns
Clone the repo
git clone --depth 1 https://github.com/KraitDev/skiLL.Md

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-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/kraitdev/skill.md/state-management-patterns/github.svg)](https://agentmods.dev/skills/kraitdev/skill.md/state-management-patterns)
Your own site
<a href="https://agentmods.dev/skills/kraitdev/skill.md/state-management-patterns"><img src="https://agentmods.dev/badge/skills/kraitdev/skill.md/state-management-patterns/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-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/kraitdev/skill.md/state-management-patterns"><img src="https://agentmods.dev/badge/skills/kraitdev/skill.md/state-management-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 19 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,664 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.00019 $0.01664
Opus 5.5 $0.00008 $0.00666
Sonnet 5.5 $0.00004 $0.00333
Haiku 4.5 $0.00002 $0.00166

Measured 1mo ago against content hash c121388ea958, 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-patterns 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 1mo 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/frontend/state-management-patterns/SKILL.md · 165 lines

How it starts

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

State Management Patterns

Purpose

Applications suffer from bugs and performance issues when state lives in the wrong place. This skill guides teams to categorize state by its nature (UI, server, URL, global) and store it appropriately, eliminating duplication, excessive re-renders, and synchronization bugs.

When to use

  • Adding new interactive features that require data persistence across views
  • Refactoring an app suffering from excessive re-renders
  • Integrating external data fetching with local UI state
  • Deciding where a new piece of state should live
  • Migrating from Redux/global store when unnecessary

When NOT to use

  • Component-level prop decisions (use React Component Design skill)
  • Server caching strategy decisions (use Caching Strategies skill)
  • Real-time synchronization protocols (different concern)

Inputs required

  • Existing React application with state management code
  • Understanding of current state locations (Redux, Context, useState)
  • List of state mutations and their trigger sources

Workflow

  1. Categorize State: Classify each state piece as: UI-only, Server, URL-driven, or Truly Global
  2. URL First: Move ALL sort, filter, pagination, search, and tab parameters to URL search params
  3. Separate Server Cache: Use React Query / SWR / Tanstack Query for ALL server data (never Redux)
  4. Localize UI State: Keep form inputs, modals, toggles, tooltips in component useState only
  5. Identify Global: ONLY theme, auth, and language user preferences go to Context/Redux
  6. Implement Separation: Refactor code to respect these boundaries
  7. Verify Sync: Ensure no state is duplicated across layers

Rules

  • MUST store shareable states (filters, search, pagination) in URL, not Redux/Context
  • MUST use React Query/SWR for server data, NEVER Redux
  • MUST NOT manually sync server data between global store and cache layer
  • MUST NOT store UI-only state (modal open, form focus) in global store
  • MUST NOT mirror props into local state
  • MUST NOT have duplicate copies of state

Read the full file on GitHub · 165 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. 1mo ago First seen · 165 lines · 19 tokens per session scan A c121388ea958

Subscribe to this mod's changes

state-management-patterns is a skill published in the GitHub repository KraitDev/skiLL.Md (6 stars, last pushed 4mo ago), licensed MIT. It adds 19 tokens to every session and 1,664 once invoked, about $0.0001 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-08-31.

Related

Other skills, from other repositories

evaluate-pattern-adoption

Run or plan this repository's pattern-adoption evidence evaluation locally with signed-in Codex agents. Use when asked to refresh stale evidence, assess stable or exploratory patterns, evaluate one or all catalog patterns, discover possible new patterns, or prepare a reviewable evidence PR without model-backed GitHub…

PaulDuvall/ai-development-patterns · 68 tokens

learn

Guided, hands-on course teaching architects how to use Codex or Claude Code — six short modules, each built around an exercise on a bundled sandbox project (a fictional Brooklyn art museum expansion). Resumable across sessions via PROGRESS.md. Use when the user runs $learn or /as:learn, says they're new to AI-assisted…

AlpacaLabsLLC/skills-for-architects · 80 tokens

product-data-cleanup

Clean a local FF&E CSV schedule by normalizing casing, dimensions, units, language, materials, and formatting. Use when asked to clean, fix, or standardize product data.

AlpacaLabsLLC/skills-for-architects · 42 tokens

product-image-processor

Download, resize, and remove backgrounds from product images at scale. Use when the user asks to "process product images", batch-download images from the schedule, strip backgrounds, or standardize product photos.

AlpacaLabsLLC/skills-for-architects · 45 tokens

product-research

Find and compare current FF&E candidates from a design brief, with sourced purchasing facts and optional CSV-library save. Use to research or source products; not to match from an image or pair coordinating items.

AlpacaLabsLLC/skills-for-architects · 44 tokens

zoning-envelope

Generate interactive 3D zoning envelope viewers from zoning analysis reports. Use when the user asks to "visualize the zoning envelope" or see buildable massing in 3D, typically after /as:zoning-analysis-nyc. Requires a zoning analysis report as input.

AlpacaLabsLLC/skills-for-architects · 60 tokens