Skip to main content
skill CX Codex

safe-action-advanced — Claude Code skill: use and install

This skill covers advanced next-safe-action patterns for bound inputs, metadata, framework errors, inferred types, and server callbacks.

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

What safe-action-advanced does

The skill covers extra values passed to actions with .bind(), typed metadata for middleware, and the InferSafeActionFnInput and InferSafeActionFnResult helpers. It also explains how actions can handle redirect, notFound, forbidden, and unauthorized.

A separate section describes the callbacks accepted by .action(): onSuccess, onError, onSettled, and onNavigation. These run on the server, while callbacks supplied to useAction belong to the browser. The material also separates throwServerError from returnServerError().

Server callbacks run in Node.js, so browser hook behavior should not be assumed for this part of an action.

What it helps with

  • pass extra values to an action with .bind()
  • attach typed metadata for middleware
  • handle redirect, notFound, forbidden, and unauthorized
  • derive types from action functions and middleware
  • configure server callbacks for success and failure

Example prompts for the agent

  • Show how to pass a resourceId into an action with .bind() while keeping the types intact.
  • Set up onSuccess, onError, and onSettled in the second argument of .action().
  • Explain when to use throwServerError instead of returnServerError() for a handled error.

How to install safe-action-advanced

1Skills CLI (Vercel)

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

2Manually: put the files in place

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

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

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

Questions about safe-action-advanced

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

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

What does safe-action-advanced do?

It explains bound action arguments, typed metadata, framework errors, type inference helpers, and callbacks that run on the server.

Where do the .action() callbacks run?

They run on the server in Node.js. The callbacks passed to useAction run in the browser instead.

Similar skills

All skills for Backend and APIs →

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