Prisma
Write efficient Prisma queries, design schemas, and avoid common ORM pitfalls.
Why use this skill?
Master your Prisma ORM workflow. Get expert help with schema design, N+1 query prevention, transaction management, and safe database migrations.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/ivangdavila/prismaWhat This Skill Does
Prisma is a sophisticated OpenClaw AI agent skill designed to assist developers in architecting, querying, and optimizing their Prisma ORM implementations. It serves as an expert consultant for schema design, query efficiency, and troubleshooting common ORM performance pitfalls. By leveraging deep domain knowledge of the Prisma ecosystem, the agent provides actionable guidance on avoiding N+1 query issues, handling complex transactions, and maintaining strict TypeScript type safety within your data access layer.
Installation
To integrate this skill into your environment, use the following command:
clawhub install openclaw/skills/skills/ivangdavila/prisma
Use Cases
- Schema Review: Analyze existing Prisma schemas for potential bottlenecks, inefficient ID types, or suboptimal relation structures.
- Performance Tuning: Identify and resolve N+1 query patterns by optimizing
includestatements, usingselectfragments, or implementing efficient transaction blocks. - Migration Assistance: Safely manage database schema evolution while avoiding data loss or prolonged table locking during large-scale migrations.
- TypeScript Integration: Enforce strict typing in complex raw queries or nested relation responses to minimize runtime errors.
Example Prompts
- "I'm experiencing an N+1 query issue in my User dashboard. Can you review this loop and show me how to refactor it using
findManyandinclude?" - "I need to add a new field to my enum. How can I safely perform this migration without causing downtime in my production database?"
- "Can you help me write an interactive transaction that updates a balance and records a transaction log, ensuring it handles potential concurrency conflicts?"
Tips & Limitations
- Schema Design: Prefer
cuid()overuuid()for better performance and URL safety. Always explicitly define join tables for many-to-many relationships if you intend to add metadata to those relations. - Transaction Management: Remember that interactive transactions keep a database connection open. Keep the logic inside
$transaction(async (tx) => {})as lean as possible. Always set appropriate timeouts for complex operations. - Migration Safety: Never use
prisma db pushin production; it can lead to silent data loss. Stick toprisma migrate devfor development and version-controlled migration files for staging and production deployments. - Type Safety: Use
Prisma.validatorto define reusable query fragments. Be aware that raw queries returnunknown[], so manual type assertions are necessary to maintain the integrity of your TypeScript codebase.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-ivangdavila-prisma": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: code-execution
Related Skills
Animations
Create performant web animations with proper accessibility and timing.
Arduino
Develop Arduino projects avoiding common wiring, power, and code pitfalls.
Bulgarian
Write Bulgarian that sounds human. Not formal, not robotic, not AI-generated.
Arabic
Write Arabic that sounds human. Not formal, not robotic, not AI-generated.
Assistant
Manage tasks, communications, and scheduling with proactive and organized support.