prisma7-custom-output
Installation
SKILL.md
Prisma 7 Custom Output Migration
Migrate a Prisma 7 project from the deprecated prisma-client-js generator (which outputs to node_modules/.prisma/client/) to the prisma-client generator with a custom output directory. This eliminates an entire class of monorepo bugs caused by stale nested node_modules copies.
Citations:
Why This Migration Matters
With prisma-client-js, the generated client lives in node_modules/.prisma/client/. In monorepos, this causes:
- Hoisting bugs — package managers may create nested
node_modules/@prisma/client/copies in workspace packages that declare@prisma/clientas a dependency.prisma generatewrites to root, but TypeScript resolves through the nested copy. - Stale build caches — CI/CD (especially Vercel) caches
node_modulesbetween deploys. After schema changes or Prisma upgrades, the cached nested copies contain stale types. - Phantom type errors —
Property 'X' does not exist on type 'PrismaClient'when the model IS in the schema.
With prisma-client, the generated client lives in a directory controlled by the project (e.g., packages/db/src/generated/prisma/). No node_modules resolution games.