generate-store-action — community generate-store-action, health-tracker-9000, community, ide skills, Claude Code, Cursor, Windsurf

v1.0.0
GitHub

About this Skill

Perfect for State Management Agents needing async action generation with loading and error state handling in Zustand. health-tracker-9000

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

Agent Capability Analysis

The generate-store-action skill by marcd35 is an open-source community AI agent skill for Claude Code and other IDE workflows, helping agents execute tasks with better context, repeatability, and domain-specific guidance.

Ideal Agent Persona

Perfect for State Management Agents needing async action generation with loading and error state handling in Zustand.

Core Value

Empowers agents to generate Zustand async actions with loading/error state management, utilizing API endpoints and handling HTTP methods like GET, POST, PUT, and DELETE, while updating state in Zustand.

Capabilities Granted for generate-store-action

Generating async actions for fetching user data
Creating store actions for updating user preferences
Handling API errors and loading states in Zustand

! Prerequisites & Limits

  • Requires Zustand state management library
  • Limited to HTTP methods GET, POST, PUT, and DELETE
Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

generate-store-action

Install generate-store-action, an AI agent skill for AI agent workflows and automation. Works with Claude Code, Cursor, and Windsurf with one-command setup.

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

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is generate-store-action?

Perfect for State Management Agents needing async action generation with loading and error state handling in Zustand. health-tracker-9000

How do I install generate-store-action?

Run the command: npx killer-skills add marcd35/health-tracker-9000. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for generate-store-action?

Key use cases include: Generating async actions for fetching user data, Creating store actions for updating user preferences, Handling API errors and loading states in Zustand.

Which IDEs are compatible with generate-store-action?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for generate-store-action?

Requires Zustand state management library. Limited to HTTP methods GET, POST, PUT, and DELETE.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add marcd35/health-tracker-9000. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use generate-store-action immediately in the current project.

Related Skills

Looking for an alternative to generate-store-action or another community skill for your workflow? Explore these related open-source skills.

View All

widget-generator

Logo of f
f

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.

149.6k
0
AI

flags

Logo of vercel
vercel

flags is a Next.js feature management skill that enables developers to efficiently add or modify framework feature flags, streamlining React application development.

138.4k
0
Browser

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
AI

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
AI