- Home
- Skills
- Data & Databases
- Prisma Schema Check
More screenshots
Works with the AI Agents you already use
Prisma Schema Check
This skill finds those and twelve other Prisma mistakes before they ship, and tells you how to fix each one.
$5
Prisma Schema Check
Example session with this skill installed
Check this project with prisma-schema-check.
- Read your context and instructions
- Compiled the prisma schema check
$ python3 scripts/check_prisma.py examples/risky
BLOCK package.json:8 P03 DATA_LOSS_COMMAND_IN_DEPLOY_SCRIPT
"build": "prisma generate && prisma db push --accept-data-loss && tsc",
Why: A start, build, deploy, release or install script in package.json runs prisma migrate reset, prisma db push --force-reset or prisma db push --accept-data-loss (directly or through npm run). A deploy then drops the database, or drops the tables and columns whose data no longer fits the schema, without asking.
Safer: Deploy with prisma migrate deploy, which only applies the committed migrations and never resets. Keep reset and push in scripts you run by hand against a development database.
BLOCK prisma.config.ts:11 P01 DATABASE_SECRET_IN_FILE
BLOCK src/routes/orders.ts:11 P02 RAW_SQL_BUILT_FROM_STRINGS
BLOCK src/routes/orders.ts:18 P04 REQUEST_OBJECT_IN_PRISMA_QUERY
REVIEW package.json:9 P18 DEV_SCHEMA_COMMAND_IN_DEPLOY_SCRIPT
REVIEW prisma/schema.prisma:12 P14 STRING_ID_WITHOUT_DEFAULT
REVIEW prisma/schema.prisma:13 P15 EMAIL_NOT_UNIQUE
REVIEW prisma/schema.prisma:14 P12 PASSWORD_FIELD_NOT_NAMED_AS_HASH
REVIEW prisma/schema.prisma:24 P11 MONEY_IN_FLOAT
REVIEW prisma/schema.prisma:32 P13 RELATION_WITHOUT_INDEX
REVIEW prisma/schema.prisma:32 P16 CASCADE_DELETES_BUSINESS_RECORDS
REVIEW prisma/schema.prisma:33 P11 MONEY_IN_FLOAT
REVIEW prisma/schema.prisma:42 P13 RELATION_WITHOUT_INDEX
REVIEW prisma/schema.prisma:44 P13 RELATION_WITHOUT_INDEX
REVIEW prisma/schema.prisma:46 P11 MONEY_IN_FLOAT
REVIEW src/db.ts:6 P20 LOCAL_DATABASE_PASSWORD_IN_FILE
REVIEW src/routes/orders.ts:23 P19 REQUEST_OBJECT_IN_QUERY_AFTER_VALIDATION
REVIEW src/routes/orders.ts:28 P17 RAW_SQL_FROM_UNCHECKED_VALUE
(Each finding also has Why and Safer lines, as in the first one.)
Verdict: BLOCK. Checked 5 files, 5 with Prisma content.
This is a static check of file text. NOT FLAGGED is not a guarantee.
Connects securely to your tools. The creator never sees your data.
About this skill
prisma.$queryRawUnsafe(SELECT * FROM "Order" WHERE status = '${status}') looks like the safe tagged template but puts the value straight into the SQL, and a build script with prisma db push --accept-data-loss drops columns on the next deploy. This skill finds those and twelve other Prisma mistakes before they ship, and tells you how to fix each one.
Your agent runs a scanner on your Prisma schema (schema.prisma or a multi-file prisma/schema folder), prisma.config.ts, the JavaScript and TypeScript code that uses Prisma Client, and package.json scripts. It skips comments, tells the tagged $queryRaw template apart from a template string passed to $queryRawUnsafe, follows a SQL variable back to where the file builds it, follows npm run from one script to another, and reads relationMode from the schema file that holds the datasource block. It never runs Prisma, connects to a database or runs your code. It returns BLOCK, REVIEW, or NOT FLAGGED, with the file, line, reason, and a safer approach. Passwords and API keys are never printed.
What it checks
BLOCK
- P01: a database password or Accelerate api_key for a remote host written in the schema, prisma.config.ts or a PrismaClient or driver adapter connection string
- P02: $queryRawUnsafe or $executeRawUnsafe with SQL built from ${...}, + or +=, and Prisma.raw() on built strings or request values
- P03: prisma migrate reset, db push --force-reset or db push --accept-data-loss in a build, start, deploy or install script
- P04: req.body, req.query or await request.json() passed whole as data, where, orderBy, include or select in a route with no validator
REVIEW
- P11: money fields (price, amount, total, balance) stored as Float
- P12: password fields whose name does not say they hold a hash
- P13: relation fields without an index when relationMode = "prisma"
- P14: String ids without a @default
- P15: email without @unique on user, account and customer models
- P16: onDelete: Cascade from a user or organization to orders, invoices, payments or audit records
- P17: raw SQL from a value the file does not show to be a fixed string, or built SQL whose values go in as $1 parameters
- P18: prisma migrate dev or db push in a deploy script
- P19: a whole request object in a query in a route that runs a validator first (check that the query uses the validated result)
- P20: a database password for localhost written in a file, such as a DATABASE_URL fallback
What's included
- The scanner (Python 3.9+, standard library only)
- A rules guide with the reason and safer approach for each rule
- A risky and a safe example Prisma 7 project (schema, prisma.config.ts, Express routes, package.json), and the real report the scanner produces on the risky one
Limits It reads each file as written: SQL built in one file and run in another, .env files, migration SQL, Dockerfiles and CI files are not followed, and test files, seed scripts and generated Prisma Client folders are skipped. The live database is not checked. NOT FLAGGED is not a guarantee.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Data & Databases.
Static check of Prisma schema, config, code and package.json text. Environment files, migrations, CI settings and the database itself are not checked. NOT FLAGGED is not a guarantee.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 5 days ago
Permissions
Runs one local Python script in the terminal. It reads your project's files, writes nothing, and makes no network calls. The example project includes clearly fake, inert database passwords (NOTREAL-...) for the scanner to find. It is never run. To find the schema's datasource block, the scanner also reads .prisma files in the folders above the target, up to the project's own folder (package.json, .git or prisma.config.*).