nestjs
Provides comprehensive NestJS framework patterns with Drizzle ORM integration for building scalable server-side applications. Generates REST/GraphQL APIs, implements authentication guards, creates database schemas, and sets up microservices. Use when building NestJS applications, setting up APIs, implementing authentication, working with databases, or integrating Drizzle ORM.
Security Assessment
Detected risks:
About nestjs
NestJS Framework with Drizzle ORM packages a set of production-oriented patterns for building server-side applications with NestJS and the Drizzle ORM. It targets teams standing up REST APIs or GraphQL servers who want a consistent structure for data access, request validation, authentication, and testing rather than assembling those conventions from scratch. The core workflow installs Drizzle and its tooling (drizzle-orm and pg, plus drizzle-kit and tsx as dev dependencies), defines table schemas in src/db/schema.ts, and exposes the Drizzle client through a DatabaseService NestJS provider.
Application code follows a Controller to Service to Repository layering. Controllers accept class-validator DTOs enforced by a global ValidationPipe, services hold business logic, and repositories issue Drizzle queries such as select, insert with returning, and multi-statement transactions for operations that must stay atomic. Route protection is handled with guards, including a JWT authentication guard that verifies a bearer token and attaches the decoded user to the request, and a Roles guard that must run after it. Unit tests use the @nestjs/testing module with repositories replaced by Jest mocks, so services can be verified in isolation. Database changes flow through drizzle-kit generate to produce migration SQL, a manual review of that SQL, and drizzle-kit migrate to apply it.
The skill also encodes guardrails: always validate inputs with DTOs instead of accepting raw objects, keep transactions short and avoid nesting them, never hardcode DATABASE_URL or JWT_SECRET, regenerate migrations after any schema change, and prefer restructuring modules over leaning on forwardRef for circular dependencies. Additional material is split into reference files covering core patterns, guards, interceptors, microservices with TCP or Redis transport, and GraphQL integration, plus a dedicated Drizzle reference and a workflow-optimization guide. Use it when scaffolding new modules, adding JWT-based auth, wiring database access, or setting up microservices in a NestJS codebase.
FAQ
What dependencies does the skill install for Drizzle ORM?
It installs drizzle-orm and pg as runtime dependencies, plus drizzle-kit and tsx as dev dependencies.
What application architecture does it follow?
A Controller to Service to Repository layering, where controllers take validated DTOs, services hold logic, and repositories run Drizzle queries.
How is request validation enforced?
Through class-validator DTOs applied by a global ValidationPipe; raw objects should never be accepted directly.
In what order must the authentication guards run?
The JWT authentication guard must run before the Roles guard.
How are database migrations handled?
Run drizzle-kit generate after schema changes, review the generated SQL, then apply it with drizzle-kit migrate.
Install nestjs
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
giuseppe-trisciuoglio/developer-kit