KS
Killer-Skills

generate-store-action — how to use generate-store-action how to use generate-store-action, generate-store-action alternative, generate-store-action install, what is generate-store-action, generate-store-action vs Redux, generate-store-action setup guide, Zustand async action generation, health-tracker-9000 development

v1.0.0
GitHub

About this Skill

Ideal for Full Stack Agents working with Zustand and API endpoints, seeking to streamline store action creation. generate-store-action is a skill that generates Zustand async actions for the health store with loading/error state management, simplifying the development process.

Features

Generates Zustand async actions with loading/error state management
Supports API endpoint configuration (e.g., /api/water-intake, /api/sleep)
Handles HTTP methods (GET, POST, PUT, DELETE) for request/response types
Enables state updates for storing data in Zustand
Follows implementation pattern based on src/lib/store/h

# Core Topics

marcd35 marcd35
[0]
[0]
Updated: 3/7/2026

Quality Score

Top 5%
51
Excellent
Based on code quality & docs
Installation
SYS Universal Install (Auto-Detect)
Cursor IDE Windsurf IDE VS Code IDE
> npx killer-skills add marcd35/health-tracker-9000/generate-store-action

Agent Capability Analysis

The generate-store-action MCP Server by marcd35 is an open-source Categories.community integration for Claude and other AI agents, enabling seamless task automation and capability expansion. Optimized for how to use generate-store-action, generate-store-action alternative, generate-store-action install.

Ideal Agent Persona

Ideal for Full Stack Agents working with Zustand and API endpoints, seeking to streamline store action creation.

Core Value

Empowers agents to generate Zustand async actions with loading and error state management, utilizing API endpoints and supporting HTTP methods like GET, POST, PUT, and DELETE, while handling request and response types for seamless state updates in Zustand.

Capabilities Granted for generate-store-action MCP Server

Generating async actions for health store management
Creating store actions with loading and error state management
Streamlining API endpoint interactions with Zustand
Automating state updates in Zustand based on API responses

! Prerequisites & Limits

  • Requires Zustand library integration
  • Limited to handling HTTP methods (GET, POST, PUT, DELETE)
  • Needs specific API endpoint and request/response type definitions
Project
SKILL.md
4.1 KB
.cursorrules
1.2 KB
package.json
240 B
Ready
UTF-8

# Tags

[No tags]
SKILL.md
Readonly

Generate Store Action

Generate a Zustand async action for the health store with loading/error state management.

Usage

When user requests to add a store action, ask for:

  1. Action name (e.g., "fetchWaterLogs", "addSleepLog", "updateWeight")
  2. API endpoint (e.g., "/api/water-intake", "/api/sleep")
  3. HTTP method (GET, POST, PUT, DELETE)
  4. Request/response types
  5. State updates needed (what gets stored in Zustand)

Implementation Pattern

Based on src/lib/store/healthStore.ts existing patterns.

Pattern Structure

Add to existing store in src/lib/store/healthStore.ts:

typescript
1// In HealthState interface: 2interface HealthState { 3 // ... existing state ... 4 waterLogs: WaterLog[]; 5 6 // ... existing actions ... 7 fetchWaterLogs: (date: string) => Promise<void>; 8 addWaterLog: (log: Omit<WaterLog, 'id' | 'createdAt'>) => Promise<void>; 9 deleteWaterLog: (id: string) => Promise<void>; 10} 11 12// In the store creation: 13export const useHealthStore = create<HealthState>((set, get) => ({ 14 // ... existing state ... 15 waterLogs: [], 16 17 // ... existing actions ... 18 19 fetchWaterLogs: async (date: string) => { 20 set({ isLoading: true, error: null }); 21 try { 22 const response = await fetch(`/api/water-intake?date=${date}`); 23 if (!response.ok) throw new Error('Failed to fetch water logs'); 24 const data = await response.json(); 25 set({ waterLogs: data, isLoading: false }); 26 } catch (err: any) { 27 set({ error: err.message, isLoading: false }); 28 toast.error(err.message || 'Failed to fetch water logs'); 29 } 30 }, 31 32 addWaterLog: async (log: Omit<WaterLog, 'id' | 'createdAt'>) => { 33 set({ isLoading: true, error: null }); 34 try { 35 const response = await fetch('/api/water-intake', { 36 method: 'POST', 37 headers: { 'Content-Type': 'application/json' }, 38 body: JSON.stringify(log), 39 }); 40 if (!response.ok) throw new Error('Failed to add water log'); 41 const newLog = await response.json(); 42 set({ 43 waterLogs: [...get().waterLogs, newLog], 44 isLoading: false, 45 }); 46 toast.success('Water intake logged'); 47 } catch (err: any) { 48 set({ error: err.message, isLoading: false }); 49 toast.error(err.message || 'Failed to add water log'); 50 } 51 }, 52 53 deleteWaterLog: async (id: string) => { 54 set({ isLoading: true, error: null }); 55 try { 56 const response = await fetch(`/api/water-intake?id=${id}`, { 57 method: 'DELETE', 58 }); 59 if (!response.ok) throw new Error('Failed to delete water log'); 60 set({ 61 waterLogs: get().waterLogs.filter((log) => log.id !== id), 62 isLoading: false, 63 }); 64 toast.success('Water log deleted'); 65 } catch (err: any) { 66 set({ error: err.message, isLoading: false }); 67 toast.error(err.message || 'Failed to delete water log'); 68 } 69 }, 70}));

Key Conventions

  • Always wrap in set({ isLoading: true, error: null })
  • Use await fetch() with proper method and headers
  • Check !response.ok to handle HTTP errors
  • Parse response with await response.json()
  • Use get() to access current state in actions
  • Update state with set() including isLoading: false
  • Call toast.success() on success
  • Call toast.error() on failure
  • Include error message in toast: err.message || 'Default message'
  • For arrays: use spread operator to create new array
  • State updates are immutable (don't mutate existing state)

Steps

  1. Ask user for action name, API endpoint, method, and types
  2. Open src/lib/store/healthStore.ts
  3. Add action type to HealthState interface
  4. Add initial state if needed (empty array, null, etc.)
  5. Implement action function following the pattern above
  6. Include proper error handling and toast notifications
  7. Format with Prettier

Implementation Checklist

  • Action added to HealthState interface
  • Initial state added if new data field
  • Async action with try-catch
  • Loading state managed (set/unset)
  • Error state managed
  • API endpoint correct
  • HTTP method correct
  • Response validation (!response.ok)
  • Toast notifications added
  • State updates are immutable
  • get() used to access current state

Related Skills

Looking for an alternative to generate-store-action or building a Categories.community AI Agent? Explore these related open-source MCP Servers.

View All

widget-generator

Logo of f
f

widget-generator is an open-source AI agent skill for creating widget plugins that are injected into prompt feeds on prompts.chat. It supports two rendering modes: standard prompt widgets using default PromptCard styling and custom render widgets built as full React components.

149.6k
0
Design

chat-sdk

Logo of lobehub
lobehub

chat-sdk is a unified TypeScript SDK for building chat bots across multiple platforms, providing a single interface for deploying bot logic.

73.0k
0
Communication

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
Communication

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
Communication