api-designer

Server action patterns

⭐10stars🔀6forks📁View on GitHub🕐Updated Dec 25, 2025

When & Why to Use This Skill

The API Designer skill is a specialized tool for developers to standardize and streamline server action patterns within modern web frameworks. It focuses on implementing robust, type-safe backend logic by enforcing best practices such as Zod schema validation, multi-tenant context handling, and automated cache revalidation, ensuring high-quality API architecture and data integrity.

Use Cases

  • Standardizing Server Actions: Establish a consistent workflow for server-side operations to improve code maintainability and team collaboration.
  • Input Validation & Security: Leverage Zod integration to ensure all incoming data is strictly validated and type-safe before execution.
  • Multi-tenant Data Management: Seamlessly incorporate contextual identifiers like schoolId into operations to maintain secure data isolation.
  • Automated Cache Invalidation: Ensure real-time UI updates by automatically triggering revalidatePath() after successful database mutations.
  • Error Handling Optimization: Implement a unified pattern for catching and processing server-side errors to provide a better user experience.
nameAPI Designer
descriptionServer action patterns
version1.0.0
categoryapi

API Design Skill

Server Action Pattern

  1. Validate with Zod
  2. Include schoolId
  3. Execute operation
  4. revalidatePath()
  5. Handle errors

Checklist

  • Zod validation
  • schoolId included
  • Revalidation called
  • Type-safe