More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Next.js 15 + Prisma Error Architect

    2

    Production-grade error boundary architecture for Next.js 15 App Router + Prisma. Maps Prisma codes to safe messages, adds smart retries, and enforces correct error.tsx patterns so raw errors never reach users.

    $15

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Next.js 15 + Prisma Error Architect

    Next.js 15 + Prisma Error Architect

    Example session with this skill installed

    I'm getting this error in production on my Next.js 15 App Router dashboard:

    Unhandled error in Server Component render
    Segment: /app/dashboard/orders/page.tsx
    Error: PrismaClientKnownRequestError
    code: 'P2024'
    message: 'Timed out fetching a new connection from the connection pool.'
    (pool size: 5, timeout: 10s)
    Digest: 2847193021

    The raw message is showing to users. How do I fix this properly?

    • Read your context and instructions
    • Compiled the next js 15
    • Generated the UI component

    Diagnosis
    Server Component render error caused by Prisma connection pool timeout (P2024). The nearest boundary should be app/dashboard/error.tsx.

    Root cause
    The query is not wrapped in a retry helper and the raw Prisma message is leaking to the client.

    Fix

    // lib/db-retry.ts

    const RETRYABLE = new Set(['P2024', 'P1001', 'P1017']);
    
    export async function withDbRetry<T>(fn: () => Promise<T>, maxAttempts = 3): Promise<T> {
      let lastErr: unknown;
      for (let i = 0; i < maxAttempts; i++) {
        try {
          return await fn();
        } catch (e: any) {
          lastErr = e;
          if (!RETRYABLE.has(e?.code)) throw e;
          await new Promise(r => setTimeout(r, 100 * 3 ** i));
        }
      }
      throw lastErr;
    }
    

    // Usage

    const orders = await withDbRetry(() =>
      prisma.order.findMany({ where: { userId } })
    );
    

    Safe message mapping
    P2024 → “Server is busy. Please try again in a moment.”

    Boundary placement
    Create or update app/dashboard/error.tsx (must include 'use client'). Show the digest as a reference for support tickets.

    Prisma mapping

    • Code: P2024
    • User message: Server is busy. Please try again in a moment.
    • Retry: Yes (3 attempts with 100/300/900ms backoff)

    Checklist confirmation
    Items 2, 4, 5 and 7 from the pre-deploy checklist apply and must be verified before shipping.

    This turns a typical 40-minute production firefight into a structured 6-minute fix.

    error.tsx

    TSX · React component

    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

    Stop leaking raw Prisma errors and stack traces to your users in Next.js 15.

    This skill gives your agent a complete production error-handling system for App Router + Prisma projects. It classifies the error origin, maps Prisma codes (P2002, P2024, P1001, P1017 and more) to safe user-facing messages, applies the correct retry policy, and forces the proper boundary (error.tsx, global-error.tsx, or client boundary).

    What the skill does

    • Diagnoses whether the error came from a Server Component, Server Action, or Route Handler
    • Maps every common Prisma error code to a clean, non-leaking message
    • Adds exponential-backoff retry for connection pool and transient DB errors
    • Tells you exactly which file and segment needs the boundary
    • Enforces a 7-item pre-deploy checklist so nothing ships incomplete

    Hard rules the skill never breaks

    • Never recommends try/catch inside Server Component render bodies
    • Never lets raw Prisma messages or stack traces reach the client
    • Never swallows redirect() or notFound() without unstable_rethrow
    • Always distinguishes Server Component errors from Server Action results

    Includes three reference files (error map, RSC fallback patterns, pre-deploy checklist) and a real anonymized production log showing before/after impact (40 min → 6 min resolution).

    Ideal for agencies, senior freelancers, and teams shipping Next.js 15 apps that use Prisma.

    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.

    Limits of this skill

    • Only works with Next.js 15 App Router (does not support Pages Router)
    • Only designed for Prisma (does not support Drizzle, Kysely, TypeORM, or raw SQL)
    • Does not handle tRPC or GraphQL error patterns
    • Does not cover pure client-side React errors
    • Does not handle authentication/authorization errors (NextAuth, Clerk, etc.)
    • Does not cover rate limiting or 429 errors
    • Does not configure infrastructure (only suggests pool size and PgBouncer)
    • Does not integrate with logging tools (Sentry, LogRocket, etc.)
    • Does not fix TypeScript or build errors

    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

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 14 days ago

    Permissions

    Read Files
    Listed14 days ago

    What's inside

    Frequently Asked Questions

    It specializes in the Next.js 15 App Router and Prisma ORM, specifically solving issues like 'swallowed' redirects, database schema leaks in the browser, and silent failures during React Server Component streaming.

    Yes, it is built for React 19 semantics and Next.js 15, ensuring that internal functions like 'redirect()' and 'notFound()' work correctly within your try/catch blocks using 'unstable_rethrow'.

    While it provides the architectural logic for global-error.tsx and segment-level boundaries, it focuses on the data-layer logic, Prisma error mapping, and TypeScript-typed Server Action responses.

    The skill is optimized for LLMs capable of handling complex TypeScript architectures (such as Claude 3.5 Sonnet or GPT-4o) and integrates directly into your existing Next.js 15 and Prisma workflow.

    No, this skill is strictly specialized for Prisma ORM codes (like P2002 or P2024); it does not currently support Drizzle, Kysely, or the legacy Next.js Pages Router.

    You receive the full architectural logic, a pre-deploy checklist for sanitizing stack traces, and a comprehensive mapping system for converting Prisma engine errors into safe, user-facing notifications.

    No. It is specifically written for Next.js 15 App Router.

    No. It is Prisma-specific. Use a different skill for other ORMs.

    The skill will tell you exactly what to change and where.

    New in Frontend & Web Apps