Prisma 6 ORM patterns, client management, query optimization, and security best practices based on real-world AI coding failures
/plugin marketplace add djankies/claude-configs
/plugin install prisma-6@djankies/claude-configs
Configure connection pool sizing for optimal performance. Use when configuring DATABASE_URL or deploying to production.
Configure PrismaClient for serverless (Next.js, Lambda, Vercel) with connection_limit=1 and global singleton pattern.
Configure transaction isolation levels to prevent race conditions and handle concurrent access. Use when dealing with concurrent updates, financial operations, inventory management, or when users mention race conditions, dirty reads, phantom reads, or concurrent modifications.
Prevent multiple PrismaClient instances that exhaust connection pools causing P1017 errors. Use when creating PrismaClient, exporting database clients, setting up Prisma in new files, or encountering connection pool errors. Critical for serverless environments.
Deploy migrations to production safely using migrate deploy in CI/CD. Use when setting up production deployment pipelines.
Use Prisma's generated types, `Prisma.validator`, and `GetPayload` for type-safe queries.
Handle transaction errors properly with P-code checking and timeout configuration. Use when implementing transaction error recovery.
Implement query result caching with Redis and proper invalidation strategies for Prisma 6. Use when optimizing frequently accessed data, improving read-heavy application performance, or reducing database load through caching.
Implement cursor-based or offset pagination for Prisma queries. Use for datasets 100k+, APIs with page navigation, or infinite scroll/pagination mentions.
Manage PrismaClient lifecycle with graceful shutdown, proper disconnect timing, and logging configuration. Use when setting up application shutdown handlers, configuring logging for development or production, or implementing proper connection cleanup in Node.js servers, serverless functions, or test suites.
Use migrate dev for versioned migrations; db push for rapid prototyping. Use when developing schema changes locally.
Optimize queries with indexes, batching, and efficient Prisma operations for production performance.
Optimize queries by selecting only required fields and avoiding N+1 problems. Use when writing queries with relations or large result sets.
Prevent leaking database errors and P-codes to clients. Use when implementing API error handling or user-facing error messages.
Prevent SQL injection by using $queryRaw tagged templates instead of $queryRawUnsafe. Use when writing raw SQL queries or dynamic queries.
Review Prisma code for common violations, security issues, and performance anti-patterns found in AI coding agent stress testing. Use when reviewing Prisma Client usage, database operations, or performing code reviews on projects using Prisma ORM.
Migrate from Prisma 5 to Prisma 6 handling breaking changes including Buffer to Uint8Array, implicit m-n PK changes, NotFoundError to P2025, and reserved keywords. Use when upgrading Prisma, encountering Prisma 6 type errors, or migrating legacy code.
Use interactive transactions with $transaction callback for atomic operations and automatic rollback. Use when operations must succeed or fail together.
Validate all external input with Zod before Prisma operations. Use when accepting user input, API requests, or form data.
Claude Agent SDK Development Plugin
Comprehensive toolkit for developing Claude Code plugins. Includes 7 expert skills covering hooks, MCP integration, commands, agents, and best practices. AI-assisted plugin creation and validation.
Implementation of the Ralph Wiggum technique - continuous self-referential AI loops for interactive iterative development. Run Claude in a while-true loop with the same prompt until task completion.
Comprehensive feature development workflow with specialized agents for codebase exploration, architecture design, and quality review