nestjs
About
This skill provides NestJS development standards and architectural patterns for building domain-centric applications. It covers modular design, dependency injection, decorator patterns, and key framework features like controllers, services, middleware, and interceptors. Use it when developing NestJS applications, implementing APIs, configuring microservices, or integrating with databases.
Quick Install
Claude Code
Recommended/plugin add https://github.com/KubrickCode/ai-config-toolkitgit clone https://github.com/KubrickCode/ai-config-toolkit.git ~/.claude/skills/nestjsCopy and paste this command in Claude Code to install this skill
Documentation
NestJS Development Standards
Module Organization Principles
Domain-Centric Modularization
Organize modules by business domain, not by function.
- ❌ Bad:
controllers/,services/,repositories/ - ✅ Good:
users/,products/,orders/
Single Responsibility Module
Each module is responsible for only one domain.
- Separate common functionality into
common/orshared/modules - Inter-domain communication must go through Services only
Dependency Injection Rules
Constructor Injection Only
Property injection (@Inject) is forbidden.
// ✅ Good
constructor(private readonly userService: UserService) {}
// ❌ Bad
@Inject() userService: UserService;
Provider Registration Location
Providers are registered only in the module where they are used.
- Minimize global providers
- Use forRoot/forRootAsync only in AppModule
Decorator Usage Rules
Prioritize Custom Decorators
Abstract repeated decorator combinations into custom decorators.
// Create custom decorator when combining 3+ decorators
@Auth() // Integrates @UseGuards + @ApiBearerAuth + @CurrentUser
Decorator Order
Arrange in execution order from top to bottom.
- Metadata decorators (@ApiTags, @Controller, @Resolver)
- Guards/Interceptors (@UseGuards, @UseInterceptors)
- Route decorators (@Get, @Post, @Query, @Mutation)
- Parameter decorators (@Body, @Param, @Args)
DTO/Entity Rules
DTO is Pure Data Transfer
Business logic is forbidden; only validation is allowed.
// ✅ Good: Validation only
class CreateUserDto {
@IsEmail()
email: string;
}
// ❌ Bad: Contains business logic
class CreateUserDto {
toEntity(): User {} // Forbidden
}
Separate Entity and DTO
Never return Entity directly; always convert to DTO.
- Request: CreateInput, UpdateInput (GraphQL) / CreateDto, UpdateDto (REST)
- Response: Type definition or plain object
Error Handling
Domain-Specific Exception Filter
Each domain has its own Exception Filter.
@Module({
providers: [
{
provide: APP_FILTER,
useClass: UserExceptionFilter,
},
],
})
Explicit Error Throwing
Always throw Exception explicitly in all error situations.
- REST: Use HttpException series
- GraphQL: Use GraphQLError or custom error
- Forbid implicit null/undefined returns
- Error messages should be understandable by users
GitHub Repository
Related Skills
content-collections
MetaThis skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.
creating-opencode-plugins
MetaThis skill provides the structure and API specifications for creating OpenCode plugins that hook into 25+ event types like commands, files, and LSP operations. It offers implementation patterns for JavaScript/TypeScript modules that intercept and extend the AI assistant's lifecycle. Use it when you need to build event-driven plugins for monitoring, custom handling, or extending OpenCode's capabilities.
sglang
MetaSGLang is a high-performance LLM serving framework that specializes in fast, structured generation for JSON, regex, and agentic workflows using its RadixAttention prefix caching. It delivers significantly faster inference, especially for tasks with repeated prefixes, making it ideal for complex, structured outputs and multi-turn conversations. Choose SGLang over alternatives like vLLM when you need constrained decoding or are building applications with extensive prefix sharing.
evaluating-llms-harness
TestingThis Claude Skill runs the lm-evaluation-harness to benchmark LLMs across 60+ standardized academic tasks like MMLU and GSM8K. It's designed for developers to compare model quality, track training progress, or report academic results. The tool supports various backends including HuggingFace and vLLM models.
