state-management

state-management is a skill for Claude Code from komluk/scaffolding. It costs 70 tokens per session (1,747 once invoked), scanned A, original, MIT.

Guidance for deciding where application data should live and how shared client-side state should be organized. It covers local component state, shared stores, server data, form data, and URL state, with examples using Zustand, a state-management library.

In plain words
What is it for?
Use it when creating a store, choosing between local and shared state, organizing store actions and selectors, or improving state-related performance.
Why use it?
It helps prevent putting data in the wrong place and reduces unnecessary updates when parts of the interface change.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { useWorkspaceStore } from '../stores/workspaceStore';.

Part of the scaffolding plugin — 35 skills, 9 commands, 13 agents shipped together

Good fit Use it when creating a store, choosing between local and shared state, organizing store actions and selectors, or improving state-related performance.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/komluk/scaffolding
agentmods
npx agentmods add skills/komluk/scaffolding/state-management

Made for: Claude Code.

Or install scaffolding, the plugin that ships this one along with the rest of its 35 skills, 9 commands, 13 agents.

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/komluk/scaffolding/state-management.svg)](https://agentmods.dev/skills/komluk/scaffolding/state-management)
Your own site
<a href="https://agentmods.dev/skills/komluk/scaffolding/state-management"><img src="https://agentmods.dev/badge/skills/komluk/scaffolding/state-management.svg" alt="Measured on agentmods" height="20"></a>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,747 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.00070 $0.01747
Opus 5 $0.00035 $0.00873
Sonnet 5 $0.00014 $0.00349
Haiku 4.5 $0.00007 $0.00175

Measured 7d ago against content hash 90756f57c767, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-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 7d 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 · 242 lines

How it starts

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

State Management Skill

Client state management standards and best practices. The universal guidance (local-vs-global decisions, store structure, selectors, performance) applies to any store library; the concrete code examples use Zustand.

When to Apply

  • Creating new state stores
  • Sharing state between components
  • State architecture decisions
  • Performance optimization for state

State Category Guidelines

Category Solution Use When
Local UI useState Single component, simple state
Shared UI Zustand store Multiple components need same data
Server data React Query / SWR API data with caching needs
Form state useState / form library Form inputs, validation
URL state useSearchParams Filter/sort params, shareable URLs

Zustand Store Standards

Store Structure

Element Requirement
Interface Define typed state + actions interface
State Group related state together
Actions Define all mutations as functions
Naming use[Domain]Store convention

Store Design Principles

Principle Description
Single responsibility One store per domain (projects, UI, settings)
Flat structure Avoid deeply nested state
Immutable updates Always return new objects
Colocated actions Keep actions inside store definition

Selector Best Practices

Selection Rules

Rule Reason
Select minimal data Reduces re-renders
Use shallow for objects Prevents unnecessary updates
Memoize derived data Use useMemo for computed values
Avoid selecting entire store Causes re-render on any change

Selector Patterns

Pattern Use Case
Single value (state) => state.count
Multiple values (state) => ({ a: state.a, b: state.b }), shallow
Derived value useMemo outside store

Read the full file on GitHub · 242 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. 7d ago First seen · 242 lines · 70 tokens per session scan A 90756f57c767

Subscribe to this mod's changes

state-management is a skill published in the GitHub repository komluk/scaffolding (15 stars, last pushed 1mo ago), licensed MIT. It adds 70 tokens to every session and 1,747 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-08-30.

Related

Other skills, from other repositories

interface-craft

Raises the visual and interaction quality of an interface — layout, hierarchy, type, spacing, density, and the details that separate a considered product from a generic one. Use this when a screen works but looks unfinished or default, when a layout feels crowded or arbitrary, when a page has no clear focal point, or…

cbrock84/headcount · 79 tokens

design-system

Builds and maintains the design system a product is assembled from — tokens for color, type, spacing and elevation, component contracts, and the rules that keep them coherent as the product grows. Use this when starting a new interface, when screens have drifted apart visually, when the same component exists three…

cbrock84/headcount · 82 tokens

interface-redesign

Upgrades an existing interface to a higher standard without rebuilding it — auditing what is there, identifying what reads as generic or unfinished, and sequencing changes by impact. Use this when a product works but looks dated or default, when a redesign is being considered, when deciding whether to restyle or…

cbrock84/headcount · 77 tokens

fidelity-gate

Build a UI against a frozen visual reference without drift - an inventory extracted before any code, a relics list, and a gate that MEASURES computed styles on a fixture carrying the reference's own data. Use when a mockup, design spec or screenshot is the contract.

jjanczur/tyran · 56 tokens

frontend-design

Use when user asks to build a web component, page, or application, or when the task involves frontend design, HTML/CSS generation, or UI layout. Applies specific rules for typography, OKLCH color, layout, motion, interaction, and UX writing to produce distinctive, production-grade interfaces that avoid generic AI…

harnessprotocol/harness-kit · 68 tokens

figma-fetch

Extract frame/component structure and all visible text from a Figma design URL. Use whenever a prompt or a fetched issue contains a figma.com/design or figma.com/file link.

theam/claude-dev-kit · 40 tokens