generate-store-action

Generate deterministic async actions in the Zustand health store with loading and error states.

Updated Jan 18, 2026
One-click install
npx skills add https://github.com/marcd35/health-tracker-9000 --skill generate-store-action
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: generate-store-action
Source: https://github.com/marcd35/health-tracker-9000/tree/main/.claude/skills/generate-store-action
Command: npx skills add https://github.com/marcd35/health-tracker-9000 --skill generate-store-action

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generate a deterministic, scalable async action in the Zustand health store to manage loading and error states when integrating new API calls.

Core Features & Use Cases

  • Automated action generation: Create fetch/add/delete actions aligned with existing HealthStore patterns.
  • Loading and error handling: Standardizes isLoading and error state management with toast notifications on success or failure.
  • Developer guidance: Provides templates and TypeScript typings for consistency with src/lib/store/healthStore.ts.

Quick Start

Provide: action name, API endpoint, HTTP method, request/response types, and the required state updates. The skill will modify src/lib/store/healthStore.ts accordingly.

Frequently Asked Questions about generate-store-action

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

FAQPage Schema
How do I add an async Zustand action with loading states for an API call?

You can automate Zustand action generation by providing the action name, API endpoint, HTTP method, and request/response types. The skill modifies healthStore.ts to extend the HealthState interface and add the new CRUD-like action with loading states.

What is the best way to manage loading and error states in a Zustand store?

The best way to manage loading and error states in a Zustand store is using a deterministic async action pattern. This approach standardizes isLoading and error state updates, ensuring API integration includes toast notifications for success or failure.

How do I generate TypeScript types for new Zustand store actions?

You generate TypeScript types for Zustand store actions by extending the HealthState interface with the required request and response types. The skill ensures type safety by applying these typings consistently when adding new API calls to healthStore.ts.

Does this Zustand action generator support CRUD operations for API integration?

Yes, this Zustand action generator supports CRUD operations for API integration. It automates the creation of fetch, add, and delete actions against health API endpoints, applying existing patterns for state updates and toast notifications.

Can I use toast notifications for success and error handling in Zustand?

Yes, you can use toast notifications for success and error handling in Zustand. The skill standardizes toast notifications on success or failure, ensuring consistent feedback when the deterministic async action completes the API call.

Why do my Zustand store actions lack consistent error handling for API calls?

Your Zustand store actions may lack consistent error handling if they do not follow a deterministic async pattern. Standardizing state updates and toast notifications within healthStore.ts ensures isLoading and error states are managed uniformly across all API calls.