nestjs-expert

Diagnose and resolve Nest.js architecture, dependency injection, testing, and authentication issues.

3|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/trudyan141/my-antigravity-agents-kit --skill nestjs-expert-trudyan141
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nestjs-expert
Source: https://github.com/trudyan141/my-antigravity-agents-kit/tree/main/templates/.agent/skills/nestjs-expert
Command: npx skills add https://github.com/trudyan141/my-antigravity-agents-kit --skill nestjs-expert-trudyan141

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building enterprise Node.js applications with Nest.js often leads to cryptic dependency injection errors, circular dependencies, misconfigured JWT authentication, and fragile test setups that are hard to debug without deep framework knowledge. ## Core Features & Use Cases - Dependency Injection Debugging: Resolves "Nest can't resolve dependencies" errors, circular dependencies, and module export misconfigurations using proven fixes from real GitHub issues. - Testing Strategy Guidance: Sets up unit, integration, and e2e tests with Jest, Supertest, and @nestjs/testing, including proper mocking of repositories and JwtService. - Database & Auth Integration: Configures TypeORM, Mongoose, and Passport.js/JWT authentication with correct connection handling and guard implementation. - Use Case: When your Nest.js app fails to start with "Unknown authentication strategy 'jwt'", the skill detects your setup, identifies the wrong passport strategy import, and applies the verified fix. ## Quick Start Ask the assistant to diagnose why your Nest.js application throws a dependency resolution error at startup and fix the module configuration.

Frequently Asked Questions about nestjs-expert

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

FAQPage Schema
How do I fix "Nest can't resolve dependencies of the Service" error?

Check that the provider is listed in the module's providers array and exported if used across module boundaries. Also verify there are no typos in provider names and review import order in barrel exports, as these cause misleading error messages.

How to resolve circular dependency errors in Nest.js?

Use forwardRef() on both sides of the dependency, or preferably extract the shared logic into a third module. Be aware that forwardRef can mask deeper design flaws, so consider whether the circular dependency indicates an architectural problem.

Why does Nest.js throw "Unknown authentication strategy 'jwt'"?

This usually happens when the Strategy is imported from 'passport-local' instead of 'passport-jwt'. Also confirm that JwtModule secret matches the JwtStrategy secretOrKey and that the JWT_SECRET environment variable is set.

Does Nest.js support multiple database connections with TypeORM?

Yes, use named connections in TypeOrmModule configuration and specify the connection name in @InjectRepository(). Configure separate connection options for each database and test each connection independently.

How do I mock TypeORM repositories in Nest.js unit tests?

Use getRepositoryToken(Entity) as the provider token in your test module and supply a mock object as useValue. This avoids real database connections in unit tests and keeps them isolated.

When should I use a different expert instead of the Nest.js expert?

Switch to typescript-type-expert for pure TypeScript type issues, database-expert for query optimization, nodejs-expert for runtime problems, or react-expert for frontend React concerns. The skill recommends switching and stops when a specialist fits better.