Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

prisma-queries

verified

Prisma Client query patterns

View on GitHub

Marketplace

alphaagent-team

the-answerai/alphaagent-team

Plugin

aai-stack-prisma

stack

Repository

the-answerai/alphaagent-team

plugins/aai-stack-prisma/skills/prisma-queries/SKILL.md

Last Verified

February 1, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/the-answerai/alphaagent-team/blob/main/plugins/aai-stack-prisma/skills/prisma-queries/SKILL.md -a claude-code --skill prisma-queries

Installation paths:

Claude
.claude/skills/prisma-queries/
Powered by add-skill CLI

Instructions

# Prisma Queries Skill

Patterns for querying data with Prisma Client.

## Basic CRUD

### Create

```typescript
// Create single record
const user = await prisma.user.create({
  data: {
    email: 'john@example.com',
    name: 'John Doe',
  },
})

// Create with relations
const user = await prisma.user.create({
  data: {
    email: 'john@example.com',
    profile: {
      create: { bio: 'Hello!' },
    },
    posts: {
      create: [
        { title: 'First Post' },
        { title: 'Second Post' },
      ],
    },
  },
  include: {
    profile: true,
    posts: true,
  },
})

// Create many
const users = await prisma.user.createMany({
  data: [
    { email: 'user1@example.com' },
    { email: 'user2@example.com' },
  ],
  skipDuplicates: true,
})
```

### Read

```typescript
// Find by ID
const user = await prisma.user.findUnique({
  where: { id: userId },
})

// Find by unique field
const user = await prisma.user.findUnique({
  where: { email: 'john@example.com' },
})

// Find first matching
const user = await prisma.user.findFirst({
  where: { role: 'ADMIN' },
})

// Find many with conditions
const users = await prisma.user.findMany({
  where: {
    role: 'USER',
    createdAt: { gte: new Date('2024-01-01') },
  },
  orderBy: { createdAt: 'desc' },
  take: 10,
  skip: 0,
})

// Find or throw
const user = await prisma.user.findUniqueOrThrow({
  where: { id: userId },
})
```

### Update

```typescript
// Update by ID
const user = await prisma.user.update({
  where: { id: userId },
  data: { name: 'New Name' },
})

// Update many
const result = await prisma.user.updateMany({
  where: { role: 'GUEST' },
  data: { role: 'USER' },
})

// Upsert (create or update)
const user = await prisma.user.upsert({
  where: { email: 'john@example.com' },
  update: { name: 'John' },
  create: { email: 'john@example.com', name: 'John' },
})
```

### Delete

```typescript
// Delete by ID
const user = await prisma.user.delete({
  where: { id: userId },
})

// Delete many
const result 

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
5584 chars