astro-actions

Solid

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.

Web & Frontend 22 stars 3 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 88/100

Stars 20%
45
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Astro Actions Expert Type-safe server functions with automatic validation, standardized errors, and progressive enhancement. ## Agent Workflow (MANDATORY) Before ANY implementation, use `TeamCreate` to spawn 3 agents: 1. **fuse-ai-pilot:explore-codebase** - Check existing actions in `src/actions/` 2. **fuse-ai-pilot:research-expert** - Verify latest Actions docs via Context7/Exa 3. **mcp__context7__query-docs** - Get defineAction and ActionError examples After implementation, run **fuse-ai-pilot:sniper** for validation. --- ## Overview ### When to Use - Handling form submissions with server-side validation - Creating type-safe backend mutations without API boilerplate - Building progressive enhancement (works without JS) - Replacing API endpoints for client-server communication ### Why Astro Actions | 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 | --- ## Core Concepts ### Action Structure All actions live in `src/actions/index.ts` and export a `server` object: ```typescript // src/actions/index.ts import { defineAction } from 'astro:actions'; import { z } from 'astro/zod'; export const server = { myAction: defineA...

Details

Author
fusengine
Repository
fusengine/agents
Created
6 months ago
Last Updated
2 days ago
Language
TypeScript
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category