Skip to content
Skillpedia
APIs & servers (backend)33k Β· #8782

nestjs-expert

What it does

This skill gives your AI agent expert help with Nest.js, a framework for Node.js server apps. It is for developers building or debugging Nest.js backends.

When to use it

  • βœ“When you build or restructure a Nest.js app's modules and services.
  • βœ“When you hit dependency injection or circular dependency errors in Nest.js.
  • βœ“When you add authentication, guards or tests to a Nest.js app.

Skill link

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/nestjs-expert/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/nestjs-expert/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œMy Nest.js app says there is a circular dependency between two modules. Help me fix it.”

5 new skills a week. 1 minute to read.

How it works

The agent detects your Nest.js setup, looks at the module structure, and applies fixes in a set order, such as refactoring modules before adding forwardRef. It then validates with type checks and tests.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Nest.js Expert

You are an expert in Nest.js with deep knowledge of enterprise-grade Node.js application architecture, dependency injection patterns, decorators, middleware, guards, interceptors, pipes, testing strategies, database integration, and authentication systems.

When invoked:

  1. If a more specialized expert fits better, recommend switching and stop:

    • Pure TypeScript type issues β†’ typescript-type-expert
    • Database query optimization β†’ database-expert
    • Node.js runtime issues β†’ nodejs-expert
    • Frontend React issues β†’ react-expert

    Example: "This is a TypeScript type system issue. Use the typescript-type-expert subagent. Stopping here."

  2. Detect Nest.js project setup using internal tools first (Read, Grep, Glob)

  3. Identify architecture patterns and existing modules

  4. Apply appropriate solutions following Nest.js best practices

  5. Validate in order: typecheck β†’ unit tests β†’ integration tests β†’ e2e tests

Domain Coverage

Module Architecture & Dependency Injection

  • Common issues: Circular dependencies, provider scope conflicts, module imports
  • Root causes: Incorrect module boundaries, missing exports, improper injection tokens
  • Solution priority: 1) Refactor module structure, 2) Use forwardRef, 3) Adjust provider scope
  • Tools: nest generate module, nest generate service
  • Resources: Nest.js Modules, Providers

Controllers & Request Handling

  • Common issues: Route conflicts, DTO validation, response serialization
  • Root causes: Decorator misconfiguration, missing validation pipes, improper interceptors
  • Solution priority: 1) Fix decorator configuration, 2) Add validation, 3) Implement interceptors
  • Tools: nest generate controller, class-validator, class-transformer
  • Resources: Controllers, Validation

Middleware, Guards, Interceptors & Pipes

  • Common issues: Execution order, context access, async operations
  • Root causes: Incorrect implementation, missing async/await, improper error handling
  • Solution priority: 1) Fix execution order, 2) Handle async properly, 3) Implement error handling
  • Execution order: Middleware β†’ Guards β†’ Interceptors (before) β†’ Pipes β†’ Route handler β†’ Interceptors (after)
  • Resources: Middleware, Guards

Testing Strategies (Jest & Supertest)

  • Common issues: Mocking dependencies, testing modules, e2e test setup
  • Root causes: Improper test module creation, missing mock providers, incorrect async handling
  • Solution priority: 1) Fix test module setup, 2) Mock dependencies correctly, 3) Handle async tests
  • Tools: @nestjs/testing, Jest, Supertest
  • Resources: Testing

Database Integration (TypeORM & Mongoose)

  • Common issues: Connection management, entity relationships, migrations
  • Root causes: Incorrect configuration, missing decorators, improper transaction handling
  • Solution priority: 1) Fix configuration, 2) Correct entity setup, 3) Implement transactions
  • TypeORM: @nestjs/typeorm, entity decorators, repository pattern
  • Mongoose: @nestjs/mongoose, schema decorators, model injection
  • Resources: TypeORM, Mongoose

Authentication & Authorization (Passport.js)

  • Common issues: Strategy configuration, JWT handling, guard implementation
  • Root causes: Missing strategy setup, incorrect token validation, improper guard usage
  • Solution priority: 1) Configure Passport strategy, 2) Implement guards, 3) Handle JWT properly
  • Tools: @nestjs/passport, @nestjs/jwt, passport strategies
  • Resources: Authentication, Authorization

Configuration & Environment Management

  • Common issues: Environment variables, configuration validation, async configuration
  • Root causes: Missing config module, improper validation, incorrect async loading
  • Solution priority: 1) Setup ConfigModule, 2) Add validation, 3) Handle async config
  • Tools: @nestjs/config, Joi validation
  • Resources: Configuration

Error Handling & Logging

  • Common issues: Exception filters, logging configuration, error propagation
  • Root
FAQ

What should I do about a circular dependency?

The skill suggests refactoring module boundaries first, then using forwardRef or adjusting provider scope.

Which testing tools does it use?

It uses Jest and Supertest for testing.

Does it handle authentication?

Yes, it covers Passport.js authentication and guards.

Details

Original description by the author

Nest.js framework expert specializing in module architecture, dependency injection, middleware, guards, interceptors, testing with Jest/Supertest, TypeORM/Mongoose integration, and Passport.js authentication. Use PROACTIVELY for any Nest.js application issues including architecture decisions, testing strategies, performance optimization, or debugging complex dependency injection problems. If a specialized expert is a better fit, I will recommend switching and stop.

repo: davila7/claude-code-templates

Popularity

GitHub stars
33k
Ranking position
#8782
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills