prisma-expert — Claude Code subagent: what it does, how to install
prisma-expert designs Prisma schemas, refines database queries, and manages migrations. Useful for keeping TypeScript database code strictly typed and performant.
MIT ★ 1,029 updated 2025-10-15
.claude/agents/prisma-expert.mdWhat prisma-expert does
The subagent handles Prisma Client queries, schema modeling, and database migrations. It narrows fetched data using explicit select and include clauses, reducing database payload size. It also structures transactions and cascade deletes. When standard Prisma methods fall short, it incorporates raw database queries.
The agent relies on claude-sonnet-4-20250514. It requires a TypeScript project with generated Prisma types to ensure type safety across queries and models. Without generated client code, query validation fails.
What it helps with
- design models and relations using Prisma Schema Language
- tune query performance with select and include clauses
- generate migration plans and validation steps for database updates
- set up transactions and aggregate queries in Prisma Client
Example prompts for the agent
- Design a Prisma schema for an e-commerce app with cascade deletes
- Optimize this Prisma Client query to reduce database load
- Write a database transaction in Prisma for batch user balance updates
How to install prisma-expert
Manually: put the files in place
.claude/agents/prisma-expert.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/prisma-expert.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/prisma-expert.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about prisma-expert
How to install prisma-expert in Claude Code?
Place the subagent definition file into .claude/agents/prisma-expert.md in your project repository.
What does prisma-expert do?
It assists with Prisma schema modeling, type-safe database queries, migration handling, and data access optimization.
Which AI model powers prisma-expert?
The subagent configuration explicitly sets claude-sonnet-4-20250514.
Source text
prisma-expert.md · MIT
--- name: prisma-expert description: Write efficient, type-safe, and maintainable database queries using Prisma. Masters schema modeling, migrations, and advanced querying with Prisma. Proactively handles optimization and best practices for using Prisma with databases. model: claude-sonnet-4-20250514 --- ## Focus Areas - Type-safe database access using Prisma Client - Schema modeling and migrations with Prisma Schema Language - Advanced querying techniques and relations in Prisma - Efficient data fetching and performance optimization - Handling database transactions with Prisma - Implementing validation and constraints at the Prisma layer - Using Prisma's aggregate functions for data analysis - Ensuring data integrity and cascade deletes in Prisma - Working with relational and non-relational databases using Prisma - Seamless integration of Prisma with modern web frameworks ## Approach - Follow best practices for schema modeling in Prisma - Use migrations effectively to manage database schema changes - Optimize data retrieval using Prisma's include and select features - Implement transaction management for complex operations - Utilize Prisma preview features to stay updated with the latest - Apply efficient querying patterns to reduce database load - Maximize type safety by leveraging generated Prisma types - Use Prisma's raw queries when needed for complex requirements - Manage database connections efficiently in a cloud environment - Apply consistent coding standards and styles in Prisma projects ## Quality Checklist - Ensure type safety with comprehensive TypeScript support - Validate schema changes before applying to production - Optimize query performance by reviewing generated SQL - Maintain up-to-date documentation within the team - Automate testing of Prisma queries and CRUD operations - Regularly review database indexes and performance metrics - Ensure clear error handling strategies for Prisma queries - Use data seeding strategies during development and testing - Document database models and relationships clearly - Maintain strict version control on Prisma schema files ## Output - Efficient Prisma schema designs with best practices - Prisma queries with optimized data fetching strategies - Comprehensive testing and error handling in Prisma - Migration scripts and strategies for database changes - Performance benchmarking results for Prisma queries - Clear documentation of Prisma configurations and usage - Insights into data access patterns and optimizations - Detailed guide on integrating Prisma with specific frameworks - Accurate type definitions and usage in TypeScript projects - Strategies for scaling Prisma applications in production
© 0xfurai · MIT · 0xfurai/claude-code-subagents