Help us improve
Share bugs, ideas, or general feedback.
Share bugs, ideas, or general feedback.
Share bugs, ideas, or general feedback.
By esot321c
Opinionated Prisma ORM + PostgreSQL patterns: schema design, indexing, migrations, transactions, and raw SQL escape hatches
npx claudepluginhub esot321c/opinionated-prismaPostgreSQL indexing patterns and Prisma's limitations. Use when adding indexes, diagnosing slow queries, dealing with N+1 problems, or needing partial, expression, GiST, or BRIN indexes. Triggers on "index", "@@index", "performance", "slow query", "EXPLAIN", "N+1", "partial index", "GIN", "GiST", "BRIN".
Safe Prisma migration workflows for PostgreSQL. Use when planning or running prisma migrate, adding columns to existing tables, creating indexes on large tables, or making constraint changes. Triggers on "migrate", "migration", "prisma migrate", "--create-only", "ALTER TABLE", "NOT NULL", "CONCURRENTLY", "rollback", "deploy".
Overview and prerequisites for Prisma ORM + PostgreSQL patterns. Use when first setting up a database, establishing ID strategy, or needing guidance on which specific skill to use. Triggers on "prisma", "database", "postgresql", "postgres".
Decision logic for when to use $queryRaw vs Prisma's query API. Use when deciding whether raw SQL is warranted, writing window functions, CTEs, full-text search, JSONB operators, or complex aggregations. Triggers on "$queryRaw", "raw sql", "window function", "CTE", "full-text search", "JSONB", "ROW_NUMBER", "RANK", "Prisma.sql", "EXPLAIN ANALYZE".
Prisma schema design conventions: naming, primary keys, enums, relations, soft delete. Use when designing models, adding fields, choosing between enums and strings, or setting up a new Prisma schema. Triggers on "schema", "model", "relation", "enum", "field", "prisma.schema", "@@map", "@map", "uuid", "slug".
Share bugs, ideas, or general feedback.
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Efficient skill management system with progressive discovery — 410+ production-ready skills across 33+ domains
Open-source, local-first Claude Code plugin for token reduction, context compression, and cost optimization using hybrid RAG retrieval (BM25 + vector search), reranking, AST-aware chunking, and compact context packets.
An opinionated AI coding skill plugin for building with Prisma ORM on self-hosted PostgreSQL.
This is not a reference guide. It is a set of enforced opinions about how to use Prisma with PostgreSQL. It chooses UUID v7 over v4, strings over database enums, snake_case mapping, and raw SQL only when Prisma changes algorithmic complexity.
If your project has different needs, fork this plugin rather than using it directly. The value is in the decisions being made consistently, not in covering every possible approach.
Skills trigger automatically based on what you're doing. When your coding agent sees you working with Prisma schemas, database queries, migrations, or transactions, the relevant skill activates and guides the agent's decisions.
You don't invoke skills manually. Ask your agent to "add a users table" and the schema-design skill kicks in. Ask it to "add an index to a large table" and migration-safety takes over with the safe CONCURRENTLY pattern. The agent checks for relevant skills before any database task.
opinionated-prisma — Entry point. Establishes UUID v7 prerequisites, checks for existing schema and Docker setup, routes to the appropriate skill for the task at hand.
schema-design — Activates when designing models or adding fields. Enforces snake_case mapping via @@map/@map, UUID v7 primary keys, @@index on every foreign key, string fields over database enums, separate slug fields for URLs, and soft delete via deletedAt.
indexing — Activates when adding indexes or diagnosing slow queries. Covers what Prisma handles (B-tree, composite, GIN) and what requires custom migrations (partial indexes, expression indexes, GiST, BRIN). Addresses N+1 join behavior and when to enable relationJoins.
migration-safety — Activates when planning or running prisma migrate. Enforces the --create-only review workflow, three-step required column additions (nullable, backfill, NOT NULL), CREATE INDEX CONCURRENTLY for large tables, and NOT VALID/VALIDATE for constraints.
transactions — Activates when writing transactions or bulk operations. Chooses interactive vs sequential transactions, enforces explicit timeouts, handles bulk create with relations via transaction loops, and bulk upsert via INSERT ... ON CONFLICT.
raw-sql-boundary — Activates when deciding whether to use $queryRaw. Draws the line: raw SQL only when Prisma cannot express the operation (window functions, CTEs, full-text search, JSONB operators) or when it changes algorithmic complexity (bulk upsert). Not for marginal speed gains.
Installation differs by platform. If you use more than one, install separately for each.
Register the marketplace:
/plugin marketplace add esot321c/opinionated-prisma
Install the plugin:
/plugin install opinionated-prisma@opinionated-prisma
Open the plugin search interface:
/plugins
Search for opinionated-prisma and select Install Plugin.
Install the extension:
gemini extensions install https://github.com/esot321c/opinionated-prisma
Update later:
gemini extensions update opinionated-prisma
In Cursor Agent chat:
/add-plugin opinionated-prisma
Or search for "opinionated-prisma" in the plugin marketplace.
Tell OpenCode:
Fetch and follow instructions from https://raw.githubusercontent.com/esot321c/opinionated-prisma/refs/heads/main/.opencode/INSTALL.md
Clone into your skills directory:
git clone https://github.com/esot321c/opinionated-prisma.git ~/.claude/skills/opinionated-prisma
Add to a specific project:
git clone https://github.com/esot321c/opinionated-prisma.git .claude/skills/opinionated-prisma
Self-hosted PostgreSQL with the pg_uuidv7 extension. See the opinionated-prisma skill for setup instructions including Docker Compose configuration.
This plugin makes these decisions rather than presenting options:
pg_uuidv7, not v4/CUID/ULID@@map and @map to snake_case on every model and field@@index on every foreign key (Prisma does not auto-create these)$queryRaw only when Prisma changes algorithmic complexity, not for marginal speedIf any of these don't fit your project, fork and adjust. PRs to make decisions configurable will not be accepted.