nestjs-patterns

Provide architectural patterns and best practices for NestJS applications.

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/ps-carvalho/spavn-agents --skill nestjs-patterns-ps-carvalho
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nestjs-patterns
Source: https://github.com/ps-carvalho/spavn-agents/tree/main/.opencode/skills/nestjs-patterns
Command: npx skills add https://github.com/ps-carvalho/spavn-agents --skill nestjs-patterns-ps-carvalho

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive patterns and best practices for building robust, scalable, and maintainable server-side applications using the NestJS framework.

Core Features & Use Cases

  • Architectural Guidance: Demonstrates best practices for modules, controllers, providers, and DTOs.
  • Request Pipeline: Explains the flow of requests through middleware, guards, interceptors, and pipes.
  • Microservices & Testing: Covers patterns for building microservices and effective testing strategies.
  • Use Case: A developer starting a new NestJS project can use this skill to quickly set up a well-structured application with clear patterns for authentication, data validation, and request handling.

Quick Start

Use the nestjs-patterns skill to generate a basic NestJS project structure with common modules and controllers.

Frequently Asked Questions about nestjs-patterns

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

FAQPage Schema
How do I structure a scalable NestJS backend with modules and dependency injection?

NestJS request pipeline components process incoming HTTP requests sequentially through middleware, guards for authorization, interceptors for mapping, and pipes for data validation and transformation before hitting route handlers.

How do I implement data validation and custom decorators in a NestJS API?

Implement data validation in a NestJS API by using pipes to validate DTOs against defined rules. You can create custom decorators to attach specific metadata for reusable parameter or route processing logic.

What are the best practices for building microservices with NestJS?

Set up a new NestJS project by generating a base structure with standard modules, controllers, and providers. Configure the request pipeline with guards and interceptors to establish clear patterns for authentication and request handling.

Does this NestJS architecture guidance cover testing strategies for TypeScript backend applications?

Yes, this NestJS architecture guidance covers testing strategies for TypeScript backend applications. It provides patterns for unit and integration testing to ensure your modules and microservices remain robust and maintainable.