prisma-patterns

prisma-patterns is a skill for Claude Code, Codex from chadixearth/graphyloop. It costs 62 tokens per session (3,360 once invoked), scanned A, a copy of prisma-patterns, MIT.

A collection of patterns for Prisma, a tool that lets TypeScript backends work with databases using code instead of writing every query in SQL. It covers data models, queries, transactions, pagination, migrations, and serverless deployments.

In plain words
What is it for?
Use it when designing Prisma models, writing database queries or bulk updates, adding pagination or soft deletion, running migrations, or deploying a TypeScript backend to serverless hosting.
Why use it?
It helps avoid Prisma-specific mistakes that can cause incorrect results, failed migrations, slow queries, timeouts, or too many database connections.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is --from-migrations ./prisma/migrations \.

Good fit Use it when designing Prisma models, writing database queries or bulk updates, adding pagination or soft deletion, running migrations, or deploying a TypeScript backend to serverless hosting.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/chadixearth/graphyloop
agentmods
npx agentmods add skills/chadixearth/graphyloop/prisma-patterns

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for prisma-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/chadixearth/graphyloop/prisma-patterns/github.svg)](https://agentmods.dev/skills/chadixearth/graphyloop/prisma-patterns)
Your own site
<a href="https://agentmods.dev/skills/chadixearth/graphyloop/prisma-patterns"><img src="https://agentmods.dev/badge/skills/chadixearth/graphyloop/prisma-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for prisma-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/chadixearth/graphyloop/prisma-patterns"><img src="https://agentmods.dev/badge/skills/chadixearth/graphyloop/prisma-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,360 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 84% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00062 $0.03360
Opus 5 $0.00031 $0.01680
Sonnet 5 $0.00012 $0.00672
Haiku 4.5 $0.00006 $0.00336

Measured 5d ago against content hash cdd90a659924, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

prisma-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

84% identical to prisma-patterns — 120 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/prisma-patterns/SKILL.md · 374 lines

How it starts

The opening of the file, as written. The whole thing — 374 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Prisma Patterns

Production patterns and non-obvious traps for Prisma ORM in TypeScript backends. Tested against Prisma 5.x and 6.x. Some behaviors differ from Prisma 4.

Check the Prisma version before applying version-specific patterns:

npx prisma --version

Prisma 5 introduced relationJoins, which can load relations via JOIN rather than separate queries depending on query strategy and configuration. The omit field modifier and prisma.$extends Client Extensions API were also added. Note: relationJoins can cause row explosion on large 1:N relations or deep nested include — benchmark both approaches when relations may return many rows per parent.

When to Activate

  • Designing or modifying Prisma schema models and relations
  • Writing queries, transactions, or pagination logic
  • Using updateMany, deleteMany, or any bulk operation
  • Running or planning database migrations
  • Deploying to serverless environments (Vercel, Lambda, Cloudflare Workers)
  • Implementing soft delete or multi-tenant row filtering

Core Concepts

ID Strategy

Strategy Use When Avoid When
@default(cuid()) Default choice — URL-safe, sortable, no collisions Sequential IDs needed for external systems
@default(uuid()) Interoperability with non-Prisma systems required High-write tables (random UUIDs fragment B-tree indexes)
@default(autoincrement()) Internal join tables, audit logs Public-facing IDs (exposes record count)

Schema Defaults

model User {
  id        String    @id @default(cuid())
  email     String    @unique  // @unique already creates an index — no @@index needed
  name      String
  role      Role      @default(USER)
  posts     Post[]
  createdAt DateTime  @default(now())
  updatedAt DateTime  @updatedAt
  deletedAt DateTime?

  @@index([createdAt])
  @@index([deletedAt, createdAt]) // composite for soft-delete + sort queries
}
  • Add @@index on every foreign key and column used in WHERE or ORDER BY.
  • Declare deletedAt DateTime? upfront when soft delete is a foreseeable requirement — adding it later requires a migration on a live table.
  • updatedAt @updatedAt is set automatically by Prisma on update and upsert only (see Anti-Patterns for bulk update trap).

Read the full file on GitHub · 374 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 374 lines · 62 tokens per session scan A cdd90a659924

Subscribe to this mod's changes

prisma-patterns is a skill published in the GitHub repository chadixearth/graphyloop (2 stars, last pushed 23d ago), licensed MIT. It adds 62 tokens to every session and 3,360 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. It is 84% identical to prisma-patterns, differing in 120 lines, and is treated as a copy.

Related

Other skills, from other repositories

kirby-content-migration

Plans and applies safe Kirby content migrations using runtime content tools, update schemas, and explicit confirmation. Use when users need to rename/move/transform fields, clean up content, or bulk-update pages/files across languages.

bnomei/kirby-mcp · 49 tokens

ship-safe-scan

Quick scan for leaked secrets — API keys, passwords, tokens, database URLs. Use when the user wants to check for hardcoded secrets or exposed credentials.

asamassekou10/ship-safe · 36 tokens

backend-development

Backend API design, database architecture, microservices patterns, and test-driven development. Use for designing APIs, database schemas, or backend system architecture.

MoizIbnYousaf/Ai-Agent-Skills · 32 tokens

database-connections

Connect a Mendix app to an external database over JDBC with the External Database Connector, and define the queries microflows run against it. Use when the app must read or write Oracle, PostgreSQL, MySQL or SQL Server directly from a microflow.

mendixlabs/mxcli · 55 tokens

connect-rapidminer-graph

Fetch data from a RapidMiner graph mart or any SPARQL 1.1 HTTP endpoint (AnzoGraph and friends) and surface it as Mendix entities. Use when a graph database with a SPARQL endpoint has to feed a Mendix app read-only.

mendixlabs/mxcli · 62 tokens

mendix-odata-pushdown

Push OData query options into the SQL of a Mendix resource served by a read microflow, so $filter, $orderby, $top, $skip, $count and the key lookup reach the database instead of being silently dropped. Use when publishing an OData resource over data Mendix has no table for — a warehouse view, a legacy database, a…

mendixlabs/mxcli · 117 tokens