sdlc-decorator-patterns
NestJS decorator usage: built-in route/param/class decorators, custom decorators via createParamDecorator and SetMetadata, metadata reflection via Reflector. Apply when designing controllers, guards, interceptors, or custom decorators.
Use this skill to:
- Pick the right built-in decorator for routes, params, and DI.
- Compose decorators (@UseGuards(A, B) @UseInterceptors(C)).
- Build custom param decorators (e.g., @CurrentUser()).
- Use metadata for role-based logic (Reflector + SetMetadata).
- Avoid common decorator mistakes.
Do NOT use this skill for:
- General module/DI patterns (see nest-conventions).
- GraphQL-specific decorators (see nest-advanced).
- ORM entity decorators (see nest-data-layer).
Pinned to revision 80fb8ed90710, so it is the text this page describes rather than whatever the author pushed since.
Files
Every link opens the file at its source, pinned to the revision this page describes.