Nestjs Guards Interceptors
This skill provides NestJS Guards and Interceptor functionality for robust backend validation and modification of incoming requests, enhancing security & data integrity.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add nestjs-guards-interceptors npx -- -y @trustedskills/nestjs-guards-interceptors
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"nestjs-guards-interceptors": {
"command": "npx",
"args": [
"-y",
"@trustedskills/nestjs-guards-interceptors"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill provides NestJS Guards and Interceptor functionality to your AI agent, enabling robust backend validation and modification of incoming requests. It allows you to implement authentication, authorization, logging, and request/response transformation within a NestJS application. The skill demonstrates how to create custom guards using CanActivate and access the ExecutionContext for contextual information during request processing.
When to use it
- Implementing authentication checks (e.g., verifying an API key or JWT token).
- Authorizing access to specific routes based on user roles or permissions.
- Logging incoming requests and responses for debugging or auditing purposes.
- Transforming request bodies or response data before processing or sending.
- Gaining insight into the current handler and controller being executed within a NestJS application.
Key capabilities
- Creation of custom guards implementing the
CanActivateinterface. - Access to the
ExecutionContextfor retrieving information about the current request. - Implementation of authentication patterns like JWT, session, and API key verification.
- Method-level guard usage within controllers.
- Logging handler and controller names during execution.
Example prompts
- "Show me how to create a NestJS guard that checks for an authorization header."
- "Explain how to use
ExecutionContextto access the request object in a NestJS guard." - "Give me an example of implementing JWT authentication using a NestJS guard."
Tips & gotchas
- Requires familiarity with NestJS concepts and TypeScript.
- The skill provides code examples; you'll need to adapt them to your specific application logic.
ExecutionContextoffers access to request, response, handler, and controller information – use this for context-aware validation or modification.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.