/everything-copilot-cli:nestjs-prismafrom everything-copilot-cli
Sets up Prisma in NestJS as an injectable singleton PrismaService, implements repository pattern, and provides testing with Prisma mocks.
Ships in everything-copilot-cli. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
// 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()
}
}
// 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.
// 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 })
}
}
// 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)
})
})
# 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/frameworks/nestjs.md — module structure, DI, controllers, securityrules/frameworks/prisma.md — schema design, client lifecycle, query safetyrules/common/security.md — secrets, input validationWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub drvoss/everything-copilot-cli --plugin everything-copilot-cli115 skills in this plugin
/actions-debuggingUse when a GitHub Actions workflow fails — diagnose the run log, identify the root cause, and apply a targeted fix/add-to-changelogUse when you've shipped a feature, fix, or breaking change and need to update CHANGELOG.md — follows Keep a Changelog format and syncs version numbers across package manifests./agent-governanceUse when designing or reviewing an AI agent system that needs policy-based access controls, intent classification, tool-level rate limiting, trust scoring for multi-agent workflows, or append-only audit trails.
Other plugins' skills for the same job