prisma — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited prisma (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Ensures Prisma code is type-safe, performant, and architecturally clean — covering the non-obvious patterns that trip up even experienced developers.
enums.ts in client/shared code; import from client.ts only in server-side code. Never import client.ts in client components.$transaction.The hot-reload guard is required in Next.js — without it, dev mode creates a new PrismaClient on every file change and exhausts connections:
// lib/prisma.ts
import { PrismaClient } from "@prisma/client";
const globalForPrisma = globalThis as unknown as { prisma: PrismaClient };
export const prisma =
globalForPrisma.prisma ?? new PrismaClient();
if (process.env.NODE_ENV !== "production")
globalForPrisma.prisma = prisma;// ✅ Client component or shared validation code
import { Role, Status } from "@prisma/client/enums";
// ✅ Server-side only (API routes, server components, background jobs)
import { prisma } from "@/lib/prisma";
import type { User } from "@prisma/client";
// ❌ Never in client components
import { PrismaClient } from "@prisma/client";@relation.deletedAt DateTime? — never hard-delete records that may be referenced.include or select instead of looping with separate queries.take and skip; add a cursor-based approach for large datasets.select to fetch only needed fields; avoid over-fetching with blanket include.relationLoadStrategy ("join" or "query") is available but requires enabling the relationJoins preview feature flag. "join" uses a single LATERAL JOIN; "query" sends one query per table and joins at the application level.Catch Prisma-specific errors at the repository boundary:
PrismaClientKnownRequestError — structured DB errors. Check error.code:P2002 — unique constraint violationP2025 — record not found (replaces the removed NotFoundError from Prisma 5)PrismaClientUnknownRequestError — unstructured DB errorsPrismaClientValidationError — invalid query shape (usually a type error)Provide user-friendly messages upstream; log the full error with context for debugging.
prisma migrate dev --name add_user_email_index.enums.ts in any client or shared code?$transaction?PrismaClientKnownRequestError codes handled at the repository boundary?~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.