Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Prisma Pro

ASecurity

Prisma ORM mastery — schema design, migrations, and query optimization — use when building with Prisma.

2 stars
0 votes
0 copies
1 views
Added 9/29/2026
ai-agentstypescriptgosqlnodedebuggingdatabaseperformance

Works with

cursorcli

Security Analysis

A100/100

Scanned 9/29/2026

$npx -y skills add aicodedecode/awesome-muse-skills --skill prisma-pro --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Prisma Pro?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Prisma Pro
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aicodedecode-prisma-pro/badge)](https://www.skillsdirectory.com/skills/aicodedecode-prisma-pro)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: prisma-pro
description: Prisma ORM mastery — schema design, migrations, and query optimization — use when building with Prisma.
category: database
---

## Overview

Prisma is a type-safe ORM for Node.js/TypeScript (with growing language support)
covering schema definition, migrations, and a fluent query client. Its strength
is end-to-end type safety from database to application code. This skill covers
schema modeling, migration workflows, and getting performant queries out of the
client.

## When to use

- Designing `schema.prisma` models, relations, and enums
- Running migrations (`migrate dev`, `migrate deploy`, baselining)
- Writing efficient Prisma Client queries (select/include, pagination)
- Debugging N+1 queries, slow queries, or migration drift
- Using Prisma in serverless/edge runtimes (Accelerate, driver adapters)

## Core concepts

**The schema is the contract.** Models, fields, relations, and attributes in
`schema.prisma` generate both migrations and the type-safe client. Keep it as
the single source of truth — don't hand-edit the database and hope the schema
catches up.

**Relations are explicit.** One-to-many, many-to-many (implicit or explicit join
model — explicit when the join needs attributes), and one-to-one each have
relation syntax with `fields`/`references`. Understand relation load strategies:
`include` (joins / batched queries) vs `select` (field whitelisting). Default to
`select` with only needed fields — over-fetching is the quiet performance killer.

**Migrations are versioned SQL.** `prisma migrate dev` generates SQL from schema
diffs; review the generated SQL before applying, especially for destructive
changes (dropped columns, type changes). `migrate deploy` applies pending
migrations in production — never `migrate dev` against prod. Baseline existing
databases with `--baseline` instead of faking history.

**N+1 is still possible.** Loops calling `findUnique` per item generate N+1
queries — batch with `findMany({ where: { id: { in: ids } } })` or use nested
`include`. Enable query logging in development to see the actual SQL.

**Connection management matters.** Prisma opens a connection pool per client
instance; in serverless, create one shared client (global singleton pattern)
and consider a pooler (PgBouncer) or Prisma's Accelerate/driver adapters to
avoid connection exhaustion.

## Practical workflow

1. **Model deliberately:** map entities to models, choose relation shapes,
   add `@@index` for FK/query patterns, `@@unique` for natural keys, and
   database-level defaults (`@default(now())`, `@db` type mappings).
2. **Migrate in dev:** `prisma migrate dev --name descriptive_name`; read the
   generated SQL; test the migration against realistic data (especially
   backfills and non-null additions).
3. **Query with intent:** `select` minimal fields, paginate with cursor-based
   (`cursor` + `take`, ordered by unique key) rather than `skip` for large
   datasets, and batch with `$transaction` for atomic multi-writes.
4. **Inspect generated SQL** (`log: ['query']` in dev or the `query` event) when
   performance matters; add missing indexes at the schema level.
5. **Seed reproducibly** (`prisma/seed.ts`) so every environment starts from
   known data; keep seeds idempotent.
6. **Deploy:** run `prisma migrate deploy` in the release step (before the new
   code serves traffic), keep migrations expand-contract compatible, and have
   a rollback plan (forward migration, not `migrate resolve` hacks).

## Common pitfalls

- **`include` without `select` on huge relations** — fetches entire related
  tables; always narrow with `select` or paginate relations.
- **Drift between schema and database** (manual DB edits) — `prisma migrate
  diff` / `db pull` to detect; resolve by aligning schema → migration → DB.
- **Editing a migration file after it's applied** — history must be immutable;
  write a new migration instead.
- **Offset pagination (`skip`/`take`) on large tables** — same cost as SQL
  `OFFSET`; use cursor pagination for feeds and infinite scroll.
- **One PrismaClient per request** in serverless — exhausts connections;
  singleton pattern + external pooler.
- **Cascading deletes by accident** (`onDelete: Cascade` on the wrong side) —
  deleting one row wipes related data; choose `Restrict`/`SetNull` deliberately
  and document the choice.

Attribution

aicodedecodeaicodedecode
View sourceSee grades on GitHubMore from aicodedecode →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698621 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →