shunwuyu/ai_lesson/prisma-upgrade-v7
Claude Code and agent skill by shunwuyu/ai_lesson
- community
- ext:[{"type":"config","description":"Configuration overrides"}]
Checking that the SKILL.md file is still in the repository.
Complete migration guide from Prisma ORM v6 to v7 covering all breaking changes. Use when upgrading Prisma versions, encountering v7 errors, or migrating existing projects. Triggers on "upgrade to prisma 7", "prisma 7 migration", "prisma-client generator", "driver adapter required".
Install
npx vskill@latest install shunwuyu/ai_lesson/prisma-upgrade-v7Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as prisma/skills/prisma-upgrade-v7.
Upgrade to Prisma ORM 7
Complete guide for migrating from Prisma ORM v6 to v7. This upgrade introduces significant breaking changes around the new prisma-client generator, driver adapters, prisma.config.ts, explicit environment loading, and generated client entrypoints.
When to Apply
Reference this skill when:
- Upgrading from Prisma v6 to v7
- Updating to the
prisma-clientgenerator - Setting up driver adapters
- Configuring
prisma.config.ts - Fixing import errors after upgrade
Rule Categories by Priority
| Priority | Category | Impact | Prefix | |
|---|---|---|---|---|
| 1 | Schema Migration | CRITICAL | schema-changes | |
| 2 | Database Connectivity | CRITICAL | driver-adapters | |
| 3 | Module System | CRITICAL | esm-support | |
| 4 | Config and Env | HIGH | prisma-config, env-variables | |
| 5 | Removed Features | HIGH | removed-features | |
| 6 | Accelerate | HIGH | accelerate-users |
Quick Reference
schema-changes- generator migration, required output paths, generated entrypoints, andPrisma.validatorreplacementdriver-adapters- required adapter installation for SQL providers, pool differences, and Prisma Postgres adapter choicesesm-support- ESM-first setup plus CommonJS fallback withmoduleFormat = "cjs"prisma-config- creating and usingprisma.config.tsenv-variables- explicit environment loadingremoved-features- removed middleware, metrics, and legacy CLI behavioraccelerate-users- migration notes for Accelerate users
Using MongoDB? This guide does not apply
Prisma 7 has no MongoDB connector. Do not apply any step in this guide to a project with provider = "mongodb" — see the prisma-mongodb-upgrade skill for the actual decision (stay on v6 deliberately vs migrate to Prisma Next).
Important Notes
- MongoDB projects should stay on Prisma 6.x or migrate to Prisma Next - do not migrate MongoDB apps to Prisma 7's SQL client path (see
prisma-mongodb-upgrade) - Node.js 20.19.0+ required
- TypeScript 5.4.0+ required
- Latest stable Prisma ORM version:
7.6.0
Upgrade Steps Overview
- Update packages to v7
- Choose your module format (
esmby default,cjsif needed) - Update TypeScript configuration
- Update the schema generator block
- Create
prisma.config.ts - Install and configure a driver adapter for SQL providers
- Update Prisma Client imports
- Update client instantiation
- Replace deprecated helper patterns like
Prisma.validator - Run
prisma generateand test
Quick Upgrade Commands
Breaking Changes Summary
| Change | v6 | v7 | |
|---|---|---|---|
| Module format | Implicit / mixed | ESM-first, moduleFormat = "cjs" supported | |
| Generator provider | prisma-client-js | prisma-client is the default, while prisma-client-js still exists for legacy setups | |
| Output path | Auto (node_modules) | Required explicit | |
| Driver adapters | Optional | Required for SQL providers | |
| Config file | .env + schema | prisma.config.ts | |
| Env loading | Automatic | Manual (dotenv) | |
| Generated entrypoints | Single package export | client, browser, models, enums entrypoints | |
| Type-safe query fragments | Prisma.validator() | TypeScript satisfies | |
| Middleware | $use() | Client Extensions | |
| Metrics | Preview feature | Removed |
Rule Files
Detailed migration guides for each breaking change:
Step-by-Step Migration
1. Update package.json for ESM-first projects
If you need to stay on CommonJS, keep your app as CJS and set moduleFormat = "cjs" in the generator block instead of forcing ESM.
2. Update tsconfig.json
3. Update schema.prisma
4. Create prisma.config.ts
5. Install a driver adapter (SQL providers only)
MongoDB does not have a SQL @prisma/adapter-* package in the published Prisma 7.6.0 packages. If you're upgrading a MongoDB project, stop and keep that project on the latest Prisma 6.x release instead of following the standard Prisma 7 migration path.
6. Update client instantiation
7. Replace Prisma.validator with satisfies
8. Run migrations and generate
Troubleshooting
"Cannot find module" errors
- Check that the generator
outputpath matches your import path - Ensure
prisma generateran successfully
SSL certificate errors
- Add
ssl: { rejectUnauthorized: false }to the adapter config if you need to preserve old behavior - Or configure your certificates properly with
NODE_EXTRA_CA_CERTS/ OpenSSL CA settings
Connection timeout issues
- Driver adapters use the underlying driver's defaults, which differ from v6
- Configure pool settings explicitly on the adapter if needed
Resources
How to Use
Follow references/schema-changes.md and references/driver-adapters.md first, then apply the remaining reference files based on your project setup.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingnest/guang/hello/.agents/skills/prisma-upgrade-v7/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
configConfiguration overrides
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/shunwuyu/ai_lesson/prisma-upgrade-v7)