More screenshots

    Works with the AI tools you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIGitHub CopilotGitHub CopilotGemini CLIGemini CLI+20 more

    Prisma Schema Safety Architect

    2

    Your agent generates a Prisma schema that compiles clean but drops your entire production database on the next...

    $5

    Secure checkout via Stripe

    30-day refund guarantee

    Converts to your local currency at checkout

    0 installsSecurity scanned
    prisma-schema-safety-architect

    prisma-schema-safety-architect

    Example session with this skill installed

    Review this Prisma schema for production safety.

    • Read your context and instructions
    • Compiled the prisma-schema-safety-architect
    • Generated the UI component

    Anti-Pattern Scan: 4 findings.

    1. User.email —

    Missing unique constraint. Concurrent signups create duplicate emails. Fix: email String @unique

    2. Post.authorId —

    Missing index. Every where: { authorId } does a full table scan. Fix: authorId Int @db.Integer + @@index([authorId])

    3. Comment → Post —

    Unsafe cascade. onDelete: Cascade destroys all comments when post is deleted. Fix: onDelete: Restrict

    4. User.balance —

    Unguarded concurrent write. Two requests read balance=100, both write 110 — money disappears. Fix: Add version Int @default(0) and use prisma.user.updateMany({ where: { id, version }, data: { balance: { increment: amount }, version: { increment: 1 } } })

    Pre-Migration Checklist: 9/9 passed after fixes applied.
    Schema is safe for migration.

    prisma-schema-safety-architect.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.

    What you get

    Reviewing an AI-generated Prisma schema before first migration to productionImplementing multi-tenant isolation with proper composite unique constraintsAdding soft delete with automatic query filtering via Prisma client extensionsSetting up optimistic locking for concurrent balance or inventory updatesCreating an immutable audit trail with Json-based change tracking

    About this skill

    Your agent generates a Prisma schema that compiles clean but drops your entire production database on the next migration. This skill catches the 12 anti-patterns before they become incidents.

    The Problem

    Your AI agent generates a Prisma schema with a User model (no unique on email), a Post model (no index on authorId), and onDelete: Cascade on the Comment→Post relation. The dev migration runs clean. You push to production and: (1) two users sign up simultaneously, creating duplicate emails with no constraint to catch them, (2) the Post list page takes 8 seconds because every query does a full table scan on authorId, (3) deleting a Post silently destroys all its Comments, including audit logs that legal requires you to retain. The schema "works" in isolation and fails under real conditions.

    What You Get

    • 12 anti-pattern detection — scans for missing unique constraints on business keys, unsafe cascading deletes, missing indexes on foreign keys, N+1 query patterns, unguarded concurrent writes (no optimistic locking), soft delete without query filters, enum drift, missing map annotations, optional relations that should be required, unbounded text fields, datetime without timezone handling, and the Prisma migration reset danger
    • 9-point pre-migration safety checklist — mandatory verification: backup exists, no prisma migrate reset on production, reversible migration, no data loss, safe index creation with CONCURRENTLY, valid foreign key constraints, default values provided, backward-compatible enum changes, and correct environment target
    • Production-grade schema patterns — multi-tenant isolation with tenantId and composite unique constraints, audit trail with immutable Json records and soft-delete preservation, optimistic locking with version fields and atomic updates, and soft delete with Prisma client extension auto-filtering
    • Emergency recovery procedures — step-by-step response for Prisma migration failures: stop, check status, restore from backup, mark migration resolved, post-mortem documentation
    • Schema review protocol — 6-step systematic review: read full schema, anti-pattern scan, index audit, relation audit, migration preview with prisma migrate diff, test on copy

    Why This Beats Prompting It Yourself

    When you ask an agent to "design a Prisma schema for users and posts," it generates syntactically correct code that compiles — but may omit the unique constraint on email (race condition), the index on authorId (N+1 query), or the onDelete: Restrict policy (cascade data loss). The 12 anti-pattern checklist catches these patterns because they're specific to Prisma's ORM behavior — Prisma does NOT auto-index foreign keys, prisma migrate dev can reset production databases, and onDelete: Cascade destroys audit logs silently. No general-purpose prompt encodes these Prisma-specific failure modes.

    Example Session

    You: Review this Prisma schema for production safety.

    Agent: Anti-Pattern Scan: 4 findings.

    1. User.email — Missing unique constraint. Concurrent signups create duplicate emails. Fix: email String @unique
    2. Post.authorId — Missing index. Every where: { authorId } does a full table scan. Fix: authorId Int @db.Integer + @@index([authorId])
    3. Comment → Post — Unsafe cascade. onDelete: Cascade destroys all comments when post is deleted. Fix: onDelete: Restrict
    4. User.balance — Unguarded concurrent write. Two requests read balance=100, both write 110 — money disappears. Fix: Add version Int @default(0) and use prisma.user.updateMany({ where: { id, version }, data: { balance: { increment: amount }, version: { increment: 1 } } })

    Pre-Migration Checklist: 9/9 passed after fixes applied. Schema is safe for migration.

    Use Cases

    • Reviewing an AI-generated Prisma schema before first migration to production
    • Implementing multi-tenant isolation with proper composite unique constraints
    • Adding soft delete with automatic query filtering via Prisma client extensions
    • Setting up optimistic locking for concurrent balance or inventory updates
    • Creating an immutable audit trail with Json-based change tracking

    Known Limitations

    The anti-pattern scanner works by pattern-matching Prisma schema syntax and cannot detect application-level issues like missing error handling for P2002 (unique constraint violation) in API routes. Schema-level safety is necessary but not sufficient — application code must also handle Prisma error codes correctly. The pre-migration checklist requires manual verification steps that cannot be fully automated.


    Tags: prisma database schema-design data-integrity race-condition typescript full-stack

    Version: 1.0.0

    How to install

    Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.

    ~30 seconds
    1. 1

      Download the ZIP

      Free skills download straight away. Paid skills unlock right after purchase.

    2. 2

      Unzip into your skills folder

      Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.

    3. 3

      Ask your agent to use it

      Restart the agent if it was already running. It picks the skill up automatically - no config needed.

    Skills folder by agent

    Click the path to copy it. Create the folder if it does not exist yet.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean 2 months ago

    • Passed all security checks, Safe to install

    Listed2 months ago
    Updated9 days ago

    What's inside

    Frequently Asked Questions