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.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/ivangdavila/nestjsWhat 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
exportsand@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-validatorandclass-transformerto prevent malicious payloads viawhitelistandforbidNonWhitelistedsettings.
Example Prompts
- "I am getting a circular dependency error between my UserModule and AuthModule. How can I fix this using forwardRef?"
- "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?"
- "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
awaitwill 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
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 skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-ivangdavila-nestjs": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: code-execution
Related Skills
Animations
Create performant web animations with proper accessibility and timing.
Arduino
Develop Arduino projects avoiding common wiring, power, and code pitfalls.
Bulgarian
Write Bulgarian that sounds human. Not formal, not robotic, not AI-generated.
Arabic
Write Arabic that sounds human. Not formal, not robotic, not AI-generated.
Assistant
Manage tasks, communications, and scheduling with proactive and organized support.