CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/prisma-best-practices

Prisma ORM patterns — schema design, migrations, type-safe queries, testing, error handling, and performance

96

1.28x
Quality

95%

Does it follow best practices?

Impact

100%

1.28x

Average score across 3 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

criteria.jsonevals/scenario-1/

{
  "context": "Tests whether the agent designs a Prisma schema following the skill's rules: correct money representation, timestamps on all models, proper indexing of foreign keys and filtered columns, enums for status, cascade deletes, env-based DB URL, and generator block.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Generator block present",
      "description": "Schema includes a `generator client` block with `provider = \"prisma-client-js\"`",
      "max_score": 5
    },
    {
      "name": "DATABASE_URL from env()",
      "description": "The datasource `url` field uses `env(\"DATABASE_URL\")`, not a hardcoded connection string",
      "max_score": 8
    },
    {
      "name": "Money as Int",
      "description": "Price/money fields (e.g., priceCents, totalCents) are typed as `Int`, NOT `Float` or `Decimal`",
      "max_score": 12
    },
    {
      "name": "Status enum with uppercase values",
      "description": "Order status is defined as a Prisma `enum` type with all values in UPPERCASE (e.g., RECEIVED, PREPARING, READY)",
      "max_score": 10
    },
    {
      "name": "createdAt on all models",
      "description": "Every model (Product, Order, OrderItem) has a `createdAt DateTime @default(now())` field",
      "max_score": 8
    },
    {
      "name": "updatedAt on all models",
      "description": "Every model (Product, Order, OrderItem) has an `updatedAt DateTime @updatedAt` field",
      "max_score": 10
    },
    {
      "name": "Foreign key indexes",
      "description": "Every foreign key column (orderId, productId on OrderItem) has a `@@index` defined",
      "max_score": 12
    },
    {
      "name": "Filtered column indexes",
      "description": "Columns that are described as frequently filtered (category on Product, status on Order, createdAt on Order) have `@@index` entries",
      "max_score": 10
    },
    {
      "name": "Cascade delete on child relation",
      "description": "The OrderItem relation to Order specifies `onDelete: Cascade`",
      "max_score": 10
    },
    {
      "name": "Correct relation fields",
      "description": "OrderItem has explicit `fields` and `references` in the @relation attribute for both orderId and productId foreign keys",
      "max_score": 10
    },
    {
      "name": "PostgreSQL provider",
      "description": "The datasource block specifies `provider = \"postgresql\"`",
      "max_score": 5
    }
  ]
}

evals

scenario-1

criteria.json

task.md

tile.json