nestjs-prisma

nestjs-prisma is a skill for Claude Code, Codex from drvoss/everything-copilot-cli. It costs 33 tokens per session (796 once invoked), scanned A, original, MIT.

A guide for combining NestJS, a Node.js framework for server applications, with Prisma, a tool for accessing databases from code. It covers a shared Prisma service, data-access patterns, and unit tests using Prisma mocks.

In plain words
What is it for?
Use it when setting up Prisma in a NestJS project, creating repositories or data-access layers, injecting Prisma into feature services, or testing database-dependent services.
Why use it?
It gives a consistent way to connect NestJS services to a database and manage the database client’s connection lifecycle. It also addresses testing services without requiring a real database connection.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/drvoss/everything-copilot-cli/nestjs-prisma
Any agent
npx skills add drvoss/everything-copilot-cli --skill nestjs-prisma
Clone the repo
git clone --depth 1 https://github.com/drvoss/everything-copilot-cli

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for nestjs-prisma

README.md
[![agentmods](https://agentmods.dev/badge/skills/drvoss/everything-copilot-cli/nestjs-prisma.svg)](https://agentmods.dev/skills/drvoss/everything-copilot-cli/nestjs-prisma)
Your own site
<a href="https://agentmods.dev/skills/drvoss/everything-copilot-cli/nestjs-prisma"><img src="https://agentmods.dev/badge/skills/drvoss/everything-copilot-cli/nestjs-prisma.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 796 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00033 $0.00796
Opus 5 $0.00016 $0.00398
Sonnet 5 $0.00007 $0.00159
Haiku 4.5 $0.00003 $0.00080

Measured 3d ago against content hash 38e06ad64df3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

nestjs-prisma scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/development/nestjs-prisma/SKILL.md · 140 lines

How it starts

The opening of the file, as written. The whole thing — 140 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

// 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.

2. Using PrismaService in a Feature Service

// 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

// 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)
  })
})

Read the full file on GitHub · 140 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 140 lines · 33 tokens per session scan A 38e06ad64df3

Subscribe to this mod's changes

nestjs-prisma is a skill published in the GitHub repository drvoss/everything-copilot-cli (45 stars, last pushed 7d ago), licensed MIT. It adds 33 tokens to every session and 796 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

data-access-abstraction

Data access abstraction patterns for apps that need to swap between local databases (SQLite) and cloud databases (Cosmos DB, PostgreSQL) without changing application code. Covers Node.js/TypeScript, Python/FastAPI, and .NET. Use when building apps that run locally with SQLite and deploy to Azure with Cosmos DB or…

DanWahlin/github-azure-agentic-journeys · 73 tokens

n8n-azure

Application-specific configuration for deploying n8n to Azure Container Apps with PostgreSQL. Infrastructure should be generated fresh by the azure-prepare → azure-validate → azure-deploy pipeline.

DanWahlin/github-azure-agentic-journeys · 27 tokens

persisting-data-with-drift

Implements type-safe reactive SQL persistence in Flutter using Drift v2.32 (formerly Moor) built on SQLite with automatic code generation. Activates when defining table schemas with Drift DSL, writing type-safe join or subquery operations, handling schema migrations with MigrationStrategy, using reactive watch()…

Poorgramer-Zack/dart-expert-skills · 136 tokens

managing-hive-storage

Hive CE (Community Edition v2.19.x) NoSQL object database for Flutter providing blazing-fast key-value and object storage with TypeAdapters. Use this skill when implementing offline-first architecture, high-performance local data caching, NoSQL document-style object stores, custom TypeAdapter serialization for complex…

Poorgramer-Zack/dart-expert-skills · 146 tokens

flutter-db

Local database and persistence selection for Flutter including SharedPreferences, SecureStorage, Hive, and Drift. Use when implementing offline storage, encrypted data persistence, or choosing between key-value and relational local databases.

Poorgramer-Zack/dart-expert-skills · 42 tokens

developing-serverpod-backend

Develops full-stack Dart backends using the Serverpod framework with PostgreSQL, Redis, and Docker. Use when building type-safe API endpoints, defining YAML data models, configuring Serverpod auth, writing server-side tests, running database migrations, deploying to Docker/AWS/GCP, or using Serverpod Mini for…

Poorgramer-Zack/dart-expert-skills · 76 tokens