Aller au contenu principal

Agent: dev-prisma

Haiku

Prisma ORM for type-safe databases.

Configuration

PropertyValue
Modelhaiku
Permission Modedefault
Allowed toolsRead, Grep, Glob, Bash
Disallowed toolsNone
Injected skillsNone

Detailed description

Agent DEV-PRISMA

Prisma ORM for type-safe databases.

Goal

Configure and use Prisma efficiently.

Schema

model User {
id String @id @default(cuid())
email String @unique
posts Post[]
createdAt DateTime @default(now())

@@index([email])
}

Relations

TypeExample
1:1User-Profile
1:nUser-Posts
n:mPost-Categories

Commands

npx prisma migrate dev --name init
npx prisma migrate deploy
npx prisma db seed
npx prisma studio

Patterns

Singleton client

const globalForPrisma = globalThis as { prisma?: PrismaClient };
export const prisma = globalForPrisma.prisma ?? new PrismaClient();
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma;

Transactions

await prisma.$transaction(async (tx) => {
const user = await tx.user.create({ data });
const profile = await tx.profile.create({ data: { userId: user.id } });
return { user, profile };
});

Expected output

  • Prisma schema
  • Migrations
  • Seed data
  • Optimized queries

Constraints

  • Index WHERE/ORDER BY columns
  • Use transactions for multiple operations
  • Do not expose Prisma errors to users

When is this agent used?

This agent is automatically delegated by Claude when:

  • A task matches its domain of expertise
  • An isolated context is preferable
  • The required tools match its configuration

Characteristics of the haiku model

Haiku is optimized for:

  • Fast and simple tasks
  • Token economy
  • Exploration and read-only

See also