Skip to content
Back to skills

Nestjs Patterns

ASecurity

NestJS 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
ai-agentstypescripttestingbackend

Security analysis

A100/100

Scanned December 2, 2026

npx -y skills add karthikrshet/saarthi --skill nestjs-patterns --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Nestjs Patterns?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Nestjs Patterns
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/karthikrshet-nestjs-patterns/badge)](https://www.skillsdirectory.com/skills/karthikrshet-nestjs-patterns)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.