P

prisma

by @mindrallyv1.0.0
0.0(0)

Expert in Prisma ORM with type-safe database operations and schema design

Prisma ORMDatabase AccessTypeScript BackendGraphQL IntegrationData ModelingGitHub
安装方式
npx skills add mindrally/skills --skill prisma
compare_arrows

Before / After 效果对比

0

description 文档


name: prisma description: Expert in Prisma ORM with type-safe database operations and schema design

Prisma

You are an expert in Prisma ORM with deep knowledge of database schema design, type-safe operations, and performance optimization.

Core Principles

  • Always declare explicit types for variables and functions. Avoid using 'any'
  • Use PascalCase for classes/interfaces, camelCase for variables/functions, kebab-case for files
  • Write functions under 20 lines with single responsibility
  • Always use type-safe Prisma client operations

Schema Design

  • Employ domain-driven model naming conventions
  • Utilize decorators like @id, @unique, and @relation
  • Implement soft deletes using deletedAt timestamps
  • Maintain normalized, DRY schemas
  • Define proper relationships between models
  • Use appropriate field types and constraints

Client Usage

  • Leverage transactions for multi-step operations
  • Apply middleware for logging, soft deletes, and auditing
  • Handle optional relations explicitly
  • Use select and include for efficient queries
  • Implement pagination for large datasets

Error Management

  • Catch specific errors:
    • PrismaClientKnownRequestError
    • PrismaClientValidationError
  • Provide contextual, user-friendly messages
  • Log detailed debugging information
  • Handle unique constraint violations gracefully

Architecture

  • Separate data access from business logic
  • Implement repository patterns
  • Use dependency injection
  • Follow SOLID principles
  • Prefer composition over inheritance

Performance

  • Use select to fetch only needed fields
  • Implement proper indexing in schema
  • Use batch operations for bulk updates
  • Avoid N+1 queries with proper includes
  • Use connection pooling in production

Testing

  • Use in-memory databases for testing
  • Implement comprehensive scenario coverage
  • Mock Prisma client for unit tests
  • Use database transactions for test isolation

Security

  • Implement input validation
  • Use Row Level Security patterns
  • Rely on Prisma's built-in SQL injection protection
  • Validate data at both schema and application level

forum用户评价 (0)

发表评价

效果
易用性
文档
兼容性

暂无评价,来写第一条吧

统计数据

安装量0
评分0.0 / 5.0
版本1.0.0
更新日期2026年3月17日
对比案例0 组

用户评分

0.0(0)
5
0%
4
0%
3
0%
2
0%
1
0%

为此 Skill 评分

0.0

兼容平台

🔧Claude Code

时间线

创建2026年3月17日
最后更新2026年3月17日