airbroke / prisma
AGENTS.md221 starsChanged 6 months agoMITView on GitHub
prisma/ owns the deployed database contract and generated client boundary. Schema, migrations, seed data, init scripts, and generated output have distinct ownership rules. - Change models in schema.prisma, add a new timestamped migration for deployed schema changes, then regenerate the client. - Treat existing migrations as immutable production history. Review data transforms, indexes, constraints, triggers/functions, ownership, and cascade behavior, not only the final schema shape. - Use DIRECT_URL for migrations or introspection when DATABASE_URL points through a pooler or proxy.…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,736 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository5 other files it gives its agents.
- AGENTS.mdAGENTS.md
- app/AGENTS.mdAGENTS.md
- components/AGENTS.mdAGENTS.md
- lib/AGENTS.mdAGENTS.md
- __tests__/AGENTS.mdAGENTS.md
The file
We split this AGENTS.md into the rules it gives an agent
9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 24
Treat existing migrations as immutable production history.
- Very specific: line 27
Use DIRECT_URL for migrations or introspection when DATABASE_URL points through a pooler or proxy.
- Distinctive: line 29
Keep seed behavior development-only and idempotent.
- Very specific: line 31
Run Prisma commands inside the web container.
- Very specific: line 36
Never edit generated/; postinstall and db:generate overwrite it.
- Very specific: line 37
Never edit migrations/migration_lock.toml manually.
- Distinctive: line 38
Never rewrite an applied migration to match a newer desired schema.
- Very specific: line 39
Never run migrations against the test database by borrowing the web service's development URL, or against a pooled URL when a direct URL …
- Very specific: line 41
Do not assume pg-init-scripts/ runs in the base stack.
≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PRISMA GUIDE
OVERVIEW
prisma/ owns the deployed database contract and generated client boundary.
Schema, migrations, seed data, init scripts, and generated output have distinct
ownership rules.
WHERE TO LOOK
| Task | Location | Notes |
| Data model | schema.prisma | Hand-authored source of truth |
| Deployment history | migrations/*/migration.sql | Forward-only SQL |
| Client output | generated/ | Generated and gitignored |
| Development seed | seed.ts | Idempotent upserts |
| Local Postgres bootstrap | pg-init-scripts/ | Not mounted by base Compose |
| CLI configuration | ../prisma.config.ts | Prefers DIRECT_URL |
CONVENTIONS
- Change models in
schema.prisma, add a new timestamped migration for deployed schema changes, then regenerate the client. - Treat existing migrations as immutable production history. Review data transforms, indexes, constraints, triggers/functions, ownership, and cascade behavior, not only the final schema shape.
- Use
DIRECT_URLfor migrations or introspection whenDATABASE_URLpoints through a pooler or proxy. Generation intentionally works without either URL. - Keep seed behavior development-only and idempotent. Do not turn seed data into a production migration substitute.
- Run Prisma commands inside the
webcontainer.db:migrateusesprisma migrate deploy; it does not create development migrations.
ANTI-PATTERNS
- Never edit
generated/;postinstallanddb:generateoverwrite it. - Never edit
migrations/migration_lock.tomlmanually. - Never rewrite an applied migration to match a newer desired schema.
- Never run migrations against the test database by borrowing the
webservice's development URL, or against a pooled URL when a direct URL exists. - Do not assume
pg-init-scripts/runs in the base stack; its Compose mount is currently commented out.
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.

