Expert Astro Server Actions — defineAction, astro:actions, Zod validation, ActionError, HTML form actions, accept form, progressive enhancement, redirect patterns. Use when handling form submissions, mutations, or any server-side logic with type safety.
From fuse-astronpx claudepluginhub fusengine/agents --plugin fuse-astroThis skill uses the workspace's default tool permissions.
references/defining-actions.mdreferences/error-handling.mdreferences/forms.mdreferences/overview.mdreferences/progressive-enhancement.mdreferences/templates/contact-form.mdreferences/templates/json-action.mdGuides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Details PluginEval's skill quality evaluation: 3 layers (static, LLM judge), 10 dimensions, rubrics, formulas, anti-patterns, badges. Use to interpret scores, improve triggering, calibrate thresholds.
Type-safe server functions with automatic validation, standardized errors, and progressive enhancement.
Before ANY implementation, use TeamCreate to spawn 3 agents:
src/actions/After implementation, run fuse-ai-pilot:sniper for validation.
| Feature | Benefit |
|---|---|
defineAction() | Type-safe server function definition |
| Zod validation | Automatic JSON and FormData parsing |
ActionError | Standardized error codes and messages |
accept: 'form' | Direct HTML form submission support |
| Progressive enhancement | Works without JavaScript enabled |
astro:actions | Client import for type-safe calls |
All actions live in src/actions/index.ts and export a server object:
// src/actions/index.ts
import { defineAction } from 'astro:actions';
import { z } from 'astro/zod';
export const server = {
myAction: defineAction({ /* ... */ })
}
| Mode | Description |
|---|---|
accept: 'json' (default) | Parses JSON request body |
accept: 'form' | Parses HTML FormData directly |
Standard HTTP-aligned codes: UNAUTHORIZED, FORBIDDEN, NOT_FOUND, BAD_REQUEST, INTERNAL_SERVER_ERROR, CONFLICT, TOO_MANY_REQUESTS.
| Need | Reference |
|---|---|
| Concepts & architecture | overview.md |
| defineAction patterns | defining-actions.md |
| ActionError handling | error-handling.md |
| HTML form integration | forms.md |
| Progressive enhancement | progressive-enhancement.md |
| Contact form template | templates/contact-form.md |
| JSON action template | templates/json-action.md |
input schema — Never skip Zod validationActionError for known errors — Standardized codes for client handlingaccept: 'form' for HTML forms — Native form submission supportctx.cookies for auth — Throw UNAUTHORIZED when not logged in