you-might-not-need-state

Analyze React code for unnecessary useState and derived state anti-patterns.

Updated Apr 16, 2026
One-click install
npx skills add https://github.com/tunacosgun/sim --skill you-might-not-need-state
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: you-might-not-need-state
Source: https://github.com/tunacosgun/sim/tree/main/.agents/skills/you-might-not-need-state
Command: npx skills add https://github.com/tunacosgun/sim --skill you-might-not-need-state

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Analyze and fix unnecessary useState, derived state, and server-state-in-local-state anti-patterns.

Core Features & Use Cases

  • Detects derived state stored in useState and props mirrored into state.
  • Recommends and applies fixes to ensure server data remains in React Query or Zustand and is not duplicated in local state.
  • Works during code reviews, PRs, and refactors to reduce client-side state duplication and improve maintainability.

Quick Start

Run the analyzer on the target scope to identify and fix unnecessary state usage.

Frequently Asked Questions about you-might-not-need-state

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix unnecessary useState and derived state in React components?

To fix unnecessary useState and derived state, analyze your React components to detect props mirrored into state and apply refactoring constraints to compute values directly during render instead of storing them locally.

When should I use React Query instead of useState for server state?

You should use React Query instead of useState for server state to prevent local state duplication and avoid chained state updates, ensuring server data remains external and maintainable across component re-renders.

What are common React state management anti-patterns like prop mirroring?

Common React state management anti-patterns include prop mirroring, derived state stored in useState, and server-state-in-local-state, all of which cause client-side state duplication and reduce maintainability.

Can I analyze an entire codebase for state duplication and anti-patterns?

Yes, you can analyze an entire codebase for state duplication by applying the analyzer to broader scopes, detecting unnecessary useState usage, and enforcing constraints to keep server data in React Query or Zustand.

How do I stop mirroring Zustand or React Query state into local useState?

To stop mirroring Zustand or React Query state into local useState, enforce architectural constraints that prevent server data duplication and remove derived state updates from your component logic.

What is the best way to refactor derived state stored in useState during a PR review?

The best way to refactor derived state stored in useState during a PR review is to run an analyzer on the diffs to detect unnecessary state duplication and apply fixes to compute values directly.