server-actions

Standardizes Next.js Server Actions with Zod validation and caching hooks.

2|Updated Aug 20, 2025
One-click install
npx skills add https://github.com/JasonPaff/head-shakers --skill server-actions-jasonpaff
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: server-actions
Source: https://github.com/JasonPaff/head-shakers/tree/main/.claude/skills/server-actions
Command: npx skills add https://github.com/JasonPaff/head-shakers --skill server-actions-jasonpaff

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill standardizes the development of Next.js Server Actions, eliminating common pitfalls and ensuring consistent patterns for authentication, validation, error handling, caching, and client-side consumption.

Core Features & Use Cases

  • Automated Convention Enforcement: Ensures server actions use appropriate clients (authActionClient, adminActionClient), validate input with Zod, and handle errors consistently.
  • Integrated Caching & Sentry: Automatically includes cache invalidation after mutations and sets Sentry context for robust monitoring.
  • Client-Side Consumption Patterns: Guides the use of the useServerAction hook for consistent loading states, toast messages, and result access.
  • Use Case: When creating a server action to update a user's profile, this Skill ensures the action uses authActionClient, validates input via Zod, sets Sentry context, delegates logic to a facade, invalidates the user profile cache, and returns a consistent response shape.

Quick Start

Create a new Next.js server action to handle user profile updates, ensuring it uses authActionClient, validates input with Zod, and invalidates the cache upon success.