More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Next.js 15 Server Action Validator

    1

    Free 5-point audit for Next.js 15 Server Actions. Checks for swallowed redirects, raw error leaks, missing auth, and Zod validation gaps before they hit production.

    Free

    Security scanned
    Next.js 15 Server Action Validator

    Next.js 15 Server Action Validator

    Example session with this skill installed

    Review this Server Action for production issues:

    'use server'

    import { prisma } from '@/lib/db'
    import { redirect } from 'next/navigation'
    export async function updateProfile(formData: FormData) {
      try {
        const name = formData.get('name')
        await prisma.user.update({
          where: { id: 'user_123' },
          data: { name: String(name) }
        })
        redirect('/profile')
      } catch (e) {
        return { error: e.message }
      }
    }
    
    • Read your context and instructions
    • Compiled the next js 15
    • Generated the document

    Audit Summary

    Passed 1/5 checks. This Server Action has critical security and functionality flaws that will fail in production.

    CheckStatusWhy it matters
    1. Redirect Trap❌ Failredirect('/profile') is inside the try block. The catch block will swallow the redirect error. The user will never be redirected.
    2. Error Leakage❌ Failreturn { error: e.message } will leak your Prisma schema and database structure to the client.
    3. Validation❌ FailformData.get('name') is cast to string without Zod validation. A user could send an empty string or a 10MB payload.
    4. Auth Check❌ FailThere is no auth() check. Anyone can call this action and update user_123.
    5. Cache Invalidation❌ FailMissing revalidatePath('/profile'). The UI will show stale data after the update.

    Corrected Code

    'use server'
    import { prisma } from '@/lib/db'
    import { redirect, unstable_rethrow } from 'next/navigation'
    import { auth } from '@/lib/auth'
    import { z } from 'zod'
    import { revalidatePath } from 'next/cache'
    
    const schema = z.object({ name: z.string().min(1).max(50) })
    
    export async function updateProfile(formData: FormData) {
      // 4. Auth Check
      const session = await auth()
      if (!session?.user) throw new Error('Unauthorized')
    
      try {
        // 3. Validation
        const parsed = schema.parse({ name: formData.get('name') })
    
        await prisma.user.update({
          where: { id: session.user.id },
          data: { name: parsed.name }
        })
    
        // 5. Cache Invalidation
        revalidatePath('/profile')
      } catch (e: any) {
        // 1. Do not swallow redirects/notFound
        unstable_rethrow(e)
    
        // 2. Safe error message
        return { error: 'Failed to update profile. Please try again.' }
      }
    
      // Move redirect OUTSIDE the try/catch
      redirect('/profile')
    }
    **Next steps**
    This fixes the immediate bugs. If you need the full production-grade architecture (Prisma connection pool timeouts, retry logic, and proper error.tsx routing), check out my paid skill **Next.js 15 + Prisma Error Architect** on my profile.
    

    error.tsx

    PDF · document

    Generated

    Example file from a real run - the skill writes it into your workspace.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    The Problem

    Server Actions in Next.js 15 are public API endpoints. Generic AI writes them with a standard try/catch and return e.message. This works in a tutorial, but in production it leads to three disastrous bugs:

    1. Swallowed redirects — redirect() throws a special error. If you catch it, the redirect fails silently.
    2. Schema leaks — Returning e.message exposes your Prisma errors and internal logic to the user.
    3. Security bypass — Not validating FormData or checking auth inside the action allows anyone to mutate your database.

    What this skill does

    This is a free validator. When you ask your agent to review a Server Action, it applies a strict 5-point audit:

    1. The Redirect Trap — Ensures redirect() isn’t swallowed by try/catch.
    2. Error Sanitization — Prevents raw database errors from leaking to the client.
    3. Input Validation — Forces Zod (or similar) validation on raw FormData.
    4. Auth Verification — Ensures session checks happen inside the Action.
    5. Cache Invalidation — Checks for revalidatePath() after mutations.

    It outputs a Pass/Fail table and the corrected, production-ready code.

    Why is this free?

    Because this validator catches the surface-level mistakes.

    If you want the deep, production-grade architecture for handling Prisma connection pool timeouts, exponential backoff retries, and complex RSC error boundaries, check out my paid skill on my profile: Next.js 15 + Prisma Error Architect.

    Ideal for

    • Developers moving from Pages Router to App Router
    • Anyone building forms with Server Actions
    • Teams doing code reviews

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Frontend & Web Apps.

    Known Limitations

    • Only works with Next.js App Router Server Actions that start with 'use server'. It will not audit Pages Router, Route Handlers (route.ts), or Client Components.
    • Does not perform deep Prisma / database-layer analysis (connection pool timeouts, retry logic, transaction safety, etc.). Those are covered in the paid Error Architect skill.
    • Relies on the code the user pastes. It cannot scan your full project or detect issues outside the provided function.
    • Suggests Zod for validation, but does not install packages or modify your package.json.
    • The soft CTA points to the paid skill for advanced error handling. This free version stays focused on the 5 most common surface-level mistakes.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 12 days ago

    • Free with an Agensi account

    Permissions

    File Scopes

    app/**
    components/**
    lib/**

    This skill only reads the Server Action code the user pastes. It does not write files, run terminal commands, or access the network.text

    Listed12 days ago

    What's inside

    Frequently Asked Questions

    This skill focuses exclusively on the Next.js 15 App Router and 'use server' functions; it does not support the older Pages Router, standard API Route Handlers, or client-side components.

    It specifically solves the common bug where `redirect()` fails inside `try/catch` blocks, while also identifying unvalidated FormData, missing revalidation calls, and accidental leakage of sensitive database schemas.

    The skill delivers a detailed 5-point audit report, a pass/fail status table for each security and logic check, and a fully refactored code snippet ready for implementation.

    Yes, the agent is optimized to check for session-based access control and can provide recommendations specifically for Next Auth or Auth.js integration within your action logic.

    Standard LLMs often suggest wrapping actions in broad `try/catch` blocks, which inadvertently breaks Next.js internal redirect mechanisms; this skill is pre-configured with these framework-specific nuances to prevent such runtime errors.

    Yes. It’s a free lead magnet that surfaces the common mistakes so developers discover the deeper paid Error Boundary Architect skill.

    No. It is strictly for App Router Server Actions that start with 'use server'.

    New in Frontend & Web Apps

    Free