ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified developer tools Safety 5/5

NestJS

Avoid common NestJS mistakes — DI scoping, circular dependencies, validation pipes, and module organization traps.

Why use this skill?

Optimize your NestJS backend with expert advice on DI scoping, module organization, validation pipes, and exception handling to avoid common pitfalls.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/ivangdavila/nestjs
Or

What This Skill Does

The NestJS skill for OpenClaw acts as an expert architectural consultant for your backend development projects. It provides deep-dive knowledge into NestJS best practices, helping you navigate common pitfalls such as circular dependency crashes, improper Dependency Injection (DI) scoping, and validation pipe misconfigurations. Whether you are struggling with provider scoping, module organization, or implementing complex exception filters, this skill provides actionable advice based on industry standards.

Installation

To install this skill, run the following command in your terminal: clawhub install openclaw/skills/skills/ivangdavila/nestjs

Use Cases

  • Debugging Architecture: Use this when your application encounters injection errors, "Provider not found" exceptions, or circular dependencies.
  • Optimizing Data Flow: Consult the skill to configure global pipes, interceptors, and guards in the correct execution order.
  • Refactoring Modules: Get guidance on breaking down monolithic modules into micro-services or shared feature modules using proper exports and @Global() decorators.
  • Testing Assistance: Generate boilerplate for unit and E2E tests, including proper mocking strategies for DI and handling request-scoped providers.
  • Security Hardening: Ensure your DTOs are correctly configured with class-validator and class-transformer to prevent malicious payloads via whitelist and forbidNonWhitelisted settings.

Example Prompts

  1. "I am getting a circular dependency error between my UserModule and AuthModule. How can I fix this using forwardRef?"
  2. "Explain the order of execution in NestJS: if I have a guard, a pipe, and an interceptor on a controller method, in what order do they actually run?"
  3. "Show me how to correctly configure a custom validation pipe that transforms string IDs to numbers while stripping out unknown request body fields."

Tips & Limitations

  • Singleton vs. Request Scope: Remember that the default NestJS provider is a singleton. Be careful with internal state; if your service must be stateful per request, you must explicitly use Scope.REQUEST.
  • Testing: Unit tests do not automatically discover dependencies. Always explicitly mock external services and use .overrideProvider() during compilation.
  • Async Operations: Always remember that service methods are asynchronous. Forgetting an await will return a Promise instead of the expected data, causing runtime errors.
  • Validation: Always use DTOs for @Body() and @Query(). Without defined classes, your decorators will have no metadata to validate against, rendering your pipes ineffective.

Metadata

Stars2102
Views0
Updated2026-03-06
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-ivangdavila-nestjs": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#nestjs#backend#typescript#node#architecture
Safety Score: 5/5

Flags: code-execution