Nestjs controllers
Skill dkmqflx/nestjs-best-practices-plugin/plugins/nestjs-best-practices/skills/nestjs-controllers
Claude Code plugin: 12 NestJS best-practice skills (90 rules) grounded in the official NestJS docs
npx -y skills add dkmqflx/nestjs-best-practices-plugin --skill nestjs-controllersAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
NestJS controller and routing best practices. Use when writing or reviewing NestJS controllers, route handlers, DTOs, or request/response handling. Triggers on @Controller, @Get/@Post, route params, DTOs, serialization, or API versioning.
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
2.2 KB, as published. Nobody here has run it
NestJS Controllers & Routing
Controllers are the entry point of a NestJS HTTP application: they bind routes to handlers, extract and validate request data, and shape responses. The framework gives you a lot for free (status codes, serialization, validation, versioning) — but only when you stay on the idiomatic path. These rules keep controllers thin, type-safe, and aligned with NestJS v10/v11 conventions so you don't accidentally opt out of framework features.
When to Apply
- Writing or reviewing classes decorated with
@Controller - Adding route handlers with
@Get,@Post,@Put,@Patch,@Delete - Extracting request data via
@Param,@Query,@Body,@Req,@Res - Defining DTO classes for request bodies
- Controlling response status codes and serialization
- Designing RESTful resource paths or versioning a public API
Rules
- thin-controllers — CRITICAL — controllers only route and validate; business logic lives in services
- dto-request-bodies — HIGH — typed DTO classes for
@Body, neverany - async-handlers-return-promises — MEDIUM — return promises/observables and let Nest resolve them
- param-decorators-over-req — HIGH — use
@Param/@Query/@Body, avoid raw@Req/@Res - restful-resource-routing — MEDIUM — consistent resource paths, plural nouns, proper HTTP verbs
- http-status-codes — MEDIUM — use
@HttpCodefor non-default statuses (e.g. 201/204) - serialize-responses — CRITICAL —
ClassSerializerInterceptor+@Excludeto hide sensitive fields - api-versioning — LOW —
enableVersioningfor evolving public APIs
How to Use
Read individual rule files in rules/.