server-actions
Skill by davepoon
Guides an AI assistant through Server Actions and form handling in the Next.js App Router. It covers mutations, cache revalidation and related hooks for Next.js developers.
Install server-actions
Built from the published package, never by AI.
git clone --depth 1 https://github.com/davepoon/buildwithclaude /tmp/buildwithclaude && mkdir -p ~/.claude/skills && cp -r /tmp/buildwithclaude/plugins/nextjs-expert/skills/server-actions ~/.claude/skills/server-actionsRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/davepoon/buildwithclaude /tmp/buildwithclaude && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/buildwithclaude/plugins/nextjs-expert/skills/server-actions ~/.gemini/antigravity-cli/skills/server-actionsAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
The server-actions skill gives an AI assistant guidance on data mutations and form submissions in the Next.js App Router. It explains how to define Server Actions with the 'use server' directive, either inside Server Components or in separate files. It also shows basic form handling and validation with a Zod schema.
The skill covers the useFormState and useFormStatus hooks for form state and pending indicators. It also explains revalidatePath and revalidateTag for updating cached data, redirects after actions, optimistic updates with useOptimistic, and error handling. A short security section lists input validation and authorization checks. It is aimed at developers building Next.js apps who need mutation patterns.
Written from the project's SKILL.md and checked against it.
What it can do
- Define Server ActionsShows how to create Server Actions in Server Components or in separate files using 'use server'.
- Form handlingExplains basic form submissions and input validation with a Zod schema.
- useFormState hookDescribes handling form state and errors with useFormState.
- useFormStatus hookDescribes showing loading states during form submission with useFormStatus.
- RevalidationCovers revalidatePath and revalidateTag for refreshing cached data after mutations.
- Redirects after actionsShows how to redirect the user to another route after a Server Action runs.
- Optimistic updatesShows updating the UI immediately with useOptimistic while an action completes.
- Error handlingShows returning error messages from a Server Action when a database write fails.
- Security checksLists input validation, authentication and authorization checks for Server Actions.
What you need
- Next.js App Router project
Try asking
- Show me how to create a Server Action for a contact form in Next.js.
- How do I use useFormState to show validation errors after a form submit?
- When should I use revalidatePath versus revalidateTag in Next.js?
Good to know
- Examples use placeholder code such as db.post.create and createUser that the reader must provide.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: plugins/nextjs-expert/skills/server-actions/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md7 KB -
examples/mutation-patterns.md13 KB -
references/form-handling.md12 KB -
references/revalidation.md9 KB
Alternatives to server-actions
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
server-actions: common questions
What is a Next.js Server Action?
The skill describes Server Actions as asynchronous functions that run on the server. They can be called from Client and Server Components for mutations and form submissions.
Does this skill cover the Next.js Pages Router?
The source only describes Next.js App Router usage. It does not mention the Pages Router.
How does the skill handle cache updates after a mutation?
It explains revalidatePath for specific paths and revalidateTag for fetches tagged with next.tags. Both are shown inside Server Actions.
How do I install server-actions?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is server-actions free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is server-actions safe to use?
It scores 87 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to server-actions?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
