Agent Native

prisma-client-api

Prisma Client API reference skill provides guidance on database queries, CRUD operations, filtering, relations, transactions, and raw SQL queries for Prisma…

by PrismaOfficial publisher

Identity proven by GitHub's verified organisation badge (prisma)

Agents
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, claude.ai and API
License
MIT (permissive)
Pin
be16a87pinned Oct 9, 2026
Context cost
about 1,500 tokenswhen the skill loads
GitHub stars
67on prisma/skills
Scripts
None found

What it does

“Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete", "$transaction".”
The author's description, from SKILL.md

Generated summary from the skill's own text

Prisma Client API reference skill provides guidance on database queries, CRUD operations, filtering, relations, transactions, and raw SQL queries for Prisma projects. It covers model query methods, query options, filter operators, and client lifecycle methods to help write database code correctly.

When to use it

  • Writing Prisma Client database queries and CRUD operations
  • Filtering, sorting, and paginating data in Prisma queries
  • Working with relations and nested writes in Prisma models
  • Implementing transactions and raw SQL queries safely

When not to

  • Building schema definitions or migrations with Prisma migrations
  • Learning Prisma setup or installation from scratch
  • Troubleshooting database connection issues or adapter configuration

Install

These commands install from the publisher's repository and need no account.

skills CLI

npx skills add prisma/skills --skill prisma-client-api

Installs from the repository's default branch, which may have changed since the commit we checked.

GitHub CLI 2.90 or later

gh skill install prisma/skills prisma-client-api@be16a8740d01363d13552b317042431ee8dfc581

Installs the commit we checked (be16a87).

Copy by hand

Download the folder at be16a87 and put it in .claude/skills/prisma-client-api for Claude Code and in .agents/skills/prisma-client-api for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.

Skill folder on GitHub at be16a87

Copy for your agent

A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.

Prompt

Install the agent skill "prisma-client-api" by Prisma.

Source, pinned to commit be16a8740d01363d13552b317042431ee8dfc581:
https://github.com/prisma/skills/tree/be16a8740d01363d13552b317042431ee8dfc581/prisma-client-api

1. Download that folder at exactly this commit. Do not use the default branch.
2. Copy every file unchanged, keeping the folder structure, into .claude/skills/prisma-client-api/ for Claude Code and .agents/skills/prisma-client-api/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist.
3. Do not edit the files, and do not run any script in the folder unless I ask you to.
4. When you are done, list the files you copied and where you put them.

Listing and checks: https://www.agentnative.dev/skills/prisma/prisma-client-api

SKILL.md at the pin

---
name: prisma-client-api
description: Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete", "$transaction".
license: MIT
metadata:
  author: prisma
  version: "7.9.1"
---

# Prisma Client API Reference

Complete API reference for Prisma Client. This skill provides guidance on model queries, filtering, relations, and client methods for current Prisma projects.

## When to Apply

Reference this skill when:
- Writing database queries with Prisma Client
- Performing CRUD operations (create, read, update, delete)
- Filtering and sorting data
- Working with relations
- Using transactions
- Configuring client options

## Rule Categories by Priority

| Priority | Category | Impact | Prefix |
|----------|----------|--------|--------|
| 1 | Client Construction | HIGH | `constructor` |
| 2 | Model Queries | CRITICAL | `model-queries` |
| 3 | Query Shape | HIGH | `query-options` |
| 4 | Filtering | HIGH | `filters` |
| 5 | Relations | HIGH | `relations` |
| 6 | Transactions | CRITICAL | `transactions` |
| 7 | Raw SQL | CRITICAL | `raw-queries` |
| 8 | Client Methods | MEDIUM | `client-methods` |

## Quick Reference

- `constructor` - `PrismaClient` setup, adapter wiring, logging, and SQL commenter plugins
- `model-queries` - CRUD operations and bulk operations
- `query-options` - `select`, `include`, `omit`, sort, pagination
- `filters` - scalar and logical filter operators
- `relations` - relation reads and nested writes
- `transactions` - array and interactive transaction patterns
- `raw-queries` - `$queryRaw` and `$executeRaw` safety
- `client-methods` - lifecycle methods, extensions, and `satisfies` patterns for `prisma-client`

## Client Instantiation

```typescript
import { PrismaClient } from '../generated/client'
import { PrismaPg } from '@prisma/adapter-pg'

const adapter = new PrismaPg({
  connectionString: process.env.DATABASE_URL
})

const prisma = new PrismaClient({ adapter })
```

## Model Query Methods

| Method | Description |
|--------|-------------|
| `findUnique()` | Find one record by unique field |
| `findUniqueOrThrow()` | Find one or throw error |
| `findFirst()` | Find first matching record |
| `findFirstOrThrow()` | Find first or throw error |
| `findMany()` | Find multiple records |
| `create()` | Create a new record |
| `createMany()` | Create multiple records |
| `createManyAndReturn()` | Create multiple and return them |
| `update()` | Update one record |
| `updateMany()` | Update multiple records |
| `updateManyAndReturn()` | Update multiple and return them |
| `upsert()` | Update or create record |
| `delete()` | Delete one record |
| `deleteMany()` | Delete multiple records |
| `count()` | Count matching records |
| `aggregate()` | Aggregate values (sum, avg, etc.) |
| `groupBy()` | Group and aggregate |

## Query Options

| Option | Description |
|--------|-------------|
| `where` | Filter conditions |
| `select` | Fields to include |
| `include` | Relations to load |
| `omit` | Fields to exclude |
| `orderBy` | Sort order |
| `take` | Limit results |
| `skip` | Skip results (pagination) |
| `cursor` | Cursor-based pagination |
| `distinct` | Unique values only |

## Client Methods

| Method | Description |
|--------|-------------|
| `$connect()` | Explicitly connect to database |
| `$disconnect()` | Disconnect from database |
| `$transaction()` | Execute transaction |
| `$queryRaw()` | Execute raw SQL query |
| `$executeRaw()` | Execute raw SQL command |
| `$on()` | Subscribe to events |
| `$extends()` | Add extensions |

## Quick Examples

### Find records

```typescript
// Find by unique field
const user = await prisma.user.findUnique({
  where: { email: 'alice@prisma.io' }
})

// Find with filter
const users = await prisma.user.findMany({
  where: { role: 'ADMIN' },
  orderBy: { createdAt: 'desc' },
  take: 10
})
```

### Create records

```typescript
const user = await prisma.user.create({
  data: {
    email: 'alice@prisma.io',
    name: 'Alice',
    posts: {
      create: { title: 'Hello World' }
    }
  },
  include: { posts: true }
})
```

### Update records

```typescript
const user = await prisma.user.update({
  where: { id: 1 },
  data: { name: 'Alice Smith' }
})
```

### Delete records

```typescript
await prisma.user.delete({
  where: { id: 1 }
})
```

### Transactions

```typescript
const [user, post] = await prisma.$transaction([
  prisma.user.create({ data: { email: 'alice@prisma.io' } }),
  prisma.post.create({ data: { title: 'Hello', authorId: 1 } })
])
```

## Rule Files

Detailed API documentation:

```
references/constructor.md        - PrismaClient constructor options
references/model-queries.md      - CRUD operations
references/query-options.md      - select, include, omit, where, orderBy
references/filters.md            - Filter conditions and operators
references/relations.md          - Relation queries and nested operations
references/transactions.md       - Transaction API
references/raw-queries.md        - $queryRaw, $executeRaw
references/client-methods.md     - $connect, $disconnect, $on, $extends
```

## Filter Operators

| Operator | Description |
|----------|-------------|
| `equals` | Exact match |
| `not` | Not equal |
| `in` | In array |
| `notIn` | Not in array |
| `lt`, `lte` | Less than |
| `gt`, `gte` | Greater than |
| `contains` | String contains |
| `startsWith` | String starts with |
| `endsWith` | String ends with |
| `mode` | Case sensitivity |

## Relation Filters

| Operator | Description |
|----------|-------------|
| `some` | At least one related record matches |
| `every` | All related records match |
| `none` | No related records match |
| `is` | Related record matches (1-to-1) |
| `isNot` | Related record doesn't match |

## Resources

- [Prisma Client API Reference](https://www.prisma.io/docs/orm/reference/prisma-client-reference)
- [CRUD Operations](https://www.prisma.io/docs/orm/prisma-client/queries/crud)
- [Filtering and Sorting](https://www.prisma.io/docs/orm/prisma-client/queries/filtering-and-sorting)

## How to Use

Pick the category from the table above, then open the matching reference file for implementation details and examples.

From prisma/skills at be16a87, shown as plain text under its license: MIT (permissive). The license text is in prisma-client-api/SKILL.md.

View SKILL.md on GitHub at be16a87

Files

9 files, 40 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.

Skill folder on GitHub at be16a87
All 44 skills from Prisma

More from Prisma

  • prisma-8

    This skill helps agents work with Prisma 8, a contract-first data layer for TypeScript projects.

    Contains scripts

    Claude Code, Codex, Cursor +3 · about 3.5K tokens · pinned 7 days ago

  • adr-review

    This skill reviews Architecture Decision Records (ADRs) from a fresh perspective, identifying clarity and structural issues, then rewrites them for future…

    Claude Code, Codex, Cursor +4 · about 590 tokens · pinned 7 days ago

  • ast-visitor-pattern

    This skill teaches agents to use the visitor pattern with frozen subclasses for discriminated unions that need multiple dispatch sites.

    Claude Code, Codex, Cursor +4 · about 710 tokens · pinned 7 days ago

  • bumping-biome

    Updates the biome code formatter package to a specified version using pnpm, renames configuration files to biome.jsonc format, updates schema references, and…

    Claude Code, Codex, Cursor +4 · about 290 tokens · pinned 7 days ago

  • contrib-pr

    This skill guides external contributors through opening a pull request against prisma-next by following the project's contribution guidelines.

    Claude Code, Codex, Cursor +4 · about 2.2K tokens · pinned 7 days ago

  • create-pr

    This skill creates a GitHub pull request with a Linear-ticket-prefixed title and a decision-led narrative description for the prisma-next repository.

    Claude Code, Codex, Cursor +4 · about 4.3K tokens · pinned 7 days ago

  • prisma-next

    Routes vague Prisma Next prompts to the correct specialized skill.

    by PrismaOfficial publisher

    Claude Code, Codex, Cursor +4 · about 1.1K tokens · pinned 7 days ago

  • prisma-next-contract

    This skill enables editing the Prisma Next data contract, the single source of truth for your data layer.

    by PrismaOfficial publisher

    Claude Code, Codex, Cursor +4 · about 6.9K tokens · pinned 7 days ago

  • prisma-next-debug

    Routes Prisma Next error envelopes to the right recovery workflow by reading the structured error's code, domain, severity, and metadata.

    by PrismaOfficial publisher

    Claude Code, Codex, Cursor +4 · about 4K tokens · pinned 7 days ago

  • prisma-next-migration-review

    This skill helps review Prisma Next migrations before deployment, showing which migrations will run when you merge or deploy to an environment.

    by PrismaOfficial publisher

    Claude Code, Codex, Cursor +4 · about 5K tokens · pinned 7 days ago

  • prisma-next-migrations

    Author and execute Prisma Next migrations by choosing between quick database updates or formal migration plans with data transforms.

    by PrismaOfficial publisher

    Claude Code, Codex, Cursor +4 · about 10K tokens · pinned 7 days ago

  • prisma-next-queries

    Write queries against Postgres, SQLite, or MongoDB using Prisma Next.

    by PrismaOfficial publisher

    Claude Code, Codex, Cursor +4 · about 3.5K tokens · pinned 7 days ago

The skills listed here are third-party software, collected from public GitHub repositories as a catalog of recent skills and provided as is. Agent Native does not write or control them and is not responsible for any harm, loss or damage caused by installing or using them. Labels and checks describe what we saw at one commit and are not a guarantee. Read a skill's files before you run it. Terms of use