state-management

state-management is a skill for Cursor from girijashankarj/cursor-handbook. It costs 30 tokens per session (410 once invoked), scanned A, original, MIT.

A workflow for choosing and implementing how an application stores and shares changing data, such as screen state, form data, or server data.

In plain words
What is it for?
Use it to design stores or hooks, connect components, handle loading and errors, improve rendering performance, and test state logic.
Why use it?
It helps select an approach that fits the number of components, update frequency, persistence needs, and type of data.

Skill for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it to design stores or hooks, connect components, handle loading and errors, improve rendering performance, and test state logic.

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

Made for: Cursor.

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/girijashankarj/cursor-handbook/state-management/github.svg)](https://agentmods.dev/skills/girijashankarj/cursor-handbook/state-management)
Your own site
<a href="https://agentmods.dev/skills/girijashankarj/cursor-handbook/state-management"><img src="https://agentmods.dev/badge/skills/girijashankarj/cursor-handbook/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/girijashankarj/cursor-handbook/state-management"><img src="https://agentmods.dev/badge/skills/girijashankarj/cursor-handbook/state-management.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 410 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00030 $0.00410
Opus 5 $0.00015 $0.00205
Sonnet 5 $0.00006 $0.00082
Haiku 4.5 $0.00003 $0.00041

Measured 6d ago against content hash f2f509c8a184, 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 6d 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.

.cursor/skills/frontend/state-management/SKILL.md · 57 lines

What it actually says

Skill: Set Up State Management

Trigger

When the user needs to manage state for a new feature or refactor existing state.

Steps

Step 1: Analyze State Requirements

  • What data needs to be managed?
  • Is it UI state or server state?
  • How many components need access?
  • How often does it change?
  • Does it need to persist?

Step 2: Choose Approach

Use this decision tree:

  1. Single componentuseState / useReducer
  2. Parent + 1-2 children → Lift state up
  3. Many components, UI state → Context / Zustand
  4. Server data → TanStack Query
  5. Form data → React Hook Form
  6. Complex workflows → XState

Step 3: Implement Store/Hook

Based on the chosen approach, create:

  • State types/interfaces
  • Store definition or custom hook
  • Actions/mutations
  • Selectors for derived data

Step 4: Connect Components

  • Add provider (if using Context/Redux)
  • Use hooks in components
  • Implement loading states
  • Implement error handling
  • Handle empty states

Step 5: Optimize Performance

  • Memoize selectors
  • Avoid unnecessary re-renders
  • Keep state granular
  • Use React.memo for pure components

Step 6: Test

  • Test store/hook in isolation
  • Test components with mocked state
  • Test state transitions
  • Test error handling

Completion

State management is implemented, connected, optimized, and tested.

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. 6d ago First seen · 57 lines · 30 tokens per session scan A f2f509c8a184

Subscribe to this mod's changes

state-management is a skill published in the GitHub repository girijashankarj/cursor-handbook (30 stars, last pushed 10d ago), licensed MIT. It adds 30 tokens to every session and 410 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-09-03.

Related

Other skills, from other repositories

react-hook-builder

Creates custom React hooks for common patterns including data fetching, forms, authentication, local storage, debounce, and more. Use when users request "create custom hook", "React hook for", "useX hook", or "reusable hook".

patricio0312rev/skills · 52 tokens

component-scaffold-generator

Generates clean React/Vue component skeletons with TypeScript types, prop variants, styling hooks, test files, Storybook stories, and usage documentation. Use when users request "create a component", "scaffold component", "new React component", or "generate component boilerplate".

patricio0312rev/skills · 62 tokens

tanstack-query-setup

Implements TanStack Query (React Query) for server state management with caching, mutations, optimistic updates, and infinite queries. Use when users request "react query", "tanstack query", "data fetching", "cache management", or "server state".

patricio0312rev/skills · 57 tokens

zustand-state-builder

Implements lightweight state management using Zustand with TypeScript, persistence, devtools, and modular store patterns. Use when users request "zustand store", "state management", "global state", "zustand setup", or "jotai alternative".

patricio0312rev/skills · 55 tokens

eslint-prettier-config

Configures ESLint and Prettier for consistent code quality with TypeScript, React, and modern best practices. Use when users request "ESLint setup", "Prettier config", "linting configuration", "code formatting", or "lint rules".

patricio0312rev/skills · 58 tokens

storybook-setup

Sets up Storybook for component documentation with controls, actions, accessibility testing, and visual regression. Use when users request "Storybook setup", "component documentation", "UI library", "component stories", or "design system docs".

patricio0312rev/skills · 50 tokens