Zustand stores

From aexol-studio/axolotl · View interactive version

Zustand stores is an AI agent skill from the GitHub repository aexol-studio/axolotl. Zustand state management patterns - auth store with SSR-safe initialization and store best practices

How to use this skill

Skill file

When to Use Zustand

Zustand is for shared client state — UI preferences, sidebar collapsed, feature toggles, etc.

Auth state is managed by React Query (queryKeys.me cache + useAuth() hook) — not Zustand.

Store Pattern

import { create } from 'zustand';

interface UIState {
  sidebarOpen: boolean;
  toggleSidebar: () => void;
}

export const useUIStore = create<UIState>()((set) => ({
  sidebarOpen: true,
  toggleSidebar: () => set((s) => ({ sidebarOpen: !s.sidebarOpen })),
}));

Rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.