executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
nestjs-controllers-servicesSeparate Controllers from Services and build Custom Decorators in NestJS. Use when defining NestJS controllers, services, or custom parameter decorators.
Independent GitHub snapshot · Automated classification · Original documentation governs
ExecutionContext helpers (switchToHttp()) for platform-agnostic code.@Request() req -> req.user (Not type-safe).@CurrentUser(), @DeviceIp().import { RequestWithUser } from 'src/common/interfaces/request.interface';
export const CurrentUser = createParamDecorator(
(data: unknown, ctx: ExecutionContext): User => {
const request = ctx.switchToHttp().getRequest<RequestWithUser>();
return request.user;
},
);
whitelist: true: Strip properties without decorators.forbidNonWhitelisted: true: Throw error if unknown properties exist.transform: true: Auto-convert primitives (String '1' -> Number 1) and instantiate DTO classes.@nestjs/swagger CLI plugin in nest-cli.json auto-detects DTO properties — no manual @ApiProperty().map() wraps success responses (e.g. { data: T }).PageDto and ApiResponse.catchError() maps low-level errors (DB constraints) to HttpException (e.g. ConflictException) before global filter.Scope.REQUEST.ValidationPipe globally.ParseIntPipe, ParseUUIDPipe on all ID parameters.@Get(':id')
findOne(@Param('id', ParseIntPipe) id: number) { ... }
OnModuleInit for connection setup.OnApplicationShutdown for cleanup. (Requires enableShutdownHooks()).@CurrentUser() decorator instead of accessing raw req.