/prisma-6:reviewing-prisma-patternsfrom prisma-6
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.
Ships in prisma-6. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill performs systematic code review of Prisma usage, catching critical violations, security vulnerabilities, and performance anti-patterns identified through comprehensive stress testing of AI coding agents.
Each violation includes severity rating, remediation steps, and reference to detailed Prisma 6 skills.
## Standard Review WorkflowPhase 1: Discovery
Find all Prisma usage:
Identify project context:
Phase 2: Critical Issue Detection
Run validation checks in order of severity:
Phase 3: Report Generation
1. SQL Injection Detection
grep -rn "\$queryRawUnsafe\|Prisma\.raw" --include="*.ts" --include="*.js" .
Red flag: String concatenation with user input
Fix: Use $queryRaw tagged template
2. Multiple PrismaClient Instances
grep -rn "new PrismaClient()" --include="*.ts" --include="*.js" . | wc -l
Red flag: Count > 1 Fix: Global singleton pattern
3. Missing Serverless Configuration
grep -rn "connection_limit=1" --include="*.env*" .
Red flag: No connection_limit in serverless app
Fix: Add ?connection_limit=1 to DATABASE_URL
4. Deprecated Buffer API
grep -rn "Buffer\.from" --include="*.ts" --include="*.js" . | grep -i "bytes"
Red flag: Buffer usage with Prisma Bytes fields Fix: Use Uint8Array instead
See references/validation-checks.md for complete validation patterns with examples.
Step 1: Find Prisma Files
find . -type f \( -name "*.ts" -o -name "*.js" \) -exec grep -l "@prisma/client" {} \;
Step 2: Run All Checks
Execute checks in severity order (P0 → P3):
Step 3: Generate Report
Format:
Prisma Code Review - [Project Name]
Generated: [timestamp]
CRITICAL Issues (P0): [count]
HIGH Issues (P1): [count]
MEDIUM Issues (P2): [count]
LOW Issues (P3): [count]
---
[P0] SQL Injection Vulnerability
File: src/api/users.ts:45
Impact: CRITICAL - Enables SQL injection attacks
Fix: Use $queryRaw tagged template
Reference: @prisma-6/SECURITY-sql-injection
[P0] Multiple PrismaClient Instances
Files: src/db.ts:3, src/api/posts.ts:12
Count: 3 instances found
Impact: CRITICAL - Connection pool exhaustion
Fix: Use global singleton pattern
Reference: @prisma-6/CLIENT-singleton-pattern
## Report Format
Provide structured review with:
Summary:
Detailed Findings: For each issue:
Remediation Priority:
MUST:
SHOULD:
NEVER:
For detailed information on specific topics:
references/validation-checks.md for all 7 validation patterns with detailed examplesreferences/example-reviews.md for complete review examples (e-commerce, dashboard)Load references when performing deep review or encountering specific violation patterns.
## Review ValidationAfter generating review:
Verify Findings:
Test Remediation:
Completeness Check:
Integration: This skill is discoverable by the review plugin via review: true frontmatter. Invoke with /review prisma-patterns or automatically when reviewing Prisma-based projects.
Performance: Review of typical project (50 files) completes in < 10 seconds using grep-based pattern matching.
Updates: As new Prisma violations emerge, add patterns to validation checks with corresponding skill references.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub djankies/claude-configs --plugin prisma-6Other plugins' skills for the same job
19 skills in this plugin
/configuring-connection-poolsConfigure connection pool sizing for optimal performance. Use when configuring DATABASE_URL or deploying to production./configuring-serverless-clientsConfigure PrismaClient for serverless (Next.js, Lambda, Vercel) with connection_limit=1 and global singleton pattern./configuring-transaction-isolationConfigure 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.