nest-data-layer

nest-data-layer is a skill for Claude Code from AratKruglik/claude-sdlc. It costs 137 tokens per session (2,944 once invoked), scanned A, original, MIT.

A guide to connecting NestJS, a Node.js server framework, to databases through TypeORM, Prisma or Mongoose. An ORM lets code work with database records using familiar application structures.

In plain words
What is it for?
Use it when defining entities or schemas, setting up repositories, handling transactions and migrations, or diagnosing common database problems in a NestJS project.
Why use it?
It helps avoid mixing database patterns or missing important details such as transaction boundaries, migrations, inefficient queries and unwanted cascade deletes.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the nestjs-plugin plugin — 5 skills, 1 agent shipped together

Good fit Use it when defining entities or schemas, setting up repositories, handling transactions and migrations, or diagnosing common database problems in a NestJS project.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aratkruglik/claude-sdlc/nest-data-layer
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.

Any agent
npx skills add AratKruglik/claude-sdlc --skill nest-data-layer
Clone the repo
git clone --depth 1 https://github.com/AratKruglik/claude-sdlc

Made for: Claude Code.

Or install nestjs-plugin, the plugin that ships this one along with the rest of its 5 skills, 1 agent.

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 nest-data-layer

README.md
[![agentmods](https://agentmods.dev/badge/skills/aratkruglik/claude-sdlc/nest-data-layer/github.svg)](https://agentmods.dev/skills/aratkruglik/claude-sdlc/nest-data-layer)
Your own site
<a href="https://agentmods.dev/skills/aratkruglik/claude-sdlc/nest-data-layer"><img src="https://agentmods.dev/badge/skills/aratkruglik/claude-sdlc/nest-data-layer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for nest-data-layer

Your own site · 80×15
<a href="https://agentmods.dev/skills/aratkruglik/claude-sdlc/nest-data-layer"><img src="https://agentmods.dev/badge/skills/aratkruglik/claude-sdlc/nest-data-layer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 137 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,944 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 6 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 165
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 168
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 171
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 268
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 269
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 270
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
How audits are shown
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.1 $0.00137 $0.02944
Opus 5 $0.00068 $0.01472
Sonnet 5 $0.00027 $0.00589
Haiku 4.5 $0.00014 $0.00294

Measured 11d ago against content hash 8db2d1f46d07, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

nest-data-layer 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 11d 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.

plugins/nestjs-plugin/skills/nest-data-layer/SKILL.md · 393 lines

How it starts

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

NestJS Data Layer

This skill consolidates ORM patterns for the three most common choices in NestJS projects: TypeORM, Prisma, Mongoose. Detect which is in use, then apply the matching section.

Detection

Marker (in dependencies) ORM
@nestjs/typeorm + typeorm TypeORM
@prisma/client + prisma Prisma
@nestjs/mongoose + mongoose Mongoose
(multiple) Hybrid project — match each feature's existing pattern
(none) Raw driver (pg, mysql2) — flag in DECISIONS

TypeORM

Module setup

// src/app.module.ts
@Module({
  imports: [
    TypeOrmModule.forRootAsync({
      imports: [ConfigModule],
      inject: [ConfigService],
      useFactory: (config: ConfigService) => ({
        type: 'postgres',
        url: config.get<string>('DATABASE_URL'),
        autoLoadEntities: true,
        synchronize: false,                 // NEVER true in prod — use migrations
        migrations: ['dist/migrations/*.js'],
        migrationsRun: false,
        logging: config.get<string>('NODE_ENV') !== 'production',
      }),
    }),
  ],
})

Entity

// src/users/entities/user.entity.ts
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, Index, OneToMany } from 'typeorm';

@Entity('users')
export class User {
  @PrimaryGeneratedColumn('uuid')
  id!: string;

  @Index({ unique: true })
  @Column({ length: 255 })
  email!: string;

  @Column({ select: false })            // hash never selected by default
  passwordHash!: string;

  @Column({ type: 'jsonb', default: {} })
  metadata!: Record<string, unknown>;

  @CreateDateColumn()
  createdAt!: Date;

  @UpdateDateColumn()
  updatedAt!: Date;

  @OneToMany(() => Order, (order) => order.user)
  orders!: Order[];
}
  • select: false for sensitive columns (passwords, tokens) — must explicitly .addSelect('user.passwordHash').
  • @Index({ unique: true }) instead of @Column({ unique: true }) for clarity at index level.
  • Use relations array on find options (not eager: true) — eager loading is hard to opt out of later.

Read the full file on GitHub · 393 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. 11d ago First seen · 393 lines · 137 tokens per session scan A 8db2d1f46d07

Subscribe to this mod's changes

nest-data-layer is a skill published in the GitHub repository AratKruglik/claude-sdlc (33 stars, last pushed 6d ago), licensed MIT. It adds 137 tokens to every session and 2,944 once invoked, about $0.0007 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

dynamic

Fullstack development with bkend.ai BaaS — authentication, database, API integration. Triggers: fullstack, BaaS, login, signup, database, web app.

ww-w-ai/bkit-claude-code · 38 tokens

nodejs-init-skill

A setup assistant for creating Node.js web services with the Express framework. It checks the environment, installs needed tools, and generates a ready-to-run project with authentication, file uploads, API documentation, and database choices.

jiushiwon/wg-skills · 219 tokens

fastapi-init-skill

A tool that creates a complete FastAPI web-service starting point, including database choices, login protection, file uploads, streaming responses, API documentation, and start or restart scripts.

jiushiwon/wg-skills · 229 tokens

ring:mapping-service-resources

Mapping a Go service's Service -> Module -> Resource hierarchy for dispatch-layer registration: detects modules and per-module PostgreSQL/MongoDB/RabbitMQ resources, database names, and shared databases, generates MongoDB index migration pairs (.up.json/.down.json), detects existing Postgres migrations, emits an HTML…

LerianStudio/ring · 97 tokens

mongodb-development

MongoDB development guidelines with Payload CMS, Mongoose, aggregation pipelines, and TypeScript best practices.

Mindrally/skills · 23 tokens

google-firebase-ninja

Master orchestrator for 18+ Firebase agent skills from official Google repositories. Use when working with Firebase, Firestore, Firebase Auth, Firebase Hosting, Cloud Functions, Firebase Extensions, or any Firebase backend task. Routes to the optimal specialized skill based on context. Triggers: Firebase, Firestore…

fabricioctelles/jump-skills · 98 tokens