# next-server-actions > Build typed Server Actions for forms and mutations. - Author: Adam Winick - Repository: sinelanguage/cursor-config-nextjs - Version: 20260202191819 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/sinelanguage/cursor-config-nextjs - Web: https://mule.run/skillshub/@@sinelanguage/cursor-config-nextjs~next-server-actions:20260202191819 --- --- name: next-server-actions description: Build typed Server Actions for forms and mutations. disable-model-invocation: true --- # Next.js Server Actions Create Server Actions for form submissions and mutations with explicit validation and security. ## When to Use - Mutations co-located with App Router pages - Forms requiring server-side validation - CSRF protection requirements ## Inputs - Form fields and validation rules - Redirect or revalidation behavior - CSRF strategy (token or double-submit cookie) ## Instructions 1. Create a Server Action in the route or `actions` module. 2. Validate inputs on the server. 3. Enforce CSRF protection for state-changing actions. 4. Return typed results and handle errors. 5. Use revalidation (`revalidatePath`/`revalidateTag`) if needed. ## Output - Server Action with validation, CSRF controls, and typed results.