NestJS

Provide best practices for NestJS dependency injection, validation, and testing.

Updated Mar 7, 2026
One-click install
npx skills add https://github.com/PinpongTp/superblue-v1 --skill nestjs-pinpongtp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: NestJS
Source: https://github.com/PinpongTp/superblue-v1/tree/main/skills/nestjs
Command: npx skills add https://github.com/PinpongTp/superblue-v1 --skill nestjs-pinpongtp

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill helps developers avoid common NestJS mistakes, enhancing the efficiency and reliability of their applications.

Core Features & Use Cases

  • Dependency Injection: Offers guidance on proper scoping, avoiding circular dependencies, and using validation pipes.
  • Module Organization: Details best practices for module imports, exports, and the use of global modules.
  • Validation: Explains how to use ValidationPipe effectively, including decorators and auto-transformation.
  • Execution Order: Describes the sequence of middleware, guards, interceptors, pipes, handlers, filters, and exception handling.
  • Exception Handling: Provides information on custom exceptions and handling unhandled exceptions.
  • Testing: Includes tips for testing NestJS applications, including mocking and E2E testing.
  • Common Mistakes: Lists common errors and their solutions, such as proper use of DTOs, guards, and async services.

Quick Start

Use the NestJS skill to understand how to avoid a common circular dependency issue in your NestJS application.

Frequently Asked Questions about NestJS

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I resolve a circular dependency in NestJS modules?

To resolve a circular dependency in NestJS, you must properly scope your dependency injection and use forward references. This Skill provides best practices to restructure module organization and break circular cycles for maintainable applications.

What is the execution order of middleware, guards, and interceptors in NestJS?

The execution order in NestJS follows a strict sequence: middleware, guards, interceptors, pipes, handlers, and finally exception filters. Understanding this flow is essential for effective validation and custom exception handling.

How do I use ValidationPipe effectively with DTOs in NestJS?

Using ValidationPipe effectively in NestJS requires applying validation decorators to your DTOs and enabling auto-transformation. This Skill explains how to configure these pipes to validate input data and avoid common mistakes.

What's the best way to test NestJS applications including mocking and E2E?

The best way to test NestJS applications involves structured unit testing with mocking and comprehensive E2E testing. This Skill provides actionable tips for setting up tests to ensure your dependency injection and modules function reliably.

Why does my NestJS application throw unhandled exceptions despite having custom exceptions?

Unhandled NestJS exceptions occur when custom exception filters are not properly registered or scoped. This Skill offers guidance on configuring exception handling to catch unhandled errors and return robust application responses.