alpha

Guides the AI to design React and TypeScript state with Zustand: when to use it, store slices, selectors, middleware, persistence and testing.
description: "React and TypeScript state management guidance for Zustand stores, selectors, middleware, persistence, and testing."
globs: **/.ts, **/.tsx
alwaysApply: false
You are an expert in React, TypeScript, and Zustand state management.
useState or useReducer.import { create } from 'zustand'
interface SidebarState {
isOpen: boolean
activePanelId: string | null
}
interface SidebarActions {
openPanel: (panelId: string) => void
close: () => void
toggle: () => void
}
type SidebarStore = SidebarState & SidebarActions
export const useSidebarStore = create<SidebarStore>()((set) => ({
isOpen: false,
activePanelId: null,
openPanel: (panelId) => set({ isOpen: true, activePanelId: panelId }),
close: () => set({ isOpen: false, activePanelId: null }),
toggle: () => set((state) => ({ isOpen: !state.isOpen })),
}))
useStore((state) => state.value).useShallow for object or tuple selectors that return multiple values.import { useShallow } from 'zustand/react/shallow'
import { useSidebarStore } from '@/stores/sidebar-store'
export function SidebarToggle() {
const { isOpen, toggle } = useSidebarStore(
useShallow((state) => ({
isOpen: state.isOpen,
toggle: state.toggle,
})),
)
return (
<button type="button" aria-expanded={isOpen} onClick={toggle}>
Toggle sidebar
</button>
)
}
any; use unknown plus narrowing for external data.set((state) => nextState) when the next value depends on current state.immer middleware only when it materially simplifies nested updates.persist only for state that must survive reloads.partialize, version, and migrate when persisting anything beyond trivial preferences.devtools in development for complex flows and give important actions clear names.subscribeWithSelector for non-React subscriptions that need fine-grained updates.idle, pending, success, and error.window, document, and storage access outside middleware configuration.Public domain (CC0 1.0) · by awesome-cursorrules contributors · source · posted by @OpenSourceBuffGuy on promptparty.com


Create and Share a Document with Stakeholders
Has Copilot turn notes into a Word document, show it for approval, save it to OneDrive or SharePoint, then draft and send an email with it only after confirmation.
microsoft-copilot, human-in-the-loop, prompt-chain, placeholders, template, microsoft-word, microsoft-365, sharepoint, outlook, email, report, workflow-automation, office-administration, for-executive-assistants, step-by-step-guide, tool-use, document-analysis, business-writing, beginner-friendly, long-form

Eval-Gated Fine-Tuning Lifecycle
Runs an eval-gated fine-tuning lifecycle end to end, handing seven phases from eval harness to export to specialist agents, each gated by the previous phase's artifact.
slash-command, orchestrator, fine-tuning, machine-learning, llm, llm-evaluation, mlops, plan-then-execute, prompt-chain, human-in-the-loop, multi-agent, placeholders, data-engineering, python, for-developers, advanced, long-form, structured-output, guardrails, checklist, deployment, state-tracking

Chromatic Gesture Characters Part 33: Ordinary Things
Defines a JSON style for cut-shape print posters where everyday objects turn into impossible things: a paperclip bird, candle butterfly, dice stairway and paint doorway.
image-prompt, json-prompt, placeholders, poster, surreal, typography, structured-output, long-form, advanced, for-artists, for-designers, illustration, papercraft, vibrant-colors, printmaking, vertical-format, widescreen, text-rendering, whimsical, negative-space, style-reference, creativity, character-consistency
Loading reviews…
Loading comments…