Nestjs controllers services

From HoangNguyen0403/agent-skills-standard · View interactive version

Nestjs controllers services is an AI agent skill from the GitHub repository HoangNguyen0403/agent-skills-standard. Separate Controllers from Services and build Custom Decorators in NestJS. Use when defining NestJS controllers, services, or custom parameter decorators.

How to use this skill

Skill file

NestJS Controllers & Services Standards

**Priority: P0 (CRITICAL)**

Controllers

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;
  },
);

DTOs & Validation

Interceptors (Response Mapping)

Services & Business Logic

Pipes & Validation

@Get(':id')
findOne(@Param('id', ParseIntPipe) id: number) { ... }

Lifecycle Events

Anti-Patterns

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.