prisma-expert
Skill71 starsChanged 7 months agoMITView on GitHub
- Reads credentials
7 other projects use a version of this, 6 of them edited.
Adopted by
Most recently taken up by
- xfstudio/skillsedited, first seen Oct 13, 2026
- Ghosteken/agent-harnessedited, first seen Oct 1, 2026
- TheHiddenDeveloper/jarvis-skillsedited, first seen Aug 19, 2026
- Fandry96/k3-agentic-skillsedited, first seen May 12, 2026
- ai4brands-design/claude-skillsedited, first seen Mar 22, 2026
- Mischio95/skillsedited, first seen Mar 4, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 6
- Fandry96/k3-agentic-skills★ 2713% same
- xfstudio/skills★ 913% same
- ai4brands-design/claude-skills★ 213% same
- Ghosteken/agent-harness★ 213% same
- Mischio95/skills★ 113% same
- TheHiddenDeveloper/jarvis-skills★ 013% same
Wrote their own version · 1
- thesaifalitai/claude-setup★ 9same 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 repository117 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-healthSkill
- agent-styleSkill
- angular-best-practicesSkill
- annotateSkill
- api-designSkill
- architecture-decision-recordsSkill
- aws-serverlessSkill
- backend-architectSkill
- backend-patternsSkill
- brainstormSkill
- bug-reportSkill
- changelogSkill
- claude-apiSkill
- cloud-architectSkill
- cloud-run-puppeteerSkill
- code-review-checklistSkill
- code-reviewSkill
- code-simplificationSkill
- codex-sddSkill
- commitSkill
- context-engineeringSkill
- database-architectSkill
- db-reviewSkill
- deep-interviewSkill
- design-reviewSkill
- design-systemSkill
- devops-deploySkill
- diagnoseSkill
- django-patternsSkill
- docker-patternsSkill
- dotnet-backend-patternsSkill
- dreamSkill
- drizzle-orm-expertSkill
- estimateSkill
- event-sourcing-architectSkill
- fastapi-proSkill
- fork-joinSkill
- freezeSkill
- frontend-designSkill
- frontend-patternsSkill
- frontend-ui-dark-tsSkill
- gate-checkSkill
- gemini-api-integrationSkill
- gitlab-ci-patternsSkill
- guardSkill
- handoffSkill
- hotfixSkill
- hybrid-cloud-architectSkill
- kubernetes-architectSkill
- laravel-patternsSkill
- launch-checklistSkill
- learnerSkill
- llm-app-patternsSkill
- localizeSkill
- map-systemsSkill
- map-workflowSkill
- markdown-injection-scannerSkill
- microservices-patternsSkill
- The first 60 shown.
The file
We found no rules to list in this file: it reads as prose or reference rather than instructions.
Files
Prisma Expert
Critical rules (non-obvious)
- Never use
migrate devin production — usemigrate deploy;migrate devcan reset data - Singleton client in serverless — new
PrismaClient()per request exhausts connections; use global singleton includevsselect:include: { posts: true }fetches ALL post fields; useselectto limit$queryRawreturns unknown[] — you must cast withasor validate; Prisma can't infer raw query types- Missing
@relationon both sides causes "The relation is not defined on both sides" runtime error
Schema: canonical model structure
model User {
id String @id @default(cuid())
email String @unique
role Role @default(USER)
posts Post[] @relation("UserPosts")
profile Profile? @relation("UserProfile")
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([email])
@@map("users")
}
model Post {
id String @id @default(cuid())
title String
content String?
published Boolean @default(false)
author User @relation("UserPosts", fields: [authorId], references: [id], onDelete: Cascade)
authorId String
@@index([authorId])
@@map("posts")
}
enum Role { USER ADMIN MODERATOR }Query optimization: N+1 fix
// ❌ N+1
const users = await prisma.user.findMany();
for (const user of users) {
const posts = await prisma.post.findMany({ where: { authorId: user.id } });
}
// ✅ Include (fetches all post fields)
const users = await prisma.user.findMany({ include: { posts: true } });
// ✅✅ Select (fetch only needed fields — best for performance)
const users = await prisma.user.findMany({
select: {
id: true, email: true,
posts: { select: { id: true, title: true } },
},
});
// ✅ Complex aggregations → use raw
const result = await prisma.$queryRaw<{ id: string; count: number }[]>`
SELECT u.id, COUNT(p.id)::int as count
FROM users u LEFT JOIN posts p ON p.author_id = u.id
GROUP BY u.id
`;Transactions
// Sequential (auto-atomic, no rollback control)
const [user, profile] = await prisma.$transaction([
prisma.user.create({ data: userData }),
prisma.profile.create({ data: profileData }),
]);
// Interactive (full control, rollback on throw)
const result = await prisma.$transaction(async (tx) => {
const user = await tx.user.create({ data: userData });
if (user.email.endsWith("@blocked.com")) throw new Error("Blocked domain");
return tx.profile.create({ data: { ...profileData, userId: user.id } });
}, {
maxWait: 5000,
timeout: 10000,
isolationLevel: "Serializable", // use ReadCommitted for most cases
});Singleton client (Next.js / serverless)
// lib/prisma.ts
import { PrismaClient } from "@prisma/client";
const globalForPrisma = globalThis as unknown as { prisma: PrismaClient };
export const prisma = globalForPrisma.prisma ?? new PrismaClient({
log: process.env.NODE_ENV === "development" ? ["query"] : [],
});
if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;Migration commands
# Development: creates migration file + applies
npx prisma migrate dev --name add_role_to_users
# Production: apply pending migrations only (safe)
npx prisma migrate deploy
# Check migration status
npx prisma migrate status
# Fix stuck migration
npx prisma migrate resolve --applied "20240115_migration_name"
# Validate schema (no DB connection needed)
npx prisma validate
# Format schema
npx prisma formatCommon pitfalls
| Pitfall | Fix |
migrate dev in production | Use migrate deploy |
New PrismaClient() per request | Use global singleton |
include: { all: true } on large models | Use select to fetch only needed fields |
| P2034 (transaction conflict) | Retry with exponential backoff |
| Shadow database error in dev | Set shadowDatabaseUrl or use Neon branching |
| Enum not syncing | Run migrate dev after enum changes |
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.

