setup-zustand

Enforce zustand best-practice patterns in TypeScript store files.

3|1|Updated Mar 23, 2026
One-click install
npx skills add https://github.com/malinskibeniamin/skills --skill setup-zustand
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-zustand
Source: https://github.com/malinskibeniamin/skills/tree/main/setup-zustand
Command: npx skills add https://github.com/malinskibeniamin/skills --skill setup-zustand

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill enforces zustand best practices via a PostToolUse hook to prevent common anti-patterns in store files and improve reliability.

Core Features & Use Cases

  • Enforce double-parens create<T>()() to improve middleware type inference.
  • Warn against inline object selectors and guide to use useShallow for multi-value selectors to avoid unnecessary re-renders.
  • Ban direct localStorage usage in store files; encourage using zustand persist middleware for persistence.

Quick Start

Install and configure the PostToolUse hook, then verify your zustand store files against the rules.

Frequently Asked Questions about setup-zustand

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

FAQPage Schema
How do I enforce zustand best practices in TypeScript store files?

To enforce zustand best practices in TypeScript, use a PostToolUse hook to scan store files and block anti-patterns like single-parens create<T>()() and direct localStorage usage. This improves middleware type inference and reliability.

Why do I need double-parens create<T>()() when creating a zustand store?

Double-parens create<T>()() is required because it improves middleware type inference in TypeScript. A linter hook can block single-parens create<T>()() to enforce this pattern across all store modules that import zustand.

How do I prevent unnecessary re-renders with zustand inline object selectors?

To prevent unnecessary re-renders with zustand inline object selectors, use useShallow for multi-value selectors. A dedicated lint hook can warn against inline object selectors and guide you to the useShallow pattern.

Should I use direct localStorage in zustand store files for persistence?

You should not use direct localStorage in zustand store files for persistence. Instead, use the zustand persist middleware, which a lint rule can enforce by banning direct localStorage usage across your store modules.

Can I apply zustand lint rules to all store modules across my codebase?

Yes, you can apply zustand lint rules to all store modules across your codebase. The hook applies to any store module that imports zustand, covering store creation, selector usage, and persistence validation.