Agent skill · Databases

prisma-patterns

Prisma ORM patterns for TypeScript backends — schema design, query optimization, transactions, pagination, and critical traps like updateMany returning count not records, $transaction timeouts, migrate dev resetting the DB, @updatedAt skipped on bulk writes, and serverless connection exhaustion.

mturacgithub.com/mturacGitHub ↗
codexcopilotcursorMIT
Install
npx skills add mturac/everything-openai-codex --skill prisma-patterns --agent codex

Same command for any agent — swap --agent for claude-code, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 13 KB
Bundled scripts: none
Path: skills/prisma-patterns/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 84
Language: JavaScript

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Prisma Patterns Production patterns and non-obvious traps for Prisma ORM in TypeScript backends. Tested against Prisma 5.x and 6.x. Some behaviors differ from Prisma 4. Check the Prisma version before applying version-specific patterns: ```bash npx prisma --version ``` Prisma 5 introduced `relationJoins`, which can load relations via JOIN rather than separate queries depending on query strategy and configuration. The `omit` field modifier and `prisma.$extends` Client Extensions API were also added. Note: `relationJoins` can cause row explosion on large 1:N relations or deep nested `include` — benchmark both approaches when relations may return many rows per parent. ## When to Activate - Designing or modifying Prisma schema models and relations - Writing queries, transactions, or pagination logic - Using `updateMany`, `deleteMany`, or any bulk operation - Running or planning database migrations - Deploying to serverless environments (Vercel, Lambda, Cloudflare Workers) - Implementing soft delete or multi-tenant row filtering ## Core Concepts ### ID Strategy | Strategy | Use When | Avoid When | |---|---|---| | `@default(cuid())` | Default choice — URL-safe, sortable, no collisions

What's inside
Steps it walks through
  1. When to Activate
  2. Core Concepts
  3. ID Strategy
  4. Schema Defaults
  5. include vs select
  6. Transaction Form Selection
  7. PrismaClient Singleton
  8. N+1 Problem
  9. Code Examples
  10. Cursor Pagination (preferred for feeds and large datasets)
  11. Soft Delete
  12. Error Handling
  13. Connection Pool — Serverless
  14. Anti-Patterns
Commands it runs
npx prisma --version
With an external pooler (PgBouncer, Supabase pooler)
NEVER on shared dev, staging, or production
npx prisma migrate dev --name add_column
Safe everywhere except local solo dev
npx prisma migrate deploy
Check drift without applying
npx prisma migrate diff \
Step 1: create migration locally, then deploy
npx prisma migrate dev --name add_new_column   # local only
More from everything-openai-codex
All skills →
About this skill
What does the prisma-patterns skill do?

Prisma ORM patterns for TypeScript backends — schema design, query optimization, transactions, pagination, and critical traps like updateMany returning count not records, $transaction timeouts, migrate dev resetting the DB, @updatedAt skipped on bulk writes, and serverless connection exhaustion.

How do I install it?

Run `npx skills add mturac/everything-openai-codex --skill prisma-patterns --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From mturac/everything-openai-codex, a repository with 84 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going