Skip to main content
skill CX Codex

safe-action-forms — Claude Code skill: forms and setup

This skill guides next-safe-action form integrations, from native HTML submission to React Hook Form, optimistic updates, and file uploads.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add next-safe-action/skills --skill safe-action-forms -a claude-code
Open on GitHub

What safe-action-forms does

The skill maps out ways to use next-safe-action with forms. It covers useAction, useStateAction, the React Hook Form adapter through useHookFormAction and useHookFormOptimisticAction, field-level validation errors, bound arguments, and uploads.

For a native form, the action can receive FormData through formAction, or the submit handler can build an input object before calling the action. The React Hook Form route connects a schema resolver, registered fields, and the action result. With useStateAction, the server action must use .stateAction(), while its input schema must parse FormData, such as with zfd.formData from zod-form-data.

The skill also points to material on native form patterns, the React Hook Form adapter, and file uploads. A project using useStateAction without .stateAction() will fail at this integration point.

What it helps with

  • connect next-safe-action to a native HTML form
  • render validation messages beside individual fields
  • wire React Hook Form to a server action
  • add optimistic updates to a form
  • handle bound arguments or file uploads

Example prompts for the agent

  • Connect next-safe-action to a contact form with useStateAction and render its validation errors.
  • Build a React Hook Form integration with useHookFormAction, a zod schema, and field messages.
  • Show how to handle a file upload with next-safe-action and choose the matching form submission pattern.

How to install safe-action-forms

1Skills CLI (Vercel)

npx skills add next-safe-action/skills --skill safe-action-forms -a claude-code

2Manually: put the files in place

~/.claude/skills/safe-action-forms/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/safe-action-forms/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about safe-action-forms

How do I install safe-action-forms in Claude Code?

Run npx skills add next-safe-action/skills --skill safe-action-forms -a claude-code, then check ~/.claude/skills/safe-action-forms/SKILL.md.

What does safe-action-forms do?

It explains how to connect next-safe-action with native forms and React Hook Form, including field errors, optimistic updates, bound arguments, and uploads.

What does useStateAction require?

The server action must be created with .stateAction(). Its input schema must parse FormData, for instance through zfd.formData from zod-form-data.

Similar skills

Everything for Frontend and UI →

From the same set6

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor