agentsclimarketplace

Nestjs database

Skill dkmqflx/nestjs-best-practices-plugin/plugins/nestjs-best-practices/skills/nestjs-database

Claude Code plugin: 12 NestJS best-practice skills (90 rules) grounded in the official NestJS docs

Install
npx -y skills add dkmqflx/nestjs-best-practices-plugin --skill nestjs-database

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

NestJS database and ORM best practices (TypeORM, Prisma, Mongoose). Use when integrating a database in NestJS — repositories, entities, migrations, transactions, or query performance. Triggers on TypeOrmModule, @InjectRepository, PrismaService, @Entity, migrations, or N+1 queries.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

2.4 KB, as published. Nobody here has run it

NestJS Database & ORM

Best-practices reference for integrating a database into NestJS through TypeORM, Prisma, or Mongoose. Covers async module configuration, repository injection, schema lifecycle (migrations vs synchronize), transactions, relation loading, projection, DTO mapping, and indexing/pagination. Examples favor TypeORM with Prisma notes where the idiom differs.

When to Apply

  • Wiring TypeOrmModule/MongooseModule/PrismaModule with ConfigService
  • Injecting repositories or model services into providers
  • Choosing between synchronize and migrations for schema changes
  • Writing multi-step writes that must be atomic (transactions)
  • Loading relations efficiently (avoiding N+1 queries)
  • Selecting only needed columns / not over-fetching
  • Returning data from controllers without leaking ORM entities
  • Indexing queried columns and paginating large result sets

Rules

  • async-module-config - configure the data layer with forRootAsync + ConfigService; never hardcode credentials
  • repository-pattern - inject repositories/services into providers; keep DB access out of controllers
  • migrations-not-synchronize - set synchronize: false in production and manage schema with migrations
  • transactions-for-multi-write - wrap multi-step writes in a transaction (QueryRunner / dataSource.transaction / prisma.$transaction)
  • avoid-n-plus-one - load relations explicitly (relations/leftJoin/include); never query inside a loop
  • select-needed-columns - project specific fields; avoid SELECT * and over-fetching
  • separate-entities-from-dtos - map ORM entities to response DTOs; don't expose persistence models directly
  • index-and-pagination - index queried columns and paginate large results with take/skip

How to Use

Read individual rule files in rules/ for the rationale plus incorrect/correct examples. Each rule is self-contained; apply the ones relevant to the change you are making. Default to TypeORM idioms; Prisma/Mongoose equivalents are noted inline where they differ.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.