nestjs-expert

Designs Nest.js architecture including modules, DI, and authentication.

Updated Feb 8, 2026
One-click install
npx skills add https://github.com/alexisg24/claude-agrents-env-tests --skill nestjs-expert-alexisg24
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nestjs-expert
Source: https://github.com/alexisg24/claude-agrents-env-tests/tree/main/environments/nextjs-nestjs-pg-redis-agents/.agents/skills/nestjs-expert
Command: npx skills add https://github.com/alexisg24/claude-agrents-env-tests --skill nestjs-expert-alexisg24

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Nest.js is a powerful framework but architecting scalable, testable enterprise-grade apps can be challenging. This Skill provides guidance on modular architecture, DI patterns, middleware, guards, interceptors, testing with Jest/Supertest, and integrating databases via TypeORM/Mongoose along with Passport.js authentication.

Core Features & Use Cases

  • Architecture & DI establishes module boundaries, forward references, and provider scopes to prevent circular dependencies.
  • Middleware, Guards, Interceptors & Pipes prescribes execution order, guards for authorization, interceptors for logging and transformation.
  • Testing Strategies outlines unit, integration, and e2e testing approaches using @nestjs/testing, Jest, and Supertest.
  • Database & Auth Integration covers TypeORM/Mongoose configuration and Passport.js JWT strategies for secure authentication.

Quick Start

Propose a modular Nest.js architecture plan for a new project, detailing modules, providers, and an authentication strategy.

Frequently Asked Questions about nestjs-expert

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

FAQPage Schema
How do I prevent circular dependencies in Nest.js modules?

Prevent circular dependencies in Nest.js by establishing clear module boundaries and using forward references with proper provider scopes. This approach maintains a modular structure and resolves injection loops.

What is the execution order of Nest.js middleware, guards, interceptors, and pipes?

In Nest.js, the execution order is middleware, guards, interceptors, and pipes. Guards handle authorization, interceptors manage logging and transformation, and pipes process data validation before the route handler executes.

How do I set up JWT authentication with Passport.js in Nest.js?

Set up JWT authentication in Nest.js by integrating Passport.js strategies. Configure the auth module with secure token generation and validation guards to protect endpoints and verify user identity across requests.

How do I write e2e tests for a Nest.js application using Jest and Supertest?

Write e2e tests for Nest.js using @nestjs/testing alongside Jest and Supertest. Compile the testing module to simulate HTTP requests, verifying integration across modules, database connections, and authentication flows.

Can I use TypeORM and Mongoose together in a Nest.js project?

Yes, Nest.js supports integrating both TypeORM and Mongoose in the same project. You can configure distinct database modules to handle relational and non-relational data stores simultaneously within your architecture.

What is the best way to structure a scalable enterprise Nest.js application?

The best way to structure a scalable enterprise Nest.js app is through modular architecture. Define distinct feature modules, manage dependency injection scopes, and separate business logic into providers to ensure maintainability.