nestjs-expert

Assist with Nest.js development covering modules, DI, testing, and authentication.

Updated Mar 15, 2026
One-click install
npx skills add https://github.com/ariesanhthu/HiveK --skill nestjs-expert-ariesanhthu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nestjs-expert
Source: https://github.com/ariesanhthu/HiveK/tree/main/.agent/skills/nestjs-expert
Command: npx skills add https://github.com/ariesanhthu/HiveK --skill nestjs-expert-ariesanhthu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps developers overcome complex challenges in Nest.js applications, from architectural decisions and dependency injection issues to testing strategies and database integration.

Core Features & Use Cases

  • Architecture & DI: Solves circular dependencies, provider scope conflicts, and module import issues.
  • Testing: Guides on mocking dependencies, setting up test modules, and writing effective unit and integration tests with Jest and Supertest.
  • Database & Auth: Assists with TypeORM/Mongoose integration, connection errors, and Passport.js authentication setup.
  • Use Case: Debugging a "Nest can't resolve dependencies" error in a complex service layer, ensuring all providers are correctly configured and exported across modules.

Quick Start

Use the nestjs-expert skill to help resolve a circular dependency issue in the user module.

Frequently Asked Questions about nestjs-expert

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

FAQPage Schema
How do I fix the "Nest can't resolve dependencies" error in a complex service layer?

The "Nest can't resolve dependencies" error occurs when providers are not correctly configured or exported across Nest.js modules. You must ensure all required providers are properly registered in the module's provider array and that dependent modules import the originating module to access those exports.

How do I set up unit and integration testing in Nest.js using Jest and Supertest?

Testing in Nest.js with Jest and Supertest involves creating test modules, mocking dependencies, and configuring test environments. You build a testing module with Nest.createTestingModule, override providers with custom mocks, and use Supertest to run HTTP assertions against your API endpoints.

Does Nest.js dependency injection support circular dependencies between modules?

Nest.js dependency injection handles circular dependencies using forward references. You resolve circular import issues by utilizing the forwardRef() function in your module imports and inject parameters, allowing two services or modules to reference each other without causing instantiation errors.

What is the best way to integrate TypeORM or Mongoose with a Nest.js backend API?

Integrating TypeORM or Mongoose with a Nest.js backend API requires using the respective Nest.js database packages. You configure the database connection within your root module using forRoot or forRootAsync, define your entities or schemas, and inject the repository or model into your services.

How do I configure Passport.js authentication with guards and interceptors in Nest.js?

Configuring Passport.js authentication in Nest.js involves implementing custom guards and interceptors to protect routes. You define a Passport strategy, apply the AuthGuard to your controllers, and use interceptors to map or modify the response data before it returns to the client.

Why does my Nest.js middleware throw provider scope conflicts during module import?

Nest.js middleware provider scope conflicts happen when request-scoped providers are incorrectly mixed with singleton-scoped modules. You must align provider scopes across modules and ensure middleware correctly resolves dependencies by checking the injection scope defined in the provider metadata.