drvoss/everything-copilot-cli/nestjs-prisma

Claude Code and agent skill by drvoss/everything-copilot-cli

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when building a NestJS application with Prisma — covers PrismaService setup as an injectable singleton, repository pattern integration, and testing with Prisma mocks.

Install

npx vskill@latest install drvoss/everything-copilot-cli/nestjs-prisma

SKILL.md

The same SKILL.md was published earlier as drvoss/everything-copilot-cli/nestjs-prisma.

NestJS + Prisma Combo Skill

When to Use

  • Setting up Prisma in a NestJS project for the first time
  • Implementing a data access layer using Prisma as the ORM
  • Writing unit tests for services that depend on Prisma
  • Debugging connection pooling or client lifecycle issues

Workflow

1. PrismaService Setup
typescript
// src/prisma/prisma.service.ts
import { Injectable, OnModuleInit, OnModuleDestroy } from "@nestjs/common"
import { PrismaClient } from "@prisma/client"
@Injectable()
export class PrismaService
extends PrismaClient
implements OnModuleInit, OnModuleDestroy
{
async onModuleInit() {
await this.$connect()
}
async onModuleDestroy() {
await this.$disconnect()
}
}
typescript
// src/prisma/prisma.module.ts
import { Global, Module } from "@nestjs/common"
import { PrismaService } from "./prisma.service"
@Global()
@Module({
providers: [PrismaService],
exports: [PrismaService],
})
export class PrismaModule {}

Import PrismaModule in AppModule once — @Global() makes it available everywhere.

2. Using PrismaService in a Feature Service
typescript
// src/users/users.service.ts
import { Injectable } from "@nestjs/common"
import { PrismaService } from "../prisma/prisma.service"
@Injectable()
export class UsersService {
constructor(private prisma: PrismaService) {}
async findAll() {
return this.prisma.user.findMany({
select: { id: true, name: true, email: true },
})
}
async create(data: { name: string; email: string }) {
return this.prisma.user.create({ data })
}
}
3. Unit Testing with Prisma Mock
typescript
// src/users/users.service.spec.ts
import { Test } from "@nestjs/testing"
import { UsersService } from "./users.service"
import { PrismaService } from "../prisma/prisma.service"
const mockPrismaService = {
user: {
findMany: jest.fn(),
create: jest.fn(),
},
}
describe("UsersService", () => {
let service: UsersService
beforeEach(async () => {
const module = await Test.createTestingModule({
providers: [
UsersService,
{ provide: PrismaService, useValue: mockPrismaService },
],
}).compile()
service = module.get<UsersService>(UsersService)
})
it("returns all users", async () => {
mockPrismaService.user.findMany.mockResolvedValue([{ id: 1, name: "Alice" }])
const result = await service.findAll()
expect(result).toHaveLength(1)
})
})
4. Environment Setup Checklist
bash
# 1. Install
pnpm add @prisma/client
pnpm add -D prisma
# 2. Initialize
pnpm prisma init
# 3. Add DATABASE_URL to .env
# 4. Define schema then migrate
pnpm prisma migrate dev --name init
# 5. Generate client
pnpm prisma generate

Rules Applied

  • rules/frameworks/nestjs.md — module structure, DI, controllers, security
  • rules/frameworks/prisma.md — schema design, client lifecycle, query safety
  • rules/common/security.md — secrets, input validation

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
48
Repository forks
12
7-day trend score
19

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 1 Oct 2026, a month ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/drvoss/everything-copilot-cli/nestjs-prisma/badge)](https://verified-skill.com/skills/drvoss/everything-copilot-cli/nestjs-prisma)

Something wrong with this skill or its page? Tell us.