prisma-expert — субагент для Claude Code: что делает и как установить
Субагент prisma-expert проектирует схемы Prisma, оптимизирует выборки данных и готовит миграции. Помогает писать типобезопасные запросы к реляционным и нереляционным базам данных.
MIT ★ 1 029 обновлён 2025-10-15
.claude/agents/prisma-expert.mdЧто делает prisma-expert
Субагент настраивает работу с Prisma Client и файлами схемы schema.prisma. Он формирует запросы с точечными select и include, чтобы база не отдавала лишние поля, настраивает каскадные удаления и транзакции для сложных операций. При необходимости подбирает сырые SQL-запросы через Prisma.
В конфигурации субагента заложена модель claude-sonnet-4-20250514. Для типобезопасности требуется проект на TypeScript с кодогенерацией Prisma. Без сгенерированных типов агент не сможет проверить совместимость моделей на этапе компиляции.
Какие задачи решает
- спроектировать модели данных и связи в Prisma Schema Language
- оптимизировать выборки через select и include для снижения нагрузки на базу
- подготовить скрипты миграций перед обновлением продакшена
- настроить транзакции и агрегатные функции в Prisma Client
Примеры запросов агенту
- Спроектируй схему Prisma для интернет-магазина с каскадным удалением заказов
- Оптимизируй этот запрос к Prisma Client через include и проверь сгенерированный SQL
- Напиши транзакцию для списания средств и обновления баланса пользователя
Как установить prisma-expert
Вручную: положить файлы
.claude/agents/prisma-expert.mdДля всех проектов — ~/.claude/agents/. Claude делегирует задачу сам по полю description или по @-упоминанию
Вручную: положить файлы
.codex/agents/prisma-expert.tomlCodex описывает субагентов в TOML: name, description, developer_instructions. Текст из Markdown перенесите в developer_instructions вручную. Для всех проектов — ~/.codex/agents/
Вручную: положить файлы
.cursor/agents/prisma-expert.mdCursor понимает и .claude/agents/
По шагам, с командами для каждой платформы: Субагенты Claude Code: как создать, вызвать и не утопить контекст
Вопросы о prisma-expert
Как установить prisma-expert в Claude Code?
Сохраните файл конфигурации субагента по пути .claude/agents/prisma-expert.md внутри вашего репозитория.
Что делает субагент prisma-expert?
Он помогает писать типобезопасные запросы к базе данных, моделировать схемы в Prisma Schema Language, создавать миграции и оптимизировать производительность выборок.
Какую языковую модель использует субагент?
В заголовке субагента явно указана модель claude-sonnet-4-20250514.
Исходный текст
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