prisma
Skill2 starsChanged 4 months agoMITView on GitHub
Use to model a database with a type-safe schema, run migrations, and query from TypeScript/Node with the Prisma Client.
- Reads credentials
- Installs packages
5 other projects use a version of this.
Adopted by
Most recently taken up by
- juanquijandria/prisma-harnesstheir own version, first seen Sep 16, 2026
- YepAPI/skillstheir own version, first seen Apr 12, 2026
- michelve/hugin-v0their own version, first seen Mar 29, 2026
- michelve/hugin-coworktheir own version, first seen Mar 16, 2026
- Mindrally/skillstheir own version, first seen Jan 23, 2026
Used with
Projects with it also use accessibility.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
ElasticSkillaccessibility
Accessibility guidance for Kibana. Use this skill when working with or reviewing EUI components, resolving a11y-related (@elastic/eui) ESLint issues, and ensuring proper use of ARIA attributes, focus management, keyboard interactions, and accessible naming conventions.
Also in 3 projects that use this
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- Mindrally/skills★ 266same name
- YepAPI/skills★ 8same name
- juanquijandria/prisma-harness★ 2same name
- michelve/hugin-cowork★ 1same name
- michelve/hugin-v0★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository20 other files it gives its agents.
- anthropicSkill
- clerkSkill
- cloudflare-workersSkill
- dockerSkill
- fly-ioSkill
- github-actionsSkill
- neonSkill
- netlifySkill
- nextjsSkill
- openaiSkill
- railwaySkill
- renderSkill
- resendSkill
- sentrySkill
- stripeSkill
- supabaseSkill
- tailwindcssSkill
- terraformSkill
- upstash-redisSkill
- vercelSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Use when: you want end-to-end type safety between your DB and app code.
- Very specific: line 22
Use when: you need a clear, versioned migration history (prisma/migrations).
- Very specific: line 23
Don't use for: raw ultra-hot paths where you need hand-tuned SQL (use $queryRaw selectively).
- Very specific: line 132
Prefer parameterized Prisma queries.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Prisma ORM — Skillship
Type-safe database toolkit for Node/TypeScript: declare models in a schema, generate a fully typed client, and evolve your database with versioned migrations.
🧭 When to use this skill
- Use when: you want end-to-end type safety between your DB and app code.
- Use when: you need a clear, versioned migration history (
prisma/migrations). - Don't use for: raw ultra-hot paths where you need hand-tuned SQL (use
$queryRawselectively).
⚡ Quickstart
1. Install & init
npm install prisma --save-dev
npm install @prisma/client
npx prisma init --datasource-provider postgresql
# creates prisma/schema.prisma + .env with DATABASE_URL2. Configure env
# .env
DATABASE_URL="postgresql://user:pass@host:5432/dbname?schema=public"3. Define a model
// prisma/schema.prisma
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
posts Post[]
}
model Post {
id Int @id @default(autoincrement())
title String
author User @relation(fields: [authorId], references: [id])
authorId Int
}4. Migrate + generate
npx prisma migrate dev --name init # creates + applies migration, regenerates client5. Query
import { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();
const user = await prisma.user.create({
data: { email: "alice@prisma.io", name: "Alice", posts: { create: { title: "Hello" } } },
include: { posts: true },
});🧩 Common recipes
Recipe: CRUD
// Read
await prisma.user.findUnique({ where: { email: "a@b.com" } });
await prisma.user.findMany({ where: { email: { endsWith: "@prisma.io" } }, include: { posts: true } });
// Update / upsert
await prisma.user.update({ where: { id: 1 }, data: { name: "Bob" } });
await prisma.user.upsert({
where: { email: "a@b.com" },
update: { name: "Bob" },
create: { email: "a@b.com", name: "Bob" },
});
// Atomic increment
await prisma.post.update({ where: { id: 1 }, data: { views: { increment: 1 } } });
// Delete
await prisma.user.delete({ where: { id: 1 } });Recipe: Transactions
await prisma.$transaction([
prisma.post.deleteMany({ where: { authorId: 7 } }),
prisma.user.delete({ where: { id: 7 } }),
]);Recipe: Singleton client (avoid connection storms in dev/serverless)
// lib/prisma.ts
import { PrismaClient } from "@prisma/client";
const g = globalThis as unknown as { prisma?: PrismaClient };
export const prisma = g.prisma ?? new PrismaClient();
if (process.env.NODE_ENV !== "production") g.prisma = prisma;🚀 Ship to production
- Use
prisma migrate deploy(notmigrate dev) in CI/CD — it only applies committed migrations. - Commit the entire
prisma/migrations/folder andschema.prismato version control. - Run
prisma generateduring build (e.g.postinstall) so the client matches the schema. - On serverless/edge, use a pooled connection string (PgBouncer/Neon/Accelerate) to avoid exhausting DB connections.
- Reuse a single
PrismaClient(singleton) — never instantiate per request.
🔐 Security & secrets
DATABASE_URLholds DB credentials — keep it in env/secret manager, never in the repo.- Prefer parameterized Prisma queries; if you must use
$queryRawUnsafe, never interpolate user input.
🐛 Common errors & fixes
| Symptom | Likely cause | Fix |
Too many database connections | New client per request / serverless fan-out | Use singleton + pooled connection string |
Environment variable not found: DATABASE_URL | .env not loaded | Ensure .env exists / load dotenv; set in host env for prod |
Migration drift / migrate dev wants reset | Schema changed outside Prisma | Use prisma db pull to introspect, or baseline the migration |
| Types out of date after schema edit | Client not regenerated | Re-run npx prisma generate (and restart TS server) |
📚 Sources
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

