Skip to content
Back to skills

Nestjs

ASecurity

NestJS — module boundaries, providers and DI scopes, controllers with DTO validation (ValidationPipe), guards and interceptors, exception filters, configuration module, testing module with overrides, microservice transports, avoiding circular dependencies. Use for NestJS services (NestJS, module, provider, guard, interceptor, DTO).

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentsgotestingperformance

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add vectora-os/kit --skill nestjs --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Nestjs?

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

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

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
description: NestJS — module boundaries, providers and DI scopes, controllers with DTO validation (ValidationPipe), guards and interceptors, exception filters, configuration module, testing module with overrides, microservice transports, avoiding circular dependencies. Use for NestJS services (NestJS, module, provider, guard, interceptor, DTO).
metadata:
  category: languages-frameworks
---

# NestJS

## Purpose

Structure NestJS applications with clear modules, validated input and testable providers.

**Use when:** building or reviewing NestJS code.

**Not for:** framework choice (`decision-analyst`).

## Inputs

- Service design, code.

## Outputs

- Modules, providers, tests, review findings.

## Read first

- [Project Brain](../../../project-brain/README.md) — `npm run brain -- query "nestjs"` for prior decisions, patterns and anti-patterns.

## Steps

1. **Modules.** One module per bounded context; export only the public providers.
   Done when no deep imports across modules.
2. **Input.** Global `ValidationPipe` with whitelist and forbidNonWhitelisted; DTOs per endpoint.
   Done when unknown fields are rejected.
3. **Cross-cutting.** Auth in guards, logging/tracing in interceptors, errors in filters.
   Done when controllers stay thin.
4. **Tests.** `Test.createTestingModule` with overridden providers; e2e with supertest.
   Done when critical paths have e2e tests.

## Best practices

- Default singleton scope; request scope only when needed (performance).
- Use `forwardRef` as a smell detector, not a fix.

## Common mistakes

- Business logic in controllers.
- Circular module imports.

## Example

`BillingModule` exports `InvoiceService`; `RolesGuard` checks scope; DTO `CreateInvoiceDto` with class-validator.

## Reusable prompt

```text
Apply the NestJS skill (.agents/skills/nestjs/SKILL.md).
Context: {{task card or question; links to PRD, ADRs, code paths}}
Constraints: {{approved thresholds, deadlines, allowed files}}
Structure or review the NestJS code: module boundaries, DTO validation, guards/interceptors and tests.
Return: Modules, providers, tests, review findings..
Cite evidence (file:line, command output, source) for every claim; list open questions separately.
```

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.