nestjs-expert

Diagnose Nest.js architecture, DI, and testing issues across modules.

Updated Oct 17, 2025
One-click install
npx skills add https://github.com/duynhne/monitoring --skill nestjs-expert-duynhne
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nestjs-expert
Source: https://github.com/duynhne/monitoring/tree/main/.agent/skills/nestjs-expert
Command: npx skills add https://github.com/duynhne/monitoring --skill nestjs-expert-duynhne

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides expert guidance to design scalable Nest.js applications, addressing architecture, dependency injection, and testing challenges.

Core Features & Use Cases

  • Architecture & DI: Design modular, maintainable Nest.js projects with DI patterns, providers, and module boundaries.
  • Testing Strategy: Recommend unit, integration, and e2e strategies using Jest, Supertest, and Nest testing utilities; mock providers and databases.
  • Auth & Database Integration: Guide integration of Passport.js strategies, JWT auth, and database adapters (TypeORM/Mongoose) across services.

Quick Start

Use this skill to review a Nest.js repository and propose a scalable module structure with DI tokens and testing plan.

Frequently Asked Questions about nestjs-expert

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

FAQPage Schema
How do I structure scalable Nest.js modules and manage dependency injection boundaries?

To structure scalable Nest.js modules, design modular projects with clear provider boundaries, custom DI tokens, and strategic module imports. This approach isolates feature domains, enforces maintainable dependency injection patterns, and prevents circular dependencies across enterprise-grade applications.

What's the best way to test Nest.js providers and controllers using Jest?

The best way to test Nest.js providers is using Jest with the Nest testing module to mock dependencies. Implement a mix of unit tests for individual providers and integration tests using Supertest to validate module wiring and controller behavior in isolation.

How do I integrate Passport.js JWT authentication strategies into a Nest.js app?

To integrate Passport.js JWT authentication, implement custom guards and strategies within your Nest.js modules. This secures endpoints by validating tokens, extracting user payloads, and enforcing access control across services using dependency injection for auth providers.

Does this Nest.js guidance cover TypeORM and Mongoose database integration patterns?

Yes, this guidance covers TypeORM and Mongoose integration patterns. It helps configure database adapters within Nest.js modules, ensuring proper repository injection, transaction handling, and optimized query performance across enterprise-grade services.

Why does my Nest.js dependency injection fail when using custom decorators and interceptors?

Nest.js dependency injection often fails with custom decorators and interceptors due to incorrect provider scoping or missing module exports. Ensure interceptors are registered properly and all required dependencies are provided within the correct module context.

Can I use Nest.js testing utilities to mock database connections for e2e tests?

Yes, you can use Nest.js testing utilities to mock database connections for e2e tests. Override providers in the testing module to return mock repositories or databases, allowing you to validate HTTP endpoints without hitting actual database infrastructure.