setup-zustand

Installation
SKILL.md

Setup Zustand

What This Sets Up

PostToolUse hook on Edit/Write catching zustand anti-patterns:

  • Ban single-parens create<T>() — must be create<T>()() for middleware type inference
  • Ban inline object selectors(s) => ({ a: s.a }) causes infinite re-renders, suggest useShallow
  • Ban localStorage/sessionStorage in store files — use zustand persist middleware instead

Steps

1. Create hook script

Copy scripts/zustand-check.sh and scripts/_hook-lib.sh into .claude/hooks/. Make executable.

2. Configure hook in .claude/settings.json

Add to hooks config: PostToolUse (matcher: Edit|Write): .claude/hooks/zustand-check.sh

Related skills
Installs
8
GitHub Stars
3
First Seen
Mar 25, 2026