Skip to main content
skill CX Codex

prisma-development — Claude Code skill: Prisma ORM rules

Gives your agent a fixed set of Prisma ORM and TypeScript rules: schema design, migrations, transactions, error handling. Useful when the project runs on Prisma.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Mindrally/skills --skill prisma-development -a claude-code
Open on GitHub

What prisma-development does

This skill turns the agent into a disciplined Prisma developer. It asks for explicit types, bans any, keeps functions under 20 lines and pushes complex logic into separate functions. Naming is fixed: PascalCase for classes and interfaces, camelCase for variables, kebab-case for files, UPPERCASE for constants, verb-based booleans (isLoading, hasError).

Prisma rules are concrete. Models and fields get domain-driven names, relations are declared with @relation, soft deletes use a deletedAt field. Client code stays type-safe, complex flows go through transactions, middleware handles logging and auditing, and select with include replaces fetching whole rows. Migrations carry descriptive names, existing ones are never edited, idempotency is required, and staging runs before production.

Errors are split by type: PrismaClientKnownRequestError for constraint violations, PrismaClientUnknownRequestError for unexpected database failures, PrismaClientValidationError for schema mismatches. The skill also forbids exposing a raw Prisma client through an API and requires validating user input before any database call. It ships as a single SKILL.md with no scripts or hooks, so the agent's behaviour changes through instructions alone.

What it helps with

  • design a Prisma schema with explicit relations and soft deletes
  • route client errors by type instead of swallowing constraint violations
  • kill N+1 queries with select and include
  • ship a migration with a clear name and no edits to old files
  • keep the raw Prisma client out of public APIs

Example prompts for the agent

  • Write a Prisma model for orders with a relation to user and a deletedAt field
  • Check this query for N+1 and rewrite it with select
  • Walk through this PrismaClientKnownRequestError in my handler

How to install prisma-development

1Skills CLI (Vercel)

npx skills add Mindrally/skills --skill prisma-development -a claude-code

2Manually: put the files in place

~/.claude/skills/prisma-development/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/prisma-development/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about prisma-development

How do I install prisma-development in Claude?

Run npx skills add Mindrally/skills --skill prisma-development -a claude-code. The skill then lives at ~/.claude/skills/prisma-development/SKILL.md.

What does prisma-development do?

It hands the agent a rulebook for Prisma ORM with TypeScript: schema design, client usage, migrations and error handling. The agent follows it while writing or editing code.

Which Prisma errors does the skill cover?

PrismaClientKnownRequestError for constraint violations, PrismaClientUnknownRequestError for unexpected database errors and PrismaClientValidationError for schema mismatches.

Source text

SKILL.md · Apache-2.0
---
name: prisma-development
description: Comprehensive Prisma ORM development guidelines with TypeScript, schema design, migrations, and best practices.
metadata:
  maintainer: Mindrally
  source: https://github.com/Mindrally/skills
---

# Prisma ORM Development

You are an expert in Prisma ORM development with TypeScript.

## TypeScript Fundamentals

### Basic Principles
- Always declare explicit types for variables and functions
- Avoid using 'any'
- Leverage JSDoc for public APIs
- Maintain single exports per file
- Prioritize self-documenting code

### Naming Conventions
- PascalCase for classes/interfaces
- camelCase for variables and methods
- kebab-case for files/directories
- UPPERCASE for constants
- Verb-based boolean names (isLoading, hasError, canDelete)

## Function Design

- Aim for less than 20 lines of code per function
- Single responsibility per function
- Implement early returns
- Extract complex logic into separate functions
- Leverage functional patterns (map, filter, reduce)
- Use object parameters for multiple arguments

## Data & Error Handling

- Encapsulate data in composite types with immutability preference
- Use `readonly` and `as const` appropriately
- Validate at boundaries
- Employ specific, descriptive error types with contextual messaging

## Prisma-Specific Practices

### Schema Design
- Domain-driven naming for models and fields
- Explicit relations using `@relation`
- Normalized structures where appropriate
- Soft deletes via `deletedAt` field
- Native type decorators for database-specific types

### Client Usage
- Always use type-safe Prisma client operations
- Use transactions for complex flows
- Implement middleware for logging, soft deletes, and auditing
- Use `select` and `include` judiciously to avoid over-fetching

### Migrations
- Create descriptive migrations with clear naming
- Never modify existing migrations
- Ensure idempotency for all migrations
- Test migrations on staging before production

### Error Handling
- Catch `PrismaClientKnownRequestError` for constraint violations
- Handle `PrismaClientUnknownRequestError` for unexpected database errors
- Validate with `PrismaClientValidationError` for schema mismatches

## Quality Standards

- Avoid N+1 queries through proper eager loading
- Test with in-memory databases for speed
- Mock Prisma client for unit test isolation
- Never expose raw Prisma clients in APIs
- Validate all user inputs before database operations
- Follow SOLID principles with composition over inheritance

© Mindrally · Apache-2.0 · Mindrally/skills

Similar skills

All skills for Data and databases →

From the same set214

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor