neuro-prisma-db

Designs Prisma schemas, optimizes PostgreSQL queries, and writes safe migrations for multi-tenant applications.

Updated Apr 18, 2026
One-click install
npx skills add https://github.com/webdevarif/claude-skills --skill neuro-prisma-db-webdevarif
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: neuro-prisma-db
Source: https://github.com/webdevarif/claude-skills/tree/main/neuro-prisma-db
Command: npx skills add https://github.com/webdevarif/claude-skills --skill neuro-prisma-db-webdevarif

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building and maintaining a Prisma/PostgreSQL database layer involves recurring pitfalls: N+1 queries, unsafe migrations that cause downtime, missing indexes, connection leaks in serverless environments, and inconsistent multi-tenant data isolation. This Skill provides production-tested patterns for schema design, query optimization, migrations, and tenant isolation so these mistakes are avoided from the start. ## Core Features & Use Cases - Schema Design for Multi-Tenant SaaS: Model templates with tenant-scoped unique constraints, audit fields, soft-delete, self-referencing relations, and explicit many-to-many join tables. - Query Optimization: N+1 detection and prevention with include/select, composite index ordering rules, partial and GIN indexes via raw SQL, and slow-query logging extensions. - Zero-Downtime Migrations: Expand-contract patterns, CREATE INDEX CONCURRENTLY, and clear lists of dangerous operations to avoid in production. - Use Case: When adding a new Orders feature to a multi-tenant store, the Skill reads the existing schema, follows its ID and indexing conventions, adds tenant-scoped models with proper relations, and generates a safe migration. ## Quick Start Ask the assistant to review your prisma/schema.prisma and add a new tenant-scoped model with proper indexes and a safe migration.

Frequently Asked Questions about neuro-prisma-db

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent N+1 queries in Prisma?

Use include or select to eager-load relations in a single query instead of looping with individual findMany calls. Enable query logging in development to detect slow or repeated queries, and prefer select over include to fetch only needed fields.

How to rename a column in Prisma without downtime?

Use the expand-contract pattern: add the new column in one migration, backfill data from the old column, deploy code that reads the new column, then drop the old column in a later migration. Never rename directly, as deployed code will break.

Should I use Prisma enum or String for status fields?

Use String with application-level validation (e.g., Zod) for values that may grow, such as status or category, since adding enum values requires a migration. Reserve Prisma enums for truly fixed sets like user roles.

Does Prisma work with serverless platforms like Vercel?

Yes, but use a connection pooler such as PgBouncer with connection_limit=1 in the pooled DATABASE_URL, and configure a separate directUrl for migrations. Also use the global singleton pattern to avoid creating multiple PrismaClient instances.

Why should I avoid autoincrement IDs in multi-tenant apps?

Autoincrement IDs are predictable and leak record counts across tenants. Use cuid() or uuid() defaults instead, which are collision-resistant, non-sequential, and safe to expose in URLs.

When should I use cursor-based vs offset pagination in Prisma?

Use cursor-based pagination for large or growing datasets since it stays fast regardless of position. Offset pagination with skip is simpler and fine for small datasets, but degrades as the offset grows.