secondsky/claude-skills / plugins/zustand-state-management/skills/zustand-state-management
zustand-state-management
VerifiedZustand state management for React with TypeScript. Use for global state, Redux/Context API migration, localStorage persistence, slices pattern, devtools, Next.js SSR, or encountering hydration errors, TypeScript inference issues, persist middleware problems, infinite render loops.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 9.7 KB |
| assets/example-template.txt | markdown | 416 B |
| references/advanced-topics.md | markdown | 7.9 KB |
| references/common-patterns.md | markdown | 6.4 KB |
| references/example-reference.md | markdown | 760 B |
| references/known-issues.md | markdown | 5.4 KB |
| references/middleware-guide.md | markdown | 5.2 KB |
| references/migration-guide.md | markdown | 6.2 KB |
| references/nextjs-hydration.md | markdown | 5.0 KB |
| references/typescript-patterns.md | markdown | 4.9 KB |
| scripts/check-versions.shexecutable | script | 3.6 KB |
| scripts/example-script.shexecutable | script | 302 B |
| templates/async-actions-store.ts | script | 7.6 KB |
| templates/basic-store.ts | script | 908 B |
| templates/computed-store.ts | script | 5.6 KB |
| templates/devtools-store.ts | script | 3.4 KB |
| templates/nextjs-store.ts | script | 2.6 KB |
| templates/persist-store.ts | script | 2.8 KB |
| templates/slices-pattern.ts | script | 5.0 KB |
| templates/typescript-store.ts | script | 1.8 KB |
scripts/check-versions.sh
View on GitHub#!/bin/bash
# Zustand Version Checker
# Verifies installed versions and compatibility
# Usage: ./scripts/check-versions.sh
set -e
echo "π» Zustand Version Checker"
echo "=========================="
echo ""
# Check if package.json exists
if [ ! -f "package.json" ]; then
echo "β No package.json found in current directory"
echo " Run this script from your project root"
exit 1
fi
# Function to get installed version
get_version() {
local package=$1
if [ -f "node_modules/$package/package.json" ]; then
node -p "require('./node_modules/$package/package.json').version" 2>/dev/null || echo "not installed"
else
echo "not installed"
fi
}
# Function to get latest version from npm
get_latest() {
local package=$1
npm view "$package" version 2>/dev/null || echo "unknown"
}
# Check Zustand
echo "π¦ Zustand"
zustand_installed=$(get_version "zustand")
zustand_latest=$(get_latest "zustand")
if [ "$zustand_installed" = "not installed" ]; then
echo " Status: β Not installed"
echo " Install: npm install zustand"
else
echo " Installed: $zustand_installed"
echo " Latest: $zustand_latest"
# Check if major version is 5
major=$(echo "$zustand_installed" | cut -d'.' -f1)
if [ "$major" -ge 5 ]; then
echo " Status: β
v5+ (recommended)"
elif [ "$major" -eq 4 ]; then
echo " Status: β οΈ v4 (upgrade recommended)"
echo " Migration: See references/migration-guide.md"
else
echo " Status: β v$major (unsupported)"
echo " Action: Upgrade to v5+"
fi
fi
echo ""
# Check React
echo "π¦ React"
react_installed=$(get_version "react")
react_latest=$(get_latest "react")
if [ "$react_installed" = "not installed" ]; then
echo " Status: β Not installed"
else
echo " Installed: $react_installed"
echo " Latest: $react_latest"
# Check if version is 18+
major=$(echo "$react_installed" | cut -d'.' -f1)
if [ "$major" -ge 18 ]; then
echo " Status: β
v18+ (compatible)"
else
echo " Status: β οΈ v$major (Zustand works, but upgrade recommended)"
fi
fi
echo ""
# Check TypeScript (optional)
echo "π¦ TypeScript (optional)"
ts_installed=$(get_version "typescript")
if [ "$ts_installed" = "not installed" ]; then
echo " Status: βΉοΈ Not installed (optional)"
else
echo " Installed: $ts_installed"
# Check if version is 5+
major=$(echo "$ts_installed" | cut -d'.' -f1)
if [ "$major" -ge 5 ]; then
echo " Status: β
v5+ (recommended)"
else
echo " Status: β οΈ v$major (upgrade recommended for better types)"
fi
fi
echo ""
# Check Next.js (if using persist)
if grep -q '"next"' package.json 2>/dev/null; then
echo "π¦ Next.js (detected)"
next_installed=$(get_version "next")
echo " Installed: $next_installed"
# Check if major version is 14+
major=$(echo "$next_installed" | cut -d'.' -f1)
if [ "$major" -ge 14 ]; then
echo " Status: β
v14+ (App Router supported)"
elif [ "$major" -eq 13 ]; then
echo " Status: β
v13 (supported)"
else
echo " Status: β οΈ v$major (upgrade recommended)"
fi
echo " Note: See references/nextjs-hydration.md for SSR setup"
echo ""
fi
# Summary
echo "=========================="
echo "β
Version check complete"
echo ""
if [ "$zustand_installed" = "not installed" ]; then
echo "Next steps:"
echo " npm install zustand"
echo " See SKILL.md for setup instructions"
elif [ "$major" -lt 5 ]; then
echo "Recommended upgrade:"
echo " npm install zustand@latest"
echo " See references/migration-guide.md for v4βv5 changes"
else
echo "All versions compatible! π"
echo "See SKILL.md for usage patterns"
fi
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |