Prisma Patterns — portable workflow
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. Use when writing a Prisma schema or query, or debugging transactions, migrations, or serverless connection limits.
Use it only when the request supplies this domain, framework, data source or artifact; a shared keyword is not a match. Related skills, each for its own concern: bosskuai-jpa-patterns, database-migrations, mysql-patterns, bosskuai-nestjs-patterns, bosskuai-performance-profiling, bosskuai-postgres-patterns, bosskuai-software-architecture.
Workflow
Read the source workflow first, then work through these sections in order:
- Core Concepts.
- ID Strategy.
- Schema Defaults.
include vs select.
- Transaction Form Selection.
- PrismaClient Singleton.
- Resolve its
scripts/, references/, assets/ and template paths against references/upstream/, not the project root. Source skill names map through SOURCE.json (bossku skills show <id>). ECC slash commands, agent names and package-root paths are not installed: use what this host has, or say what is missing.
- Check the project's tool versions first:
npx prisma -v for the installed Prisma CLI and engines, and the prisma and @prisma/client versions in package.json and the lockfile. The provider in schema.prisma names the database. Check the latest stable Prisma release at work time on prisma.io, and use only APIs that exist in the installed version. Also check the source prerequisites. A documented command is an example, not permission to install packages, add an account, expose secrets, upload private content or change an external service.
Done when
Apply the source “Core Concepts”, “ID Strategy” guidance to the concrete request. Return the resulting prisma patterns artifact or diagnosis with source/command evidence for each conclusion.
If an input, provider, runtime or authorisation is missing, stop that step, carry on with read-only analysis, and say exactly what is missing. A generated plan alone is not completion.
Also check before you finish:
Decimal values are compared with their own methods, not ===.
- A
BigInt must become a string before JSON.stringify, because JSON.stringify throws on a BigInt.
- Run the migration with
prisma migrate deploy on a production data copy. Never use migrate dev, which can reset a database.
- A write that depends on a read needs one of these: a conditional
updateMany (check count), a unique constraint, or a Serializable transaction that retries on P2034 (a retry runs the callback again, so keep payment, email and queue calls outside it).
- The old app still runs on the new schema during deploy.
- Full quality bar, with version and type checks:
../../references/checklists/engineering-quality-bar.md.
Adapted from the locally reviewed affaan-m/ECC snapshot: provenance and hashes in SOURCE.json, the original text and resources in references/upstream/ under its MIT licence. Copyright (c) 2026 Affaan Mustafa.
1---2name: bosskuai-prisma-patterns3description: "Use when the task explicitly concerns 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. Use when writing a Prisma schema or query, or debugging transactions, migrations, or serverless connection limits."4metadata:5 source: https://skillmd.com/skills/wankimmy/bosskuai-prisma-patterns6 origin: ECC-adaptation7---89# Prisma Patterns — portable workflow1011Prisma 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. Use when writing a Prisma schema or query, or debugging transactions, migrations, or serverless connection limits.1213Use it only when the request supplies this domain, framework, data source or artifact; a shared keyword is not a match. Related skills, each for its own concern: `bosskuai-jpa-patterns`, `database-migrations`, `mysql-patterns`, `bosskuai-nestjs-patterns`, `bosskuai-performance-profiling`, `bosskuai-postgres-patterns`, `bosskuai-software-architecture`.1415## Workflow1617Read [the source workflow](references/upstream/SKILL.md) first, then work through these sections in order:18191. Core Concepts.202. ID Strategy.213. Schema Defaults.224. `include` vs `select`.235. Transaction Form Selection.246. PrismaClient Singleton.2526- Resolve its `scripts/`, `references/`, `assets/` and template paths against `references/upstream/`, not the project root. Source skill names map through [SOURCE.json](SOURCE.json) (`bossku skills show <id>`). ECC slash commands, agent names and package-root paths are not installed: use what this host has, or say what is missing.27- Check the project's tool versions first: `npx prisma -v` for the installed Prisma CLI and engines, and the `prisma` and `@prisma/client` versions in `package.json` and the lockfile. The `provider` in `schema.prisma` names the database. Check the latest stable Prisma release at work time on prisma.io, and use only APIs that exist in the installed version. Also check the source prerequisites. A documented command is an example, not permission to install packages, add an account, expose secrets, upload private content or change an external service.2829## Done when3031Apply the source “Core Concepts”, “ID Strategy” guidance to the concrete request. Return the resulting prisma patterns artifact or diagnosis with source/command evidence for each conclusion.3233If an input, provider, runtime or authorisation is missing, stop that step, carry on with read-only analysis, and say exactly what is missing. A generated plan alone is not completion.3435Also check before you finish:3637- `Decimal` values are compared with their own methods, not `===`.38- A `BigInt` must become a string before `JSON.stringify`, because `JSON.stringify` throws on a `BigInt`.39- Run the migration with `prisma migrate deploy` on a production data copy. Never use `migrate dev`, which can reset a database.40- A write that depends on a read needs one of these: a conditional `updateMany` (check `count`), a unique constraint, or a `Serializable` transaction that retries on `P2034` (a retry runs the callback again, so keep payment, email and queue calls outside it).41- The old app still runs on the new schema during deploy.42- Full quality bar, with version and type checks: `../../references/checklists/engineering-quality-bar.md`.4344Adapted from the locally reviewed `affaan-m/ECC` snapshot: provenance and hashes in [SOURCE.json](SOURCE.json), the original text and resources in [references/upstream/](references/upstream/SKILL.md) under its [MIT licence](references/upstream/LICENSE). Copyright (c) 2026 Affaan Mustafa.