From backend-dev
Design or review Prisma database schemas with relations, indexes, and migration strategy
npx claudepluginhub silviaare95/xari-plugins --plugin backend-devThis skill uses the workspace's default tool permissions.
Guides Payload CMS config (payload.config.ts), collections, fields, hooks, access control, APIs. Debugs validation errors, security, relationships, queries, transactions, hook behavior.
Designs, audits, and improves analytics tracking systems using Signal Quality Index for reliable, decision-ready data in marketing, product, and growth.
Enforces A/B test setup with gates for hypothesis locking, metrics definition, sample size calculation, assumptions checks, and execution readiness before implementation.
Design or review the database schema for: $0
Mode: $1 (default: create)
Identify entities — What data models does this feature need? Map relationships (1:1, 1:N, M:N).
Design the Prisma schema — For each model:
String, Int, DateTime, Json, Enum)@relation directives@@index for query patterns@unique or @@uniquedeletedAt DateTime?) if appropriateConsider edge cases:
createdAt, updatedAt, createdBy)Migration strategy — If modifying existing schema:
prisma/schema.prismamodel Example {
id String @id @default(cuid())
name String
email String @unique
posts Post[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([email])
}
Include migration notes if modifying existing schema:
## Migration Notes
- **Breaking**: <yes/no>
- **Backfill needed**: <yes/no — describe>
- **Rollback**: <strategy>
cuid() for IDs by defaultcreatedAt and updatedAt@@index for any field used in WHERE clauses or JOINsJson type unless the shape is truly dynamic