claude-workspace: Skill for Claude Code

.claude/skills/state-management/SKILL.md

state-management is a skill for Claude Code from Piyush8296/claude-workspace. It costs 36 tokens per session (1,596 once invoked), scanned A, original, MIT.

A guide to choosing where React application data should live, such as inside one component, in the URL, across the app, or on a server. It compares simple state tools with libraries for shared and remote data.

In plain words
What is it for?
Use it to manage component inputs and modals, shared interface settings, cached backend data, authentication and themes, URL filters, and form validation.
Why use it?
It helps prevent using one state tool for every problem and makes complex data easier to update, share, cache, and keep in sync.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is Piyush8296/claude-workspace's own configuration. It tells Claude Code how to work on claude-workspace itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-workspace configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Piyush8296/claude-workspace. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Piyush8296/claude-workspace/main/.claude/skills/state-management/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/Piyush8296/claude-workspace

Made for: Claude Code.

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/piyush8296/claude-workspace/state-management/github.svg)](https://agentmods.dev/skills/piyush8296/claude-workspace/state-management)
Your own site
<a href="https://agentmods.dev/skills/piyush8296/claude-workspace/state-management"><img src="https://agentmods.dev/badge/skills/piyush8296/claude-workspace/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/piyush8296/claude-workspace/state-management"><img src="https://agentmods.dev/badge/skills/piyush8296/claude-workspace/state-management.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,596 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.00036 $0.01596
Opus 5 $0.00018 $0.00798
Sonnet 5 $0.00007 $0.00319
Haiku 4.5 $0.00004 $0.00160

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

.claude/skills/state-management/SKILL.md · 216 lines

How it starts

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

State Management

The State Classification Framework

Before choosing a tool, classify the state:

Type Scope Tool Example
UI State Single component useState Modal open, input value
Shared UI State Few components Lift state + props / Context Active tab, sidebar collapsed
Server State Cached remote data TanStack Query / SWR User list, profile data
Global App State Entire app Zustand / Jotai Auth, theme, feature flags
URL State Navigation useSearchParams / router Filters, pagination, sort
Form State Form lifecycle React Hook Form / Formik Input values, validation

Golden rule: Use the simplest tool that fits. useState > Context > Zustand > Redux.

Server State (TanStack Query)

This is the most common state type in frontend apps. Most "global state" is actually server state.

Query Pattern

import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';

// Query keys as const for type safety
export const userKeys = {
  all: ['users'] as const,
  lists: () => [...userKeys.all, 'list'] as const,
  list: (filters: UserFilters) => [...userKeys.lists(), filters] as const,
  details: () => [...userKeys.all, 'detail'] as const,
  detail: (id: string) => [...userKeys.details(), id] as const,
};

// Query hook
export function useUsers(filters: UserFilters) {
  return useQuery({
    queryKey: userKeys.list(filters),
    queryFn: () => api.users.list(filters),
    staleTime: 5 * 60 * 1000, // 5 minutes
  });
}

// Mutation hook with cache invalidation
export function useCreateUser() {
  const queryClient = useQueryClient();

  return useMutation({
    mutationFn: api.users.create,
    onSuccess: () => {
      queryClient.invalidateQueries({ queryKey: userKeys.lists() });
      toast.success('User created');
    },
    onError: (error) => {
      console.error('createUser failed:', error);
      toast.error('Failed to create user');
    },
  });
}

Read the full file on GitHub · 216 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. 10d ago First seen · 216 lines · 36 tokens per session scan A ee3415747bf7

Subscribe to this mod's changes

state-management is a skill published in the GitHub repository Piyush8296/claude-workspace (2 stars, last pushed 4mo ago), licensed MIT. It adds 36 tokens to every session and 1,596 once invoked, about $0.0002 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-31.

Related

Other skills, from other repositories

generic-react-ux-designer

Professional UI/UX design expertise for React applications. Covers design thinking, user psychology (Hick's/Fitts's/Jakob's Law), visual hierarchy, interaction patterns, accessibility, performance-driven design, and design critique. Use when designing features, improving UX, solving user problems, or conducting design…

travisjneuman/.claude · 69 tokens

generic-react-feature-developer

Guide feature development for React applications with architecture focus. Covers Zustand/Redux patterns, IndexedDB usage, component systems, lazy loading strategies, and seamless integration. Use when adding new features, refactoring existing code, or planning major changes.

travisjneuman/.claude · 53 tokens

generic-react-code-reviewer

Review React/TypeScript code for bugs, security vulnerabilities, performance issues, accessibility gaps, and CLAUDE.md workflow compliance. Enforces TypeScript strict mode, GPU-accelerated animations, WCAG AA accessibility, bundle size limits, and surgical simplicity. Use when completing features, before commits, or…

travisjneuman/.claude · 71 tokens

generic-react-design-system

Complete design system reference for React applications. Covers colors, typography, spacing, component patterns, glassmorphism effects, GPU-accelerated animations, and WCAG AA accessibility. Use when implementing UI, choosing colors, applying spacing, creating components, or ensuring brand consistency.

travisjneuman/.claude · 59 tokens

react-ops

React development patterns, hooks, state management, Server Components, and performance optimization. Use for: react, hooks, useState, useEffect, jsx, tsx, next.js, nextjs, app router, server components, RSC, zustand, react query, component patterns, react testing library, error boundary, suspense, react 19.

0xDarkMatter/claude-mods · 75 tokens

senior-dev

Activates the SeniorDev agent for full-stack software engineering. Use this skill when you need production-ready code: Next.js 14 frontends, FastAPI backends, TypeScript strict-mode components, PostgreSQL schemas, Redis caching, authentication flows, or complete REST/GraphQL APIs. SeniorDev always outputs complete…

vignesh2027/Claude-Agentic-Skills2.0-version · 86 tokens