write-action

Create server actions with authentication, Zod validation, and model orchestration.

Updated Oct 29, 2025
One-click install
npx skills add https://github.com/coeus-ventures/epic-web --skill write-action
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: write-action
Source: https://github.com/coeus-ventures/epic-web/tree/main/.claude/skills/write-action
Command: npx skills add https://github.com/coeus-ventures/epic-web --skill write-action

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The skill automates the creation of server actions that enforce authentication, input validation, and orchestration of model calls within the Epic three-layer architecture, reducing boilerplate and inconsistencies.

Core Features & Use Cases

  • Authentication-first actions: Enforce user authentication via getUser() on the server.
  • Validation with Zod: Validate inputs before invoking models.
  • Orchestrated backend: Coordinate with models for data operations without direct DB access.
  • Architecture consistency: Applies the Epic three-layer pattern across frontend actions, backend actions, and models.

Quick Start

Create a sample action that authenticates a user, validates input with Zod, and orchestrates a model call in the Epic backend pattern.

Frequently Asked Questions about write-action

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

FAQPage Schema
How do I create secure TypeScript server actions with authentication and validation?▼

Build secure server actions by enforcing user authentication via getUser(), validating inputs with Zod, and orchestrating model calls without direct database access. This approach eliminates boilerplate and ensures backend logic remains protected.

How does Zod validation work with server actions in a three-layer architecture?▼

Zod validation works within server actions by intercepting and verifying inputs before any model calls execute within the Epic three-layer architecture. This ensures only authenticated and properly structured data reaches your backend layer.

Do I need the use-server directive for backend TypeScript actions?▼

Yes, you need the use-server directive for backend TypeScript actions to enforce that code runs exclusively on the server. This directive is automatically applied to maintain strict boundaries between frontend and backend execution.

What is the best way to standardize error handling in server actions?▼

The best way to standardize error handling in server actions is to enforce a consistent action response format across all endpoints. This provides predictable feedback for orchestration failures and validation errors.

Can I use server actions for backend tasks without direct database access?▼

Yes, you can use server actions for backend tasks without direct database access by orchestrating model calls instead. The architecture coordinates with models for data operations, keeping actions focused on validation and business logic.