prisma-schema

prisma-schema is a skill for Claude Code from widnyana/eyay-toolkits. It costs 112 tokens per session (1,250 once invoked), scanned A, original, MIT.

A workflow for creating or changing Prisma database schemas, including models, fields, relationships, indexes, and migrations. Prisma is a tool that describes database structure in code and generates a database client.

In plain words
What is it for?
Use it to add entities or tables, choose field types, define relationships and indexes, and prepare schema changes for PostgreSQL, CockroachDB, or SQL Server.
Why use it?
It encourages consistent database definitions and organizes models into named database schemas where supported.

Skill for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Part of the ts-backend-dev plugin — 3 skills shipped together

Good fit Use it to add entities or tables, choose field types, define relationships and indexes, and prepare schema changes for PostgreSQL, CockroachDB, or SQL Server.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/widnyana/eyay-toolkits/prisma-schema
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add widnyana/eyay-toolkits --skill prisma-schema
Clone the repo
git clone --depth 1 https://github.com/widnyana/eyay-toolkits

Made for: Claude Code.

Or install ts-backend-dev, the plugin that ships this one along with the rest of its 3 skills.

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-schema

README.md
[![agentmods](https://agentmods.dev/badge/skills/widnyana/eyay-toolkits/prisma-schema/github.svg)](https://agentmods.dev/skills/widnyana/eyay-toolkits/prisma-schema)
Your own site
<a href="https://agentmods.dev/skills/widnyana/eyay-toolkits/prisma-schema"><img src="https://agentmods.dev/badge/skills/widnyana/eyay-toolkits/prisma-schema/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-schema

Your own site · 80×15
<a href="https://agentmods.dev/skills/widnyana/eyay-toolkits/prisma-schema"><img src="https://agentmods.dev/badge/skills/widnyana/eyay-toolkits/prisma-schema.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 112 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,250 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 original No closer match found 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.00112 $0.01250
Opus 5 $0.00056 $0.00625
Sonnet 5 $0.00022 $0.00250
Haiku 4.5 $0.00011 $0.00125

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

Security

Grade A, and why

prisma-schema 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 9d 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.

plugins/ts-backend-dev/skills/prisma-schema/SKILL.md · 186 lines

How it starts

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

Prisma Schema

Create/modify schema for: $ARGUMENTS

Multi-Schema Setup

Always define schemas in the datasource block. This enables organizing models into logical namespaces and is supported by PostgreSQL, CockroachDB, and SQL Server.

generator client {
  provider = "prisma-client"
  output   = "./generated"
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
  schemas  = ["base", "billing", "inventory"]
}

Every model and enum must declare its schema with @@schema("name"). Pick the schema that matches the model's domain. If only one schema is needed, use a single entry like schemas = ["public"].

Schema Pattern

model EntityName {
  id        String    @id @default(uuid())
  createdAt DateTime  @default(now()) @map("created_at")
  updatedAt DateTime  @updatedAt @map("updated_at")
  deletedAt DateTime? @map("deleted_at")

  // Business fields
  status EntityStatus @default(ACTIVE)
  name   String
  amount Decimal      @db.Decimal(36, 18)

  // Relations
  accountId String  @map("account_id")
  account   Account @relation(fields: [accountId], references: [id])

  // Indexes
  @@index([accountId])
  @@index([status])
  @@index([createdAt])

  // Table and schema mapping
  @@map("entity_names")
  @@schema("base")
}

enum EntityStatus {
  ACTIVE
  INACTIVE
  DELETED

  @@schema("base")
}

Cross-Schema Relations

Models in different schemas can reference each other. Both schemas must be listed in schemas.

// schema: "base"
model User {
  id     Int     @id
  orders Order[]

  @@schema("base")
}

// schema: "billing"
model Order {
  id     Int  @id
  user   User @relation(fields: [userId], references: [id])
  userId Int

  @@schema("billing")
}

Same Table Name, Different Schema

When two schemas have tables with the same name, use unique model names and @@map to disambiguate:

model BaseConfig {
  id Int @id

  @@map("Config")
  @@schema("base")
}

model UserConfig {
  id Int @id

  @@map("Config")
  @@schema("users")
}

Read the full file on GitHub · 186 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. 9d ago First seen · 186 lines · 112 tokens per session scan A 20282ee04c4a

Subscribe to this mod's changes

prisma-schema is a skill published in the GitHub repository widnyana/eyay-toolkits (7 stars, last pushed 6d ago), licensed MIT. It adds 112 tokens to every session and 1,250 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

ecto-patterns

Ecto patterns — schemas, changesets, queries, migrations, Multi, associations, preloads, upserts. Use when editing Repo calls, Ecto.Query, or schema fields. Skip for Ash.

oliver-kriska/claude-elixir-phoenix · 45 tokens

phoenix-contexts

Phoenix context design — creating/splitting contexts, Scope (1.8+), Ecto.Multi, PubSub, routers, plugs, controllers. Use when editing contexts, routers, or designing boundaries.

oliver-kriska/claude-elixir-phoenix · 46 tokens

ecto-n1-check

Detect N+1 query anti-patterns specifically — Repo calls inside Enum/for loops, missing preloads on associations. Use when N+1 is explicitly suspected, NOT for unrelated Ecto questions or wider database performance.

oliver-kriska/claude-elixir-phoenix · 49 tokens

ggsql

Write ggsql queries — a grammar of graphics for SQL. Use when the user wants to create, modify, or understand a ggsql visualization query.

posit-dev/skills · 33 tokens

data-migration

Moves data from one system to another without losing it or corrupting it — profiling the source before mapping, deciding between big-bang and parallel-run cutover, reconciling counts and values rather than assuming, handling the records that will not map cleanly, and planning a rollback that is actually executable.…

cbrock84/headcount · 102 tokens

data-modeling

Designs the warehouse and semantic layer — source-to-mart structure, dimensional modeling, grain, slowly changing dimensions, and the metric layer analytics reads through. Use this to design or restructure a warehouse, model a new source, decide on grain or table structure, build a semantic or metric layer, or…

cbrock84/headcount · 77 tokens