Back to skills
SKILL.md
Nestjs Patterns
ASecurityNestJS best practices: modules, providers, DTO validation, guards, interceptors, exception filters, config and testing.
- 2 stars
- 0 votes
- 0 copies
- 0 views
- Added December 2, 2026
Security analysis
100/100npx -y skills add karthikrshet/saarthi --skill nestjs-patterns --agent claude-codeAre you the author of Nestjs Patterns?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/karthikrshet-nestjs-patterns)---
name: nestjs-patterns
description: "NestJS best practices: modules, providers, DTO validation, guards, interceptors, exception filters, config and testing."
tags: [nestjs, typescript, backend]
---
# Nestjs Patterns
## When to use
- NestJS services
## Procedure
1. One feature module per bounded context
2. Global ValidationPipe with whitelist and transform
3. Guards for auth, interceptors for cross-cutting concerns
4. ConfigModule with schema validation
5. Unit test providers with Test.createTestingModule; e2e with supertest
## Example
```ts
app.useGlobalPipes(new ValidationPipe({ whitelist: true, forbidNonWhitelisted: true, transform: true }));
```
## Checklist
- [ ] No circular module imports
- [ ] All DTOs validated
## Anti-patterns
- Injecting repositories directly into controllers;forwardRef everywhere
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.