Prisma ORM patterns — schema design, migrations, type-safe queries, testing, error handling, and performance
96
95%
Does it follow best practices?
Impact
100%
1.28xAverage score across 3 eval scenarios
Passed
No known issues
{
"context": "Tests whether the agent writes Prisma integration tests following the skill's testing rules: env-based DB URL, beforeEach cleanup in child-to-parent order, beforeEach seeding, afterAll disconnect, and test isolation.",
"type": "weighted_checklist",
"checklist": [
{
"name": "DATABASE_URL from environment",
"description": "The PrismaClient in the test file is instantiated WITHOUT a hardcoded `datasources.db.url` — it relies on the environment variable",
"max_score": 10
},
{
"name": ".env.test file present",
"description": "A `.env.test` file is created containing a `DATABASE_URL` value",
"max_score": 8
},
{
"name": "deleteMany in beforeEach",
"description": "A `beforeEach` hook calls `deleteMany` (or equivalent) to clean the database before each test",
"max_score": 12
},
{
"name": "Child-to-parent delete order",
"description": "The cleanup in `beforeEach` deletes child tables before parent tables — specifically, `OrderItem` is deleted before `Order`, and `Order` is deleted before `Product`",
"max_score": 12
},
{
"name": "Seed data in beforeEach",
"description": "A `beforeEach` hook creates known seed data (e.g., a test Product) after the cleanup, so tests have predictable starting state",
"max_score": 10
},
{
"name": "afterAll disconnect",
"description": "An `afterAll` hook calls `prisma.$disconnect()` to close the connection pool after all tests complete",
"max_score": 10
},
{
"name": "Test independence",
"description": "No test relies on data created by another test — each test creates its own data or uses the beforeEach seed",
"max_score": 8
},
{
"name": "Not-found test",
"description": "There is a test that verifies the behavior when looking up a non-existent order (e.g., expects an error or null/undefined)",
"max_score": 8
},
{
"name": "Create order test",
"description": "There is a test that creates an order with at least one line item and asserts on the result",
"max_score": 8
},
{
"name": "No hardcoded DB URL in test",
"description": "The test file does NOT contain any hardcoded database connection string (no `postgresql://...` or `file:./...` directly in the TypeScript source)",
"max_score": 14
}
]
}